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

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


        Product testProduct = Product.getDefaultFlatProduct("test",
                "urn:oodt:GenericFile");
        testProduct.getProductType().setName("GenericFile");

        // set references
        Reference ref = new Reference("file:///foo.txt", "file:///bar.txt", 100);
        Vector references = new Vector();
        references.add(ref);
        testProduct.setProductReferences(references);

        return testProduct;
View Full Code Here


            ConnectionException {
         return new XmlRpcFileManagerClient(new URL("http://localhost:9000"),
               false) {
            public FileTransferStatus getCurrentFileTransfer() {
               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 status;
View Full Code Here

  public void testVersioner() {
    DirectoryProductVersioner versioner = new DirectoryProductVersioner();
    Product p = Product.getDefaultFlatProduct("test", "urn:oodt:GenericFile");
    p.setProductStructure(Product.STRUCTURE_HIERARCHICAL);
    p.getProductType().setProductRepositoryPath("file:///home/files");
    Reference r = new Reference("file:///tmp/dir1", null, 4L);
    Reference r2 = new Reference("file:///tmp/dir1/file1.txt", null, 20L);
    p.getProductReferences().add(r);
    p.getProductReferences().add(r2);
    Metadata met = new Metadata();
    met.addMetadata(CoreMetKeys.FILENAME, "dir1");
    try {
View Full Code Here

    product.setProductType(type);
   
    Metadata metadata = new Metadata();
    metadata.addMetadata(SingleFileBasicVersioner.FILENAME_FIELD, "testfile.txt");
   
    Reference r = new Reference();
    r.setOrigReference(origFileRef);
   
    product.getProductReferences().add(r);
   
    SingleFileBasicVersioner versioner = new SingleFileBasicVersioner();
    try{
      versioner.createDataStoreReferences(product, metadata);
    }
    catch(VersioningException e){
      fail(e.getMessage());
    }
   
    assertEquals("The generated ref: ["+r.getDataStoreReference()+"] is not equal to the expected ref: ["+expectedDestFileRef+"]", expectedDestFileRef, r.getDataStoreReference());
   
   
  }
View Full Code Here

            Lists.newArrayList((Object) productId));
      Product p = new Product();
      p.setProductId(productId);
      p.setProductName("TestProductName");
      p.setProductReferences(Lists.newArrayList(
            new Reference("file:/orig/file", "file:/ds/file", 3)));
      p.setProductStructure(Product.STRUCTURE_FLAT);
      p.setTransferStatus(Product.STATUS_RECEIVED);
      ProductType pt = new ProductType();
      pt.setName("TestProductType");
      p.setProductType(pt);
View Full Code Here

            Lists.newArrayList((Object) productName));
      Product p = new Product();
      p.setProductId("TestProductId");
      p.setProductName(productName);
      p.setProductReferences(Lists.newArrayList(
            new Reference("file:/orig/file", "file:/ds/file", 3)));
      p.setProductStructure(Product.STRUCTURE_FLAT);
      p.setTransferStatus(Product.STATUS_RECEIVED);
      ProductType pt = new ProductType();
      pt.setName("TestProductType");
      p.setProductType(pt);
View Full Code Here

   public FileTransferStatus getCurrentFileTransfer() {
      lastMethodCallDetails = new MethodCallDetails("getCurrentFileTransfer",
            Lists.newArrayList());
      FileTransferStatus status = new FileTransferStatus();
      status.setBytesTransferred(10);
      status.setFileRef(new Reference("file:/orig/file", "file:/ds/file", 4));
      Product p = new Product();
      p.setProductId("TestProductId");
      status.setParentProduct(p);
      return status;
   }
View Full Code Here

   public List<FileTransferStatus> getCurrentFileTransfers() {
      lastMethodCallDetails = new MethodCallDetails("getCurrentFileTransfers",
            Lists.newArrayList());
      FileTransferStatus status = new FileTransferStatus();
      status.setBytesTransferred(10);
      status.setFileRef(new Reference("file:/orig/file", "file:/ds/file", 4));
      Product p = new Product();
      p.setProductId("TestProductId");
      status.setParentProduct(p);
      return Lists.newArrayList(status);
   }
View Full Code Here

    private Product getTestProduct() throws MalformedURLException {
        Product testProduct = Product.getDefaultFlatProduct("test",
                "urn:oodt:GenericFile");
        List<Reference> refs = new LinkedList<Reference>();
        URL refUrl = this.getClass().getResource("/ingest/test.txt");
        Reference ref = new Reference();
        ref.setOrigReference(new File(refUrl.getFile()).toURL().toExternalForm());
        ref.setFileSize(123);
        refs.add(ref);
        testProduct.setProductReferences(refs);
        return testProduct;
    }
View Full Code Here

    Product prod = Product.getDefaultFlatProduct("foo", "urn:sometype:foo");
    prod.getProductType().setProductRepositoryPath("file:///data/archive");
    prod.getProductType().getTypeMetadata()
        .addMetadata("filePathSpec", "/[AcquisitionDate]/[Filename]");
    prod.getProductReferences().add(
        new Reference("file:///data/staging/somefile.txt", null, 4L));
    ProductTypeMetVersioner versioner = new ProductTypeMetVersioner();
    try {
      versioner.createDataStoreReferences(prod, met);
    } catch (Exception e) {
      fail(e.getMessage());
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.