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

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


    }

    public void moveProducts(ProductType type) throws Exception {
        // paginate through the product list

        ProductPage page = fmgrClient.getFirstPage(type);

        for (int i = 0; i < page.getTotalPages(); i++) {
            if (page.getPageProducts() != null
                    && page.getPageProducts().size() > 0) {
                for (Iterator j = page.getPageProducts().iterator(); j
                        .hasNext();) {
                    Product p = (Product) j.next();
                    p.setProductReferences(fmgrClient.getProductReferences(p));
                    Metadata met = fmgrClient.getMetadata(p);
                    Reference r = ((Reference) p.getProductReferences().get(0));
                    String newLocPath = PathUtils.replaceEnvVariables(
                            this.pathSpec, met);

                    LOG.log(Level.INFO, "Moving product: ["
                            + p.getProductName() + "] from: ["
                            + new File(new URI(r.getDataStoreReference()))
                            + "] to: [" + newLocPath + "]");
                    long timeBefore = System.currentTimeMillis();
                    fmgrClient.moveProduct(p, newLocPath);
                    long timeAfter = System.currentTimeMillis();
                    double seconds = ((timeAfter - timeBefore) * 1.0) / (1000.0);
                    LOG.log(Level.INFO, "Product: [" + p.getProductName()
                            + "] move successful: took: [" + seconds
                            + "] seconds");
                }

                if (!page.isLastPage()) {
                    page = fmgrClient.getNextPage(type, page);
                }
            }
        }
    }
View Full Code Here


            int pageNum) throws CatalogException {
        ProductType type = XmlRpcStructFactory
                .getProductTypeFromXmlRpc(productTypeHash);
        Query query = XmlRpcStructFactory.getQueryFromXmlRpc(queryHash);

        ProductPage prodPage = null;

        try {
            prodPage = catalog.pagedQuery(this.getCatalogQuery(query, type), type, pageNum);

            if (prodPage == null) {
                prodPage = ProductPage.blankPage();
            } else {
                // it is possible here that the underlying catalog did not
                // set the ProductType
                // to obey the contract of the File Manager, we need to make
                // sure its set here
                setProductType(prodPage.getPageProducts());
            }
        } catch (Exception e) {
            e.printStackTrace();
            LOG.log(Level.WARNING,
                    "Catalog exception performing paged query for product type: ["
View Full Code Here

    public Hashtable<String, Object> getFirstPage(
            Hashtable<String, Object> productTypeHash) {
        ProductType type = XmlRpcStructFactory
                .getProductTypeFromXmlRpc(productTypeHash);
        ProductPage page = catalog.getFirstPage(type);
        try {
            setProductType(page.getPageProducts());
        } catch (Exception e) {
            LOG.log(Level.WARNING,
                    "Unable to set product types for product page list: ["
                            + page + "]");
        }
View Full Code Here

    public Hashtable<String, Object> getLastPage(
            Hashtable<String, Object> productTypeHash) {
        ProductType type = XmlRpcStructFactory
                .getProductTypeFromXmlRpc(productTypeHash);
        ProductPage page = catalog.getLastProductPage(type);
        try {
            setProductType(page.getPageProducts());
        } catch (Exception e) {
            LOG.log(Level.WARNING,
                    "Unable to set product types for product page list: ["
                            + page + "]");
        }
View Full Code Here

    public Hashtable<String, Object> getNextPage(
            Hashtable<String, Object> productTypeHash,
            Hashtable<String, Object> currentPageHash) {
        ProductType type = XmlRpcStructFactory
                .getProductTypeFromXmlRpc(productTypeHash);
        ProductPage currPage = XmlRpcStructFactory
                .getProductPageFromXmlRpc(currentPageHash);
        ProductPage page = catalog.getNextPage(type, currPage);
        try {
            setProductType(page.getPageProducts());
        } catch (Exception e) {
            LOG.log(Level.WARNING,
                    "Unable to set product types for product page list: ["
                            + page + "]");
        }
View Full Code Here

    public Hashtable<String, Object> getPrevPage(
            Hashtable<String, Object> productTypeHash,
            Hashtable<String, Object> currentPageHash) {
        ProductType type = XmlRpcStructFactory
                .getProductTypeFromXmlRpc(productTypeHash);
        ProductPage currPage = XmlRpcStructFactory
                .getProductPageFromXmlRpc(currentPageHash);
        ProductPage page = catalog.getPrevPage(type, currPage);
        try {
            setProductType(page.getPageProducts());
        } catch (Exception e) {
            LOG.log(Level.WARNING,
                    "Unable to set product types for product page list: ["
                            + page + "]");
        }
View Full Code Here

    public ProductPage getFirstPage(ProductType type) throws CatalogException {
        Vector<Object> argList = new Vector<Object>();
        argList.add(XmlRpcStructFactory.getXmlRpcProductType(type));

        ProductPage page = null;
        Hashtable<String, Object> pageHash = null;

        try {
            pageHash = (Hashtable<String, Object>) client.execute(
                    "filemgr.getFirstPage", argList);
View Full Code Here

    public ProductPage getLastPage(ProductType type) throws CatalogException {
        Vector<Object> argList = new Vector<Object>();
        argList.add(XmlRpcStructFactory.getXmlRpcProductType(type));

        ProductPage page = null;
        Hashtable<String, Object> pageHash = null;

        try {
            pageHash = (Hashtable<String, Object>) client.execute(
                    "filemgr.getLastPage", argList);
View Full Code Here

            throws CatalogException {
        Vector<Object> argList = new Vector<Object>();
        argList.add(XmlRpcStructFactory.getXmlRpcProductType(type));
        argList.add(XmlRpcStructFactory.getXmlRpcProductPage(currPage));

        ProductPage page = null;
        Hashtable<String, Object> pageHash = null;

        try {
            pageHash = (Hashtable<String, Object>) client.execute(
                    "filemgr.getNextPage", argList);
View Full Code Here

            throws CatalogException {
        Vector<Object> argList = new Vector<Object>();
        argList.add(XmlRpcStructFactory.getXmlRpcProductType(type));
        argList.add(XmlRpcStructFactory.getXmlRpcProductPage(currPage));

        ProductPage page = null;
        Hashtable<String, Object> pageHash = null;

        try {
            pageHash = (Hashtable<String, Object>) client.execute(
                    "filemgr.getPrevPage", argList);
View Full Code Here

TOP

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

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.