Examples of Catalog


Examples of org.apache.oodt.cas.catalog.system.Catalog

    return properties;
  }
 
  public Properties getCalalogProperties(String catalogUrn) throws CatalogServiceException {
    try {
      Catalog catalog = this.getCatalog(catalogUrn);
      if (catalog != null)
        return catalog.getProperties();
      else
        return null;
    }catch (Exception e) {
      throw new CatalogServiceException("Failed to get catalog properties from catalog '" + catalogUrn + "' : " + e.getMessage(), e);
    }
View Full Code Here

Examples of org.apache.oodt.cas.catalog.system.Catalog

    if (this.disableIntersectingCrossCatalogQueries) {
      try {
        int totalResults = 0;
        LinkedHashMap<String, Integer> catalogToSizeOfMap = new LinkedHashMap<String, Integer>();
        for (String catalogId : catalogIds) {
          Catalog catalog = this.getCatalog(catalogId);
          QueryExpression qe = this.reduceToUnderstoodExpressions(catalog, queryExpression);
          if (qe != null) {
            int catalogResultSize = catalog.sizeOf(qe);
            totalResults += catalogResultSize;
            catalogToSizeOfMap.put(catalogId, catalogResultSize);
          }
        }
       
        LOG.log(Level.INFO, "Routing query to catalogs as non-cross catalog intersecting queries . . .");
        if (totalResults <= this.crossCatalogResultSortingThreshold) {
          List<CatalogReceipt> catalogReceipts = new Vector<CatalogReceipt>();
          for (String catalogId : catalogToSizeOfMap.keySet()) {
            Catalog catalog = this.getCatalog(catalogId);
            QueryExpression qe = this.reduceToUnderstoodExpressions(catalog, queryExpression);
            if (qe != null)
              catalogReceipts.addAll(catalog.query(qe));
          }
          List<TransactionReceipt> transactionReceipts = this.getPossiblyUnindexedTransactionReceipts(catalogReceipts);
          LOG.log(Level.INFO, "Sorting Query Results . . . ");
          Collections.sort(transactionReceipts, new Comparator<TransactionReceipt>() {
            public int compare(TransactionReceipt o1,
                TransactionReceipt o2) {
              return o2.getTransactionDate().compareTo(o1.getTransactionDate());
            }
          });
          QueryPager queryPager = new QueryPager(transactionReceipts);
          queryPager.setPageInfo(pageInfo);
          return this.getPage(queryExpression, catalogIds, queryPager);
        }else {
          int currentIndex = 0;
          int desiredStartingIndex = pageInfo.getPageNum() * pageInfo.getPageSize();
          List<CatalogReceipt> pageOfReceipts = new Vector<CatalogReceipt>();
          for (Entry<String, Integer> entry : catalogToSizeOfMap.entrySet()) {
            if (desiredStartingIndex - currentIndex <= entry.getValue()) {
              Catalog catalog = this.getCatalog(entry.getKey());
              QueryExpression qe = this.reduceToUnderstoodExpressions(catalog, queryExpression);
              if (qe != null) {
                List<CatalogReceipt> receipts = catalog.query(qe, desiredStartingIndex - currentIndex, Math.min((desiredStartingIndex - currentIndex) + pageInfo.getPageSize(), entry.getValue()));
                pageOfReceipts.addAll(receipts);
                if (pageOfReceipts.size() >= pageInfo.getPageSize())
                  break;
              }
            }else {
View Full Code Here

Examples of org.apache.oodt.cas.catalog.system.Catalog

    for (TransactionReceipt transactionReceipt : transactionReceipts) {
      Metadata metadata = new Metadata();
      Vector<CatalogReceipt> successfulCatalogReceipts = new Vector<CatalogReceipt>();
      for (CatalogReceipt catalogReceipt : transactionReceipt.getCatalogReceipts()) {
        try {
          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
View Full Code Here

Examples of org.apache.oodt.cas.catalog.system.Catalog

    try {
      if (metadata.getMetadata(CatalogServiceLocal.CATALOG_SERVICE_TRANSACTION_ID_MET_KEY) != null) {
        return this.generateTransactionId(metadata.getMetadata(CatalogServiceLocal.CATALOG_SERVICE_TRANSACTION_ID_MET_KEY));
      }else if (metadata.getMetadata(CatalogServiceLocal.CATALOG_TRANSACTION_ID_MET_KEY) != null && metadata.getMetadata(CatalogServiceLocal.CATALOG_ID_MET_KEY) != null) {
        String catalogId = metadata.getMetadata(CatalogServiceLocal.CATALOG_ID_MET_KEY);
        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) {
View Full Code Here

Examples of org.apache.oodt.cas.catalog.system.Catalog

  }
 
  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);
        }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.catalog.Catalog

        assertNotNull(repMgr);

    }

    public void testGetCatalogServiceFromFactory() {
        Catalog cat = GenericFileManagerObjectFactory
                .getCatalogServiceFromFactory(catalogServiceFactory);
        assertNotNull(cat);

    }
View Full Code Here

Examples of org.apache.xml.resolver.Catalog

        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here

Examples of org.apache.xml.resolver.Catalog

        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here

Examples of org.apache.xml.resolver.Catalog

        return getTargetNode(resolvedLocation);
    }

    private String resolveByCatalog(String url) {
        Bus bus = (Bus)env.get(Bus.class);
        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
        String resolvedLocation;
        try {
            resolvedLocation = catalogResolver.resolveSystem(url);
            if (resolvedLocation == null) {
                resolvedLocation = catalogResolver.resolveURI(url);
            }
        } catch (Exception e1) {
            Message msg = new Message("FAILED_RESOLVE_CATALOG", LOG, url);
            throw new ToolException(msg, e1);
        }
View Full Code Here

Examples of org.apache.xml.resolver.Catalog

   * Get a new catalog instance.
   *
   * This method always returns a new instance of the underlying catalog class.
   */
  public Catalog getPrivateCatalog() {
    Catalog catalog = staticCatalog;

    if (useStaticCatalog == null) {
      useStaticCatalog = new Boolean(getUseStaticCatalog());
    }

    if (catalog == null || !useStaticCatalog.booleanValue()) {

      try {
  String catalogClassName = getCatalogClassName();

  if (catalogClassName == null) {
    catalog = new Catalog();
  } else {
    try {
      catalog = (Catalog) Class.forName(catalogClassName).newInstance();
    } catch (ClassNotFoundException cnfe) {
      debug.message(1,"Catalog class named '"
        + catalogClassName
        + "' could not be found. Using default.");
      catalog = new Catalog();
    } catch (ClassCastException cnfe) {
      debug.message(1,"Class named '"
        + catalogClassName
        + "' is not a Catalog. Using default.");
      catalog = new Catalog();
    }
  }

  catalog.setCatalogManager(this);
  catalog.setupReaders();
  catalog.loadSystemCatalogs();
      } catch (Exception ex) {
  ex.printStackTrace();
      }

      if (useStaticCatalog.booleanValue()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.