/** Get All prices for given Vendor */ public List<TradeInstrumentPrice> getAllPricesByVendor(String vendorName) throws PriceDataCacheException { logger.info("PriceDataCacheServiceImpl : getAllPricesByVendor called for " + vendorName); Vendor vendor = priceDao.getVendor(vendorName); if (null == vendor) { logger.error("PriceDataCacheServiceImpl : No Vendor found with given name " + vendorName); throw new PriceDataCacheException("No Vendor found with given name " + vendorName); } return priceDao.getPricesForVendorAndInstrument(vendor, null); }
/** Get Price for Single Instrument for list of Vendors. */ public List<TradeInstrumentPrice> getPriceForSingleInstrument( String instrument, List<String> vendors) throws PriceDataCacheException { logger.info( "PriceDataCacheServiceImpl : getPriceForSingleInstrument invoked for " + instrument); List<TradeInstrumentPrice> instrumentPrices = new ArrayList<TradeInstrumentPrice>(); for (String vendorName : vendors) { Vendor vendor = priceDao.getVendor(vendorName); if (null == vendor) { logger.error("PriceDataCacheServiceImpl : No Vendor found with given name " + vendorName); throw new PriceDataCacheException("No Vendor found with given name " + vendorName); } instrumentPrices.addAll(priceDao.getPricesForVendorAndInstrument(vendor, instrument)); } return instrumentPrices; }