Package org.apache.oodt.cas.filemgr.structs

Examples of org.apache.oodt.cas.filemgr.structs.Query


        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
       
        Query query = new Query();
        TermQueryCriteria termQuery = new TermQueryCriteria();
        termQuery.setElementName("DataVersion");
        termQuery.setValue("4.0");
        query.addCriterion(termQuery);
       
        List<Product> products = fmClient.query(query, genericFile);
        assertEquals(products.get(0).getProductId(), testProduct.getProductId());
    }
View Full Code Here


        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
        ProductType genericFile = fmClient.getProductTypeByName("GenericFile");
        assertEquals("04.00", (met = fmClient.getCatalogValues(met, genericFile)).getMetadata("DataVersion"));
        assertEquals("4.0", fmClient.getOrigValues(met, genericFile).getMetadata("DataVersion"));
       
        Query query = new Query();
        TermQueryCriteria termQuery = new TermQueryCriteria();
        termQuery.setElementName("DataVersion");
        termQuery.setValue("4.0");
        query.addCriterion(termQuery);
        query = fmClient.getCatalogQuery(query, genericFile);
        assertEquals("04.00", ((TermQueryCriteria) query.getCriteria().get(0)).getValue());
    }
View Full Code Here

         * (non-Javadoc)
         *
         * @see org.apache.oodt.cas.filemgr.catalog.DataSourceCatalog#getFirstPage(org.apache.oodt.cas.filemgr.structs.ProductType)
         */
        public ProductPage getFirstPage(ProductType type) {
            Query query = new Query();
            ProductPage firstPage = null;

            try {
                firstPage = pagedQuery(query, type, 1);
            } catch (CatalogException e) {
View Full Code Here

            if (currentPage.isLastPage()) {
                return currentPage;
            }

            ProductPage nextPage = null;
            Query query = new Query();

            try {
                nextPage = pagedQuery(query, type, currentPage.getPageNum() + 1);
            } catch (CatalogException e) {
                LOG.log(Level.WARNING, "Exception getting next page: Message: "
View Full Code Here

  }
 
  @Override
  public ProductPage getFirstPage(ProductType type) {
    try {
      return this.pagedQuery(new Query(), type, 1);
     
    } catch(CatalogException e) {
      throw new RuntimeException(e.getMessage());
    }
  }
View Full Code Here

        queryHash.put("criteria", criteriaVector);
        return queryHash;
    }

    public static Query getQueryFromXmlRpc(Hashtable<String, Object> queryHash) {
        Query query = new Query();
        @SuppressWarnings("unchecked")
        List<QueryCriteria> criteria = getQueryCriteriaListFromXmlRpc((Vector<Hashtable<String, Object>>) queryHash
                .get("criteria"));
        query.setCriteria(criteria);
        return query;
    }
View Full Code Here

     
      // compute last page number
      int numOfPages = PaginationUtils.getTotalPage(numTotalResults, Parameters.PAGE_SIZE);
     
      // request last page
      return pagedQuery(new Query(), type, numOfPages);
   
    } catch(CatalogException e) {
      throw new RuntimeException(e.getMessage());
    }
   
View Full Code Here

   
    int nextPageNumber = currentPage.getPageNum()+1;
    if (nextPageNumber>currentPage.getTotalPages()) throw new RuntimeException("Invalid next page number: "+nextPageNumber);

    try {
      return this.pagedQuery(new Query(), type, currentPage.getPageNum()+1);
     
    } catch(CatalogException e) {
      throw new RuntimeException(e.getMessage());
    }
   
View Full Code Here

   
    int prevPageNumber = currentPage.getPageNum()-1;
    if (prevPageNumber<=0) throw new RuntimeException("Invalid previous page number: "+prevPageNumber);
   
    try {
      return this.pagedQuery(new Query(), type, prevPageNumber);
     
    } catch(CatalogException e) {
      throw new RuntimeException(e.getMessage());
    }
   
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.apache.oodt.cas.filemgr.util.Pagination#getFirstPage(org.apache.oodt.cas.filemgr.structs.ProductType)
     */
    public ProductPage getFirstPage(ProductType type) {
        Query query = new Query();
        ProductPage firstPage = null;

        try {
            firstPage = pagedQuery(query, type, 1);
        } catch (CatalogException e) {
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.structs.Query

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.