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


Java Product.getProductType方法代码示例

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


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

示例1: validateProduct

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
protected void validateProduct(Product product, Metadata met)
        throws MetExtractionException {
    if (product.getProductType() == null || ((product
                                                  .getProductType().getName() == null || (product
                                                                                              .getProductType()
                                                                                              .getName()
                                                                                              .equals(""))))) {
        throw new MetExtractionException("Product Type undefined");
    }

    if (product.getProductReferences() == null || (product
                                                       .getProductReferences().size() == 0)) {
        throw new MetExtractionException("Product references undefined");
    }


}
 
开发者ID:apache,项目名称:oodt,代码行数:18,代码来源:AbstractFilemgrMetExtractor.java

示例2: serialize

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<String> serialize(Product product, boolean create) {

	Map<String, List<String>> fields = new ConcurrentHashMap<String, List<String>>();
	List<String> docs = new ArrayList<String>();

	// add core product attributes to map
	this.addKeyValueToMap(fields, Parameters.PRODUCT_ID, product.getProductId());
	this.addKeyValueToMap(fields, Parameters.PRODUCT_NAME, product.getProductName());
	this.addKeyValueToMap(fields, Parameters.PRODUCT_STRUCTURE, product.getProductStructure());
	this.addKeyValueToMap(fields, Parameters.PRODUCT_TRANSFER_STATUS, product.getTransferStatus());
	ProductType productType = product.getProductType();
	if (productType!=null) {
		this.addKeyValueToMap(fields, Parameters.PRODUCT_TYPE_NAME, productType.getName());
		this.addKeyValueToMap(fields, Parameters.PRODUCT_TYPE_ID, productType.getProductTypeId());
	}
	if (create) {
		// only insert date/time when product is first created
		Date productDateTime = new Date(); // current datetime
		this.addKeyValueToMap(fields, Parameters.PRODUCT_RECEIVED_TIME, Parameters.SOLR_DATE_TIME_FORMATTER.format(productDateTime));
	}

	// create new product: use Solr id == CAS id
	if (create) {
		docs.add( this.generateInsertDocuments(product.getProductId(), fields) );

		// update existing product
	} else {
		docs.addAll( this.generateUpdateDocuments(product.getProductId(), fields, true) ); // replace=true

	}

	return docs;

}
 
开发者ID:apache,项目名称:oodt,代码行数:39,代码来源:DefaultProductSerializer.java

示例3: getXmlRpcProduct

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
public static Map<String, Object> getXmlRpcProduct(Product product) {
  Map<String, Object> productHash = new Hashtable<String, Object>();
  if (product.getProductId() != null) {
    productHash.put("id", product.getProductId());
  }
  if (product.getProductName() != null) {
    productHash.put("name", product.getProductName());
  }
  if (product.getProductType() != null) {
    productHash.put("type", getXmlRpcProductType(product.getProductType()));
  }
  if (product.getProductStructure() != null) {
    productHash.put("structure", product.getProductStructure());
  }
  if (product.getTransferStatus() != null) {
    productHash.put("transferStatus", product.getTransferStatus());
  }
  if (product.getProductReferences() != null) {
    productHash.put("references", getXmlRpcReferences(product
        .getProductReferences()));
  }
  if (product.getRootRef() != null) {
    productHash.put("rootReference", getXmlRpcReference(product
        .getRootRef()));
  }
  return productHash;
}
 
开发者ID:apache,项目名称:oodt,代码行数:28,代码来源:XmlRpcStructFactory.java

示例4: assertEquals

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
private void assertEquals(Product product1, Product product2) {
   if (product1 == null) {
      assertNull(product2);
      return;
   }
   assertEquals(product1.getProductId(), product2.getProductId());       
   assertEquals(product1.getProductName(), product2.getProductName());
   assertEquals(product1.getProductStructure(), product2.getProductStructure());
   assertEquals(product1.getTransferStatus(), product2.getTransferStatus());
   if (product1.getProductReferences() == null) {
      assertEquals(product1.getProductReferences(), product2.getProductReferences());
   } else {
      for (int i = 0; i < product1.getProductReferences().size(); i++) {
         assertEquals(product1.getProductReferences().get(i),
               product2.getProductReferences().get(i));
      }
   }
   if (product1.getProductType() == null) {
      assertEquals(product1.getProductType(), product2.getProductType());
   } else {
      assertEquals(product1.getProductType().getDescription(), product2.getProductType().getDescription());          
      assertEquals(product1.getProductType().getName(), product2.getProductType().getName());          
      assertEquals(product1.getProductType().getProductRepositoryPath(), product2.getProductType().getProductRepositoryPath());          
      assertEquals(product1.getProductType().getProductTypeId(), product2.getProductType().getProductTypeId());          
      assertEquals(product1.getProductType().getVersioner(), product2.getProductType().getVersioner());          
   }
   assertEquals(product1.getRootRef(), product2.getRootRef());
}
 
开发者ID:apache,项目名称:oodt,代码行数:29,代码来源:TestXmlRpcStructFactory.java

示例5: updateCatalogMetadata

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
/**
 * Updates the cataloged {@link Metadata} for a {@link Product} in the CAS
 * File Manager.
 * 
 * @param product
 *          The {@link Product} to update {@link Metadata} for.
 * @throws CatalogException
 *           If any error occurs during the update.
 * @throws IOException
 * @throws FileNotFoundException
 */
public void updateCatalogMetadata(Product product, Metadata newMetadata)
    throws CatalogException, IOException {
  InputStream is = new FileInputStream(CurationService.config.getFileMgrProps());
  try {
    System.getProperties().load(is);
  }
  finally{
    is.close();
  }
  Catalog catalog = this.getCatalog();
  
  Metadata oldMetadata = catalog.getMetadata(product);
  List<Reference> references = catalog.getProductReferences(product);
  Product newProduct = new Product(product.getProductName(), product
      .getProductType(), product.getProductStructure(), product
      .getTransferStatus(), product.getProductReferences());
  // Constructor is bugged and doesn't set transfer status
  newProduct.setTransferStatus(product.getTransferStatus());
  catalog.removeMetadata(oldMetadata, product);
  catalog.removeProduct(product);
  newProduct.setProductId(product.getProductId());
  catalog.addProduct(newProduct);
  newProduct.setProductReferences(references);
  catalog.addProductReferences(newProduct);
  catalog.addMetadata(newMetadata, newProduct);
}
 
开发者ID:apache,项目名称:oodt,代码行数:38,代码来源:MetadataResource.java

示例6: getUpstreamPedigreedProducts

import org.apache.oodt.cas.filemgr.structs.Product; //导入方法依赖的package包/类
/**
 * Returns the most direct ancestors (a {@link List} of {@link Product}s)
 * upstream from the given {@link Product} named <code>orig</code>.
 * 
 * @param orig
 *          The {@link Product} to get direct upstream relatives of.
 * @return A {@link List} of {@link Product}s directly upstream from the given
 *         {@link Product}.
 */
public List getUpstreamPedigreedProducts(Product orig) {
  if (orig == null || (orig.getProductType() == null) ||
      (orig.getProductType().getName() == null) || (orig.getProductType().getName().equals(UNKNOWN))) {
    return new Vector();
  }
  Metadata pMet = fm.safeGetMetadata(orig);
  return getProducts(pMet.getAllMetadata(INPUT_FILES));

}
 
开发者ID:apache,项目名称:oodt,代码行数:19,代码来源:Pedigree.java


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