@Override public List<Listing> getAvailableAddOnListings(final String baseProductName, @Nullable final String priceListName) { final List<Listing> availAddons = new ArrayList<Listing>(); try { final Product product = findCurrentProduct(baseProductName); if (product != null) { for (final Product availAddon : product.getAvailable()) { for (final BillingPeriod billingPeriod : BillingPeriod.values()) { for (final PriceList priceList : getPriceLists().getAllPriceLists()) { if (priceListName == null || priceListName.equals(priceList.getName())) { final Collection<Plan> addonInList = priceList.findPlans(availAddon, billingPeriod); for (final Plan cur : addonInList) { availAddons.add(new DefaultListing(cur, priceList)); } } } } } } } catch (final CatalogApiException e) { // No such product - just return an empty list } return availAddons; }
@Override public List<Listing> getAvailableAddOnListings(final String baseProductName, @Nullable final String priceListName) { final List<Listing> availAddons = new ArrayList<Listing>(); try { final Product product = findCurrentProduct(baseProductName); if (product != null) { for (final Product availAddon : product.getAvailable()) { for (final BillingPeriod billingPeriod : BillingPeriod.values()) { for (final PriceList priceList : getPriceLists().getAllPriceLists()) { if (priceListName == null || priceListName.equals(priceList.getName())) { final Collection<Plan> addonInList = priceList.findPlans(availAddon, billingPeriod); for (final Plan cur : addonInList) { availAddons.add(new DefaultListing(cur, priceList)); } } } } } } } catch (final CatalogApiException e) { // No such product - just return an empty list } return availAddons; }