当前位置: 首页>>代码示例>>Java>>正文


Java Product.setProductName方法代码示例

本文整理汇总了Java中org.apache.oodt.cas.filemgr.structs.Product.setProductName方法的典型用法代码示例。如果您正苦于以下问题:Java Product.setProductName方法的具体用法?Java Product.setProductName怎么用?Java Product.setProductName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.oodt.cas.filemgr.structs.Product的用法示例。


在下文中一共展示了Product.setProductName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProductFromXmlRpc

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static Product getProductFromXmlRpc(Map<?, ?> productHash) {
  Product product = new Product();
  product.setProductId((String) productHash.get("id"));
  product.setProductName((String) productHash.get("name"));
  if (productHash.get("type") != null) {
    product.setProductType(getProductTypeFromXmlRpc(
        (Map<String, Object>) productHash.get("type")));
  }
  product.setProductStructure((String) productHash.get("structure"));
  product.setTransferStatus((String) productHash.get("transferStatus"));
  if (productHash.get("references") != null) {
    product.setProductReferences(getReferencesFromXmlRpc(
        (Vector<Map<String, Object>>) productHash
            .get("references")));
  }
  if (productHash.get("rootReference") != null) {
    product.setRootRef(getReferenceFromXmlRpc(
        (Map<String, Object>) productHash.get("rootReference")));
  }
  return product;
}
 
开发者ID:apache,项目名称:oodt,代码行数:23,代码来源:XmlRpcStructFactory.java

示例2: getProduct

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
public static Product getProduct(ResultSet rs, boolean getType, boolean productIdString)
        throws SQLException {
    Product product = new Product();
    if (productIdString) {
    	product.setProductId(rs.getString("product_id"));
    } else {
    	product.setProductId(String.valueOf(rs.getInt("product_id")));
    }
    product.setProductName(rs.getString("product_name"));
    product.setProductStructure(rs.getString("product_structure"));
    product.setTransferStatus(rs.getString("product_transfer_status"));
    if (getType) {
        product.setProductType(getProductType(rs));
    } else {
        // still grab the ID
        ProductType type = new ProductType();
        type.setProductTypeId(rs.getString("product_type_id"));
        product.setProductType(type);
    }

    return product;
}
 
开发者ID:apache,项目名称:oodt,代码行数:23,代码来源:DbStructFactory.java

示例3: getClient

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@Override
public FileManagerClient getClient() throws MalformedURLException,
      ConnectionException {
   return new DummyFileManagerClient(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);
      }
   };
}
 
开发者ID:apache,项目名称:oodt,代码行数:18,代码来源:TestGetCurrentTransfersCliAction.java

示例4: getProductByName

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@Override
public Product getProductByName(String productName) {
   lastMethodCallDetails = new MethodCallDetails("getProductByName",
         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);
   return p;
}
 
开发者ID:apache,项目名称:oodt,代码行数:17,代码来源:MockXmlRpcFileManagerClient.java

示例5: getClient

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
public FileManagerClient getClient() throws MalformedURLException,
      ConnectionException {
   return new DummyFileManagerClient(new URL("http://localhost:9000"),
         false) {
      public Product getProductByName(String name) {
         Product p = new Product();
         p.setProductId(PRODUCT_ID);
         p.setProductName(name);
         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;
      }
   };
}
 
开发者ID:apache,项目名称:oodt,代码行数:22,代码来源:TestGetProductByNameCliAction.java

示例6: getClient

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
public FileManagerClient getClient() throws MalformedURLException,
      ConnectionException {
   return new DummyFileManagerClient(new URL("http://localhost:9000"),
         false) {
      public Product getProductById(String productId) {
         Product p = new Product();
         p.setProductId(productId);
         p.setProductName(PRODUCT_NAME);
         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;
      }
   };
}
 
开发者ID:apache,项目名称:oodt,代码行数:22,代码来源:TestGetProductByIdCliAction.java

示例7: getClient

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@Override
public FileManagerClient getClient() throws MalformedURLException,
      ConnectionException {
   return new DummyFileManagerClient(new URL("http://localhost:9000"),
         false) {
      @Override
      public Product getProductById(String productId) {
         Product p = new Product();
         p.setProductId(productId);
         p.setProductName(PRODUCT_NAME);
         return p;
      }
      @Override
      public List<Reference> getProductReferences(Product product) {
         return null;
      }
   };
}
 
开发者ID:apache,项目名称:oodt,代码行数:19,代码来源:TestDeleteProductByIdCliAction.java

示例8: getProductById

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@Override
public Product getProductById(String productId) {
   lastMethodCallDetails = new MethodCallDetails("getProductById",
         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);
   return p;
}
 
开发者ID:apache,项目名称:oodt,代码行数:17,代码来源:MockFileManagerClient.java

示例9: testCreateProductZipFileFromHierarchicalProduct

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
public void testCreateProductZipFileFromHierarchicalProduct(){
	//Data store reference needs absolute path to test data
	String cwd=System.getProperty("user.dir");

	Product product = new Product();
	product.setProductId("TestProductId");
	product.setProductName("TestProductName");
	product.setProductReferences(Lists.newArrayList(
		new Reference("file:///orig/data/", "file://" + cwd + "/src/test/resources/", 4096),
		new Reference("file:///orig/data/test-file-1.txt", "file://" + cwd + "/src/test/resources/test-file-1.txt", 20),
		new Reference("file:///orig/data/test-file-2.txt", "file://" + cwd + "/src/test/resources/test-file-2.txt", 20),
		new Reference("file:///orig/data/test-file-3.txt", "file://" + cwd + "/src/test/resources/test-file-3.txt", 20)));
	product.setProductStructure(Product.STRUCTURE_HIERARCHICAL);
	product.setTransferStatus(Product.STATUS_RECEIVED);
	ProductType pt = new ProductType();
	pt.setName("TestProductType");

	Metadata metadata = new Metadata();

	String workingDirPath;
	workingDir = Files.createTempDir();
	workingDirPath = workingDir.getAbsolutePath();
	workingDir.deleteOnExit();

	String productZipFilePath = null;
	try {
		productZipFilePath = DataUtils.createProductZipFile(product, metadata, workingDirPath);
	} catch (Exception e) {
		fail(e.getMessage());
	}
	String zipFileName = product.getProductName() + ".zip";
	assertEquals(productZipFilePath, workingDirPath + "/" + zipFileName);
}
 
开发者ID:apache,项目名称:oodt,代码行数:34,代码来源:TestDataUtils.java

示例10: toScienceDataProduct

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
public static Product toScienceDataProduct(ResultSet rs) throws SQLException {
  Product product = new Product();
  product.setProductId(rs.getString("granule_id"));
  product.setProductName(rs.getString("filename"));
  product.setProductStructure(Product.STRUCTURE_FLAT);
  product.setTransferStatus(Product.STATUS_RECEIVED);
  ProductType type = new ProductType();
  type.setProductTypeId(rs.getString("dataset_id"));
  product.setProductType(type);
  return product;
}
 
开发者ID:apache,项目名称:oodt,代码行数:12,代码来源:DbStructFactory.java

示例11: getFirstPage

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@Override
public ProductPage getFirstPage(ProductType pt) {
   ProductPage pp = new ProductPage();
   pp.setPageNum(PAGE_NUM);
   pp.setTotalPages(TOTAL_PAGES);
   pp.setPageSize(PAGE_SIZE);
   Product p1 = new Product();
   p1.setProductId(PRODUCT_ID_1);
   p1.setProductName(PRODUCT_NAME_1);
   p1.setProductType(pt);
   p1.setProductStructure(PRODUCT_STRUCTURE);
   p1.setTransferStatus(PRODUCT_STATUS);
   Product p2 = new Product();
   p2.setProductId(PRODUCT_ID_2);
   p2.setProductName(PRODUCT_NAME_2);
   p2.setProductType(pt);
   p2.setProductStructure(PRODUCT_STRUCTURE);
   p2.setTransferStatus(PRODUCT_STATUS);
   Product p3 = new Product();
   p3.setProductId(PRODUCT_ID_3);
   p3.setProductName(PRODUCT_NAME_3);
   p3.setProductType(pt);
   p3.setProductStructure(PRODUCT_STRUCTURE);
   p3.setTransferStatus(PRODUCT_STATUS);
   pp.setPageProducts(Lists.newArrayList(p1, p2, p3));
   return pp;
}
 
开发者ID:apache,项目名称:oodt,代码行数:28,代码来源:TestGetNextPageCliAction.java

示例12: getNextPage

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@Override
public ProductPage getNextPage(ProductType pt, ProductPage currentPage) {
   ProductPage pp = new ProductPage();
   pp.setPageNum(currentPage.getPageNum() + 1);
   pp.setTotalPages(currentPage.getTotalPages());
   pp.setPageSize(currentPage.getPageSize());
   Product p4 = new Product();
   p4.setProductId(PRODUCT_ID_4);
   p4.setProductName(PRODUCT_NAME_4);
   p4.setProductType(pt);
   p4.setProductStructure(PRODUCT_STRUCTURE);
   p4.setTransferStatus(PRODUCT_STATUS);
   pp.setPageProducts(Lists.newArrayList(p4));
   return pp;
}
 
开发者ID:apache,项目名称:oodt,代码行数:16,代码来源:TestGetNextPageCliAction.java

示例13: getClient

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
public FileManagerClient getClient() throws MalformedURLException,
      ConnectionException {
   return new DummyFileManagerClient(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;
      }
   };
}
 
开发者ID:apache,项目名称:oodt,代码行数:16,代码来源:TestGetCurrentTransferCliAction.java

示例14: getPrevPage

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
@Override
public ProductPage getPrevPage(ProductType pt, ProductPage currentPage) {
   ProductPage pp = new ProductPage();
   pp.setPageNum(currentPage.getPageNum() - 1);
   pp.setTotalPages(currentPage.getTotalPages());
   pp.setPageSize(currentPage.getPageSize());
   Product p4 = new Product();
   p4.setProductId(PRODUCT_ID_4);
   p4.setProductName(PRODUCT_NAME_4);
   p4.setProductType(pt);
   p4.setProductStructure(PRODUCT_STRUCTURE);
   p4.setTransferStatus(PRODUCT_STATUS);
   pp.setPageProducts(Lists.newArrayList(p4));
   return pp;
}
 
开发者ID:apache,项目名称:oodt,代码行数:16,代码来源:TestGetPrevPageCliAction.java

示例15: testXmlMarshalling

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
/**
 * Tests that {@link TransferResource transfer resources} are marshalled to
 * the expected XML format.
 * @throws IOException if the {@link Diff} constructor fails
 * @throws JAXBException if the {@link JAXBContext} or {@link Marshaller} fail
 * @throws MimeTypeException if {@link MimeTypes#forName(String)} fails
 * @throws SAXException if the {@link Diff} constructor fails
 */
@Test
public void testXmlMarshalling() throws IOException, JAXBException,
  MimeTypeException, SAXException
{
  // Create a TransferResource using ProductType, Product, Metadata, Reference
  // and FileTransferStatus instances.
  Hashtable metadataEntries = new Hashtable<String, Object>();
  metadataEntries.put("CAS.ProductReceivedTime", "2013-09-12T16:25:50.662Z");
  Metadata metadata = new Metadata();
  metadata.addMetadata(metadataEntries);

  Reference reference = new Reference("original", "dataStore", 1000,
    new MimeTypes().forName("text/plain"));

  ProductType productType = new ProductType("1", "GenericFile", "test type",
    "repository", "versioner");

  Product product = new Product();
  product.setProductId("123");
  product.setProductName("test product");
  product.setProductStructure(Product.STRUCTURE_FLAT);
  product.setProductType(productType);

  FileTransferStatus status = new FileTransferStatus(reference, 1000, 100,
    product);

  TransferResource resource = new TransferResource(product, metadata, status);


  // Generate the expected output.
  String expectedXml =
    "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
    + "<transfer>"
    + "<productName>" + product.getProductName() + "</productName>"
    + "<productId>" + product.getProductId() + "</productId>"
    + "<productTypeName>" + productType.getName() + "</productTypeName>"
    + "<dataStoreReference>"
    +   reference.getDataStoreReference()
    + "</dataStoreReference>"
    + "<origReference>"
    +   reference.getOrigReference()
    + "</origReference>"
    + "<mimeType>" + reference.getMimeType().getName() + "</mimeType>"
    + "<fileSize>" + reference.getFileSize() + "</fileSize>"
    + "<totalBytes>" + reference.getFileSize() + "</totalBytes>"
    + "<bytesTransferred>"
    +    status.getBytesTransferred()
    + "</bytesTransferred>"
    + "<percentComplete>"
    +    status.computePctTransferred() * 100
    + "</percentComplete>"
    + "<productReceivedTime>"
    +    metadata.getAllValues().get(0)
    + "</productReceivedTime>"
    + "</transfer>";

  // Set up a JAXB context and marshall the DatasetResource to XML.
  JAXBContext context = JAXBContext.newInstance(resource.getClass());
  Marshaller marshaller = context.createMarshaller();
  StringWriter writer = new StringWriter();
  marshaller.marshal(resource, writer);

  // Compare the expected and actual outputs.
  XMLUnit.setIgnoreWhitespace(true);
  XMLUnit.setIgnoreComments(true);
  XMLUnit.setIgnoreAttributeOrder(true);
  Diff diff = new Diff(expectedXml, writer.toString());
  assertTrue("The output XML was different to the expected XML: "
    + diff.toString(), diff.identical());
}
 
开发者ID:apache,项目名称:oodt,代码行数:79,代码来源:TransferResourceTest.java


注:本文中的org.apache.oodt.cas.filemgr.structs.Product.setProductName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。