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

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


        }

        // add the product references
        for (Iterator<Reference> i = product.getProductReferences().iterator(); i
                .hasNext();) {
            Reference r = i.next();
            doc.add(new Field("reference_orig", r.getOrigReference(),
                    Field.Store.YES, Field.Index.NO));
            doc
                    .add(new Field("reference_data_store", r
                            .getDataStoreReference(), Field.Store.YES,
                            Field.Index.NO));
            doc.add(new Field("reference_fileSize", String.valueOf(r
                    .getFileSize()), Field.Store.YES, Field.Index.NO));
            doc.add(new Field("reference_mimeType", r.getMimeType() != null ? r
                    .getMimeType().getName() : "", Field.Store.YES,
                    Field.Index.UN_TOKENIZED));
        }

        // add special field for all products
View Full Code Here


    private boolean hasMetadataAndRefs(CompleteProduct cp) {
        if (cp.getMetadata() != null && cp.getProduct() != null) {
            if (cp.getReferences() != null && cp.getReferences().size() > 0) {
                // make sure there is a data store ref for each of the refs
                for (Iterator<Reference> i = cp.getReferences().iterator(); i.hasNext();) {
                    Reference r = i.next();
                    if (r.getDataStoreReference() == null
                            || (r.getDataStoreReference() != null && r
                                    .getDataStoreReference().equals(""))) {
                        return false;
                    }
                }
View Full Code Here

            if (origFileRef == null) {
                System.err.println(getFilePctTransferOperation);
                System.exit(1);
            }

            Reference ref = new Reference();
            ref.setOrigReference(origFileRef);
            ref.setDataStoreReference("file:/foo/bar"); // doesn't matter: won't
            // be
            // used in the comparison on
            // the server side

            double pct = 0.0;
View Full Code Here

               ProductType pt = new ProductType();
               pt.setName(PRODUCT_TYPE_NAME);
               p.setProductType(pt);
               p.setProductStructure(PRODUCT_STRUCTURE);
               p.setTransferStatus(PRODUCT_STATUS);
               p.setRootRef(new Reference("file:/dummy/path", ROOT_REF, 2));
               p.setProductReferences(Lists.newArrayList(new Reference(
                     ORIG_REF_1, DS_REF_1, FILE_SIZE_REF_1), new Reference(
                     ORIG_REF_2, DS_REF_2, FILE_SIZE_REF_2)));
               return p;
            }
         };
      }
View Full Code Here

               ProductType pt = new ProductType();
               pt.setName(PRODUCT_TYPE_NAME);
               p.setProductType(pt);
               p.setProductStructure(PRODUCT_STRUCTURE);
               p.setTransferStatus(PRODUCT_STATUS);
               p.setRootRef(new Reference("file:/dummy/path", ROOT_REF, 2));
               p.setProductReferences(Lists.newArrayList(new Reference(
                     ORIG_REF_1, DS_REF_1, FILE_SIZE_REF_1), new Reference(
                     ORIG_REF_2, DS_REF_2, FILE_SIZE_REF_2)));
               return p;
            }
         };
      }
View Full Code Here

         return new XmlRpcFileManagerClient(new URL("http://localhost:9000"),
               false) {
            @Override
            public List<FileTransferStatus> getCurrentFileTransfers() {
               status = new FileTransferStatus();
               status.setFileRef(new Reference(ORIG_REF, DS_REF, FILE_SIZE));
               status.setBytesTransferred(BYTE_TRANS);
               Product parentProduct = new Product();
               parentProduct.setProductName(PRODUCT_NAME);
               status.setParentProduct(parentProduct);
               return Lists.newArrayList(status);
View Full Code Here

               p.setProductName(productName);
               return p;
            }
            @Override
            public List<Reference> getProductReferences(Product product) {
               product.setProductReferences(Lists.newArrayList(new Reference(
                     "file:/file/path", REF_1, 2), new Reference(
                     "file:/file/path", REF_2, 2)));
               return product.getProductReferences();
            }
            @Override
            public boolean removeProduct(Product p) {
View Full Code Here

               p.setProductName(PRODUCT_NAME);
               return p;
            }
            @Override
            public List<Reference> getProductReferences(Product product) {
               product.setProductReferences(Lists.newArrayList(new Reference(
                     "file:/file/path", REF_1, 2), new Reference(
                     "file:/file/path", REF_2, 2)));
               return product.getProductReferences();
            }
            @Override
            public boolean removeProduct(Product p) {
View Full Code Here

               p.setProductName(PRODUCT_NAME);
               return p;
            }
            @Override
            public List<Reference> getProductReferences(Product product) {
               product.setProductReferences(Lists.newArrayList(new Reference(
                     "file:/file/path", REF_1, 2), new Reference(
                     "file:/file/path", REF_2, 2)));
               return product.getProductReferences();
            }
            @Override
            public boolean removeProduct(Product p) {
View Full Code Here

      Product testProduct = null;
      for(int i = 0; i < catPageSize + 1; i++){
        testProduct = Product.getDefaultFlatProduct("test" + i,
          "urn:oodt:GenericFile");
        testProduct.getProductType().setName("GenericFile");
        Reference ref = new Reference("file:///foo.txt", "file:///bar.txt", 100);
            Vector<Reference> references = new Vector<Reference>();
            references.add(ref);
            testProduct.setProductReferences(references);
        Metadata met = new Metadata();
        met.addMetadata("Filename", "tempProduct" + i);
View Full Code Here

TOP

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

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.