@VisibleForTesting static Product createProduct(URI path) { Product product = new Product(); product.setProductStructure(Product.STRUCTURE_FLAT); //TODO: only support flat prods for now Reference reference = new Reference(); reference.setDataStoreReference(path.toString()); product.setProductReferences(Lists.newArrayList(reference)); return product; } }
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; }
@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; }
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; }
@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; }
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; }
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; }
product.setProductStructure(productStructure); product.setProductType(pt);
product.setProductStructure(productStructure); product.setProductType(pt);
p.setProductStructure(Product.STRUCTURE_HIERARCHICAL); dirReference.setDataStoreReference(new File(new URI(productRepo)) .toURI().toURL().toExternalForm() .getProductReferences()); } else if (transferType.equals("files")) { p.setProductStructure("Flat"); p.getProductReferences().addAll(fileReferences); VersioningUtils.createBasicDataStoreRefsFlat(productName, productRepo,
p.setProductStructure(Product.STRUCTURE_HIERARCHICAL); dirReference.setDataStoreReference(new File(new URI(productRepo)) .toURI().toURL().toExternalForm() .getProductReferences()); } else if (transferType.equals("files")) { p.setProductStructure("Flat"); p.getProductReferences().addAll(fileReferences); VersioningUtils.createBasicDataStoreRefsFlat(productName, productRepo,
public static Product getDefaultFlatProduct(String name, String defaultProductTypeId) { Product defaultProduct = new Product(); defaultProduct.setProductName(name); defaultProduct.setProductReferences(new Vector<Reference>()); defaultProduct.setProductStructure(Product.STRUCTURE_FLAT); ProductType pType = new ProductType(); pType.setProductTypeId(defaultProductTypeId); defaultProduct.setProductType(pType); defaultProduct.setTransferStatus(Product.STATUS_TRANSFER); return defaultProduct; }
public static Product getDefaultFlatProduct(String name, String defaultProductTypeId) { Product defaultProduct = new Product(); defaultProduct.setProductName(name); defaultProduct.setProductReferences(new Vector<Reference>()); defaultProduct.setProductStructure(Product.STRUCTURE_FLAT); ProductType pType = new ProductType(); pType.setProductTypeId(defaultProductTypeId); defaultProduct.setProductType(pType); defaultProduct.setTransferStatus(Product.STATUS_TRANSFER); return defaultProduct; }
product.setProductStructure(productStructure); product.setProductType(getProductType(productType));
product.setProductStructure(productStructure); product.setProductType(getProductType(productType));
product.setProductStructure(doc.get("product_structure")); product.setTransferStatus(doc.get("product_transfer_status"));
product.setProductStructure(doc.get("product_structure")); product.setTransferStatus(doc.get("product_transfer_status"));
destProduct.setProductStructure(p.getProductStructure()); destProduct.setProductType((destClient != null) ? destClient .getProductTypeById(type.getProductTypeId()) : type);
destProduct.setProductStructure(p.getProductStructure()); destProduct.setProductType((destClient != null) ? destClient .getProductTypeById(type.getProductTypeId()) : type);
public static Product getProduct(AvroProduct avroPoduct){ Product product = new Product(); product.setProductName(avroPoduct.getProductName()); if (avroPoduct.getProductType() != null) product.setProductType(getProductType(avroPoduct.getProductType())); product.setProductStructure(avroPoduct.getProductStructure()); product.setTransferStatus(avroPoduct.getTransferStatus()); //references if (avroPoduct.getReferences() != null) product.setProductReferences(getReferences(avroPoduct.getReferences())); product.setProductId(avroPoduct.getProductId()); if (avroPoduct.getRootRef() != null) product.setRootRef(getReference(avroPoduct.getRootRef())); return product; }