@Test public void testGetMonthlyStorageCostsForSpecificTier() throws Exception { Product product = s3PriceList.getMonthlyStorageCostForTier(AwsRegion.EU_WEST_1, StorageType.STANDARD, DataTier.NEXT_450TB); System.out.println(product.getDescription() + ": " + product.getPrice()); assert product.getPrice().getValue().compareTo(new BigDecimal("0.070")) == 0; }
public Product getMonthlyStorageCostForTier(AwsRegion region, StorageType storageType, DataTier dataTier) throws IOException{ List<Map<String, Object>> tiers = getTiers(region); if(dataTier != null){ for(Map<String, Object> tierElement : tiers){ String tierId = (String) tierElement.get("name"); if(tierId.equals(dataTier.getId())){ Price price = getStoragePrice(getSubList(tierElement, "storageTypes"), storageType); return new Product(dataTier.getName(), price); } } } return null; }
S3PriceList extends AbstractPriceList { public Product getMonthlyStorageCostForTier(AwsRegion region, StorageType storageType, DataTier dataTier) throws IOException{ List<Map<String, Object>> tiers = getTiers(region); if(dataTier != null){ for(Map<String, Object> tierElement : tiers){ String tierId = (String) tierElement.get("name"); if(tierId.equals(dataTier.getId())){ Price price = getStoragePrice(getSubList(tierElement, "storageTypes"), storageType); return new Product(dataTier.getName(), price); } } } return null; } }
S3PriceList extends AbstractPriceList { public Product getMonthlyStorageCostForTier(AwsRegion region, StorageType storageType, DataTier dataTier) throws IOException{ List<Map<String, Object>> tiers = getTiers(region); if(dataTier != null){ for(Map<String, Object> tierElement : tiers){ String tierId = (String) tierElement.get("name"); if(tierId.equals(dataTier.getId())){ Price price = getStoragePrice(getSubList(tierElement, "storageTypes"), storageType); return new Product(dataTier.getName(), price); } } } return null; }  }
S3PriceList extends AbstractPriceList { public Product getMonthlyStorageCostForTier(AwsRegion region, StorageType storageType, DataTier dataTier) throws IOException{ List<Map<String, Object>> tiers = getTiers(region); if(dataTier != null){ for(Map<String, Object> tierElement : tiers){ String tierId = (String) tierElement.get("name"); if(tierId.equals(dataTier.getId())){ Price price = getStoragePrice(getSubList(tierElement, "storageTypes"), storageType); return new Product(dataTier.getName(), price); } } } return null; }  List<Product> getMonthlyStorageCostForAllTiers(AwsRegion region, StorageType storageType); Product getMonthlyStorageCostForTier(AwsRegion region, StorageType storageType, DataTier dataTier); Product getRequestCostByType(AwsRegion region, RequestType requestType); }
S3PriceList extends AbstractPriceList { public Product getMonthlyStorageCostForTier(AwsRegion region, StorageType storageType, DataTier dataTier) throws IOException{ List<Map<String, Object>> tiers = getTiers(region); if(dataTier != null){ for(Map<String, Object> tierElement : tiers){ String tierId = (String) tierElement.get("name"); if(tierId.equals(dataTier.getId())){ Price price = getStoragePrice(getSubList(tierElement, "storageTypes"), storageType); return new Product(dataTier.getName(), price); } } } return null; }  List<Product> getMonthlyStorageCostForAllTiers(AwsRegion region, StorageType storageType); Product getMonthlyStorageCostForTier(AwsRegion region, StorageType storageType, DataTier dataTier); Product getRequestCostByType(AwsRegion region, RequestType requestType);  }