Package org.apache.oodt.cas.catalog.page

Examples of org.apache.oodt.cas.catalog.page.PageInfo


    assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
    assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);

    //test query using std paging
    qe = QueryParser.parseQueryExpression("testkey1 == 'testval1'");
    Page page = cs.getPage(new PageInfo(20, PageInfo.FIRST_PAGE), qe);
    metadatas = cs.getMetadata(page);
    assertEquals(metadatas.size(), 1);
    ingestedMetadata = metadatas.get(0).getMetadata();
    assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
    assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);

    //test query using std paging with catalog restriction
    qe = QueryParser.parseQueryExpression("testkey1 == 'testval1'");
    page = cs.getPage(new PageInfo(20, PageInfo.FIRST_PAGE), qe, Collections.singleton("TestCatalog1"));
    metadatas = cs.getMetadata(page);
    assertEquals(metadatas.size(), 1);
    ingestedMetadata = metadatas.get(0).getMetadata();
    assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
    assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 1);
View Full Code Here


    }
  }
 
  public Page getNextPage(Page page) throws CatalogServiceException {
    QueryPager queryPager = new QueryPager(this._query(page.getQueryExpression(), page.getRestrictToCatalogIds()));
    queryPager.setPageInfo(new PageInfo(page.getPageSize(), page.getPageNum() + 1));
    return this.getPage(page.getQueryExpression(), page.getRestrictToCatalogIds(), queryPager);
  }
View Full Code Here

         QueryExpression queryExpression = QueryParser
               .parseQueryExpression(query);
         Page page = null;
         if (catalogIds == null) {
            page = getClient().getPage(new PageInfo(pageSize, pageNum),
                  queryExpression);
         } else {
            page = getClient().getPage(new PageInfo(pageSize, pageNum),
                  queryExpression, catalogIds);
         }
         List<TransactionalMetadata> transactionMetadatas = getClient()
               .getMetadata(page);
         for (TransactionalMetadata tMet : transactionMetadatas) {
View Full Code Here

         QueryExpression queryExpression = QueryParser
               .parseQueryExpression(query);
         Page page = null;
         if (catalogIds == null) {
            page = getClient().getPage(new PageInfo(pageSize, pageNum),
                  queryExpression);
         } else {
            page = getClient().getPage(new PageInfo(pageSize, pageNum),
                  queryExpression, catalogIds);
         }
         List<TransactionalMetadata> transactionMetadatas = getClient()
               .getMetadata(page);
         for (TransactionalMetadata tMet : transactionMetadatas) {
View Full Code Here

    assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
    assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);

    // test query using std paging
    qe = QueryParser.parseQueryExpression("testkey1 == 'testval1'");
    Page page = cs.getPage(new PageInfo(20, PageInfo.FIRST_PAGE), qe);
    metadatas = cs.getMetadata(page);
    assertEquals(metadatas.size(), 1);
    ingestedMetadata = metadatas.get(0).getMetadata();
    assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
    assertEquals(ingestedMetadata.getAllMetadata("testkey1").size(), 2);

    // test query using std paging with catalog restriction
    qe = QueryParser.parseQueryExpression("testkey1 == 'testval1'");
    page = cs.getPage(new PageInfo(20, PageInfo.FIRST_PAGE), qe,
        Collections.singleton("TestCatalog1"));
    metadatas = cs.getMetadata(page);
    assertEquals(metadatas.size(), 1);
    ingestedMetadata = metadatas.get(0).getMetadata();
    assertEquals(ingestedMetadata.getMetadata("testkey1"), "testval1");
View Full Code Here

 
  public void performAction(CatalogServiceClient csClient) throws Exception {
    QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
    Page page = null;
    if (catalogIds == null)
      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression);
    else
      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression, catalogIds);
    List<TransactionalMetadata> transactionMetadatas = csClient.getMetadata(page);
    for (TransactionalMetadata tMet : transactionMetadatas) {
      System.out.print("ID: " + tMet.getTransactionId() + " ; CatalogIDs: " + tMet.getCatalogIds() + " ; Metadata: (");
      StringBuffer sb = new StringBuffer("");
      for (Object metKey : tMet.getMetadata().getHashtable().keySet()) {
View Full Code Here

 
  public void performAction(CatalogServiceClient csClient) throws Exception {
    QueryExpression queryExpression = QueryParser.parseQueryExpression(query);
    Page page = null;
    if (catalogIds == null)
      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression);
    else
      page = csClient.getPage(new PageInfo(pageSize, pageNum), queryExpression, catalogIds);
    List<TransactionalMetadata> transactionMetadatas = csClient.getMetadata(page);
    for (TransactionalMetadata tMet : transactionMetadatas) {
      StringBuffer sb = new StringBuffer("");
      for (String termName : this.termNames) {
        List<String> values = tMet.getMetadata().getAllMetadata((String) termName);
View Full Code Here

  public List<TransactionalMetadata> getAllPages(QueryPager queryPager)
      throws CatalogServiceException {
    try {
      List<TransactionalMetadata> metadata = new Vector<TransactionalMetadata>();
      if (queryPager.getTotalPages() > 0) {
        queryPager.setPageInfo(new PageInfo(this.autoPagerSize, PageInfo.FIRST_PAGE));
        while (!queryPager.isLastPage()) {
          metadata.addAll(this.communicationChannelClient.getNextPage(queryPager));
          queryPager.incrementPageNumber();
        }
        metadata.addAll(this.communicationChannelClient.getNextPage(queryPager));
View Full Code Here

    }
  }
 
  public Page getNextPage(Page page) throws CatalogServiceException {
    QueryPager queryPager = new QueryPager(this._query(page.getQueryExpression(), page.getRestrictToCatalogIds()));
    queryPager.setPageInfo(new PageInfo(page.getPageSize(), page.getPageNum() + 1));
    return this.getPage(page.getQueryExpression(), page.getRestrictToCatalogIds(), queryPager);
  }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.catalog.page.PageInfo

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.