Package org.apache.oodt.cas.catalog.exception

Examples of org.apache.oodt.cas.catalog.exception.CatalogServiceException


 
  public List<TransactionalMetadata> getAllPages(QueryPager queryPager) throws CatalogServiceException {
    try {
      return this.getMetadata(queryPager.getTransactionReceipts());
    }catch (Exception e) {
      throw new CatalogServiceException("Failed to get all page of Metadata : " + e.getMessage(), e);
   
  }
View Full Code Here


          Catalog catalog = this.getCatalog(catalogReceipt.getCatalogId());
          metadata.addMetadata(catalog.getMetadata(catalogReceipt.getTransactionId()));
          successfulCatalogReceipts.add(catalogReceipt);
        }catch (Exception e) {
          if (this.oneCatalogFailsAllFail)
            throw new CatalogServiceException("Failed to get metadata for transaction ids for catalog '" + catalogReceipt.getCatalogId() + "' : " + e.getMessage(), e);
          else
            LOG.log(Level.WARNING, "Failed to get metadata for transaction ids for catalog '" + catalogReceipt.getCatalogId() + "' : " + e.getMessage(), e);
        }
      }
      if (metadata.getHashtable().keySet().size() > 0)
View Full Code Here

            metadata.addMetadata(catalog.getMetadata(catalogReceipt.getTransactionId()).getHashtable());
            catalogReceipts.add(catalogReceipt);
          }
        }catch (Exception e) {
          if (this.oneCatalogFailsAllFail)
            throw new CatalogServiceException("Failed to get metadata for transaction ids for catalog '" + catalog.getId() + "' : " + e.getMessage(), e);
          else
            LOG.log(Level.WARNING, "Failed to get metadata for transaction ids for catalog '" + catalog.getId() + "' : " + e.getMessage(), e);
        }
      }
      if (metadata.getHashtable().keySet().size() > 0)
View Full Code Here

  public TransactionId<?> getCatalogServiceTransactionId(TransactionId<?> catalogTransactionId, String catalogUrn) throws CatalogServiceException {
    this.ingestMapperLock.readLock().lock();
    try {
      return this.ingestMapper.getCatalogServiceTransactionId(catalogTransactionId, catalogUrn);
    }catch (Exception e) {
      throw new CatalogServiceException(e.getMessage(), e);
    }finally {
      this.ingestMapperLock.readLock().unlock();
    }
  }
View Full Code Here

        LOG.log(Level.INFO, "CatalogServer mapping transaction: " + catalogServiceTransactionId + "," + catalogReceipt.getTransactionId() + "," + catalogReceipt.getCatalogId());
        this.ingestMapperLock.writeLock().lock();
        try {
          this.ingestMapper.storeTransactionIdMapping(catalogServiceTransactionId, this.transactionIdFactory, catalogReceipt, this.getCatalog(catalogReceipt.getCatalogId()).getTransactionIdFactory());
        }catch (Exception e) {
          throw new CatalogServiceException("Failed to write TransactionId '" + catalogServiceTransactionId + "' : " + e.getMessage(), e);
        }finally {
          this.ingestMapperLock.writeLock().unlock();
        }
      }
      return catalogServiceTransactionId;
    }catch (Exception e) {
      throw new CatalogServiceException("Failed to get CatalogServiceTransactionId : " + e.getMessage(), e);
    }
  }
View Full Code Here

        Catalog catalog = this.getCatalog(catalogId);
        if (catalog != null) {
          TransactionId<?> catalogTransactionId = catalog.getTransactionIdFromString(metadata.getMetadata(CatalogServiceLocal.CATALOG_TRANSACTION_ID_MET_KEY));
          TransactionId<?> catalogServiceTransactionId = this.ingestMapper.getCatalogServiceTransactionId(catalogTransactionId, catalogId);
          if (catalogServiceTransactionId == null)
            throw new CatalogServiceException("CatalogService's Catalog '" + catalog.getId() + "' is not aware of TransactionId '" + catalogTransactionId + "'s");
          return catalogServiceTransactionId;
        }else {
          throw new CatalogServiceException("This CatalogService has no Catalog with ID = '" + catalogId + "'");
        }
      }else if (generateNew) {
        return this.generateNewUniqueTransactionId();
      }else {
        throw new CatalogServiceException("Metadata fields not present to determine a TransactionId");
      }
    }catch (Exception e) {
      throw new CatalogServiceException("Failed determine TransactionId : " + e.getMessage(), e);
    }
  }
View Full Code Here

  protected Set<Catalog> getFilteredCatalogList(Metadata metadata) throws CatalogServiceException {
    try {
      if (metadata.containsKey(CATALOG_ID_MET_KEY)) {
        Catalog catalog = this.getCatalog(metadata.getMetadata(CATALOG_ID_MET_KEY));
        if (catalog == null)
          throw new CatalogServiceException("Catalog '" + metadata.getMetadata(CATALOG_ID_MET_KEY) + "' is not managed by this CatalogService");
        else
          return Collections.singleton(catalog);
      }else if (metadata.containsKey(CATALOG_IDS_MET_KEY)) {
        HashSet<Catalog> filteredCatalogList = new HashSet<Catalog>();
        for (Object catalogUrn : metadata.getAllMetadata(CATALOG_IDS_MET_KEY)) {
          Catalog catalog = this.getCatalog((String) catalogUrn);
          if (catalog == null)
            throw new CatalogServiceException("Catalog '" + metadata.getMetadata(CATALOG_ID_MET_KEY) + "' is not managed by this CatalogService");
          else
            filteredCatalogList.add(catalog);
        }
        return filteredCatalogList;
      }else {
        return new HashSet<Catalog>(this.catalogs);
      }
    }catch (Exception e) {
      throw new CatalogServiceException("Failed to get filtered catalog list : " + e.getMessage(), e);
    }
  }
View Full Code Here

              try {
                if (childQueryResult.getInterestedCatalogs().contains(catalog.getId()))
                  catalogReceipts.addAll(catalog.query(this.reduceToUnderstoodExpressions(catalog, childQueryResult.getQueryExpression())));
              }catch (Exception e) {
                if (this.oneCatalogFailsAllFail)
                  throw new CatalogServiceException("Failed to query catalog '" + catalog.getId() + "' for query '" + queryExpression + "' : " + e.getMessage(), e);
                else
                  LOG.log(Level.WARNING, "Failed to query catalog '" + catalog.getId() + "' for query '" + queryExpression + "' : " + e.getMessage(), e);
              }
            }
            childQueryResult.setCatalogReceipts(catalogReceipts);
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.catalog.exception.CatalogServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.