Package com.opengamma.bbg.referencedata.impl

Examples of com.opengamma.bbg.referencedata.impl.BloombergReferenceDataProvider$BloombergReferenceDataProviderImpl


  private static final int NAME_FIELD = 0;
  private static final int BUID_FIELD = 8;
  private static BloombergReferenceDataProvider getBloombergSecurityFileLoader() {
    ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(CONTEXT_CONFIGURATION_PATH);
    context.start();
    BloombergReferenceDataProvider dataProvider = (BloombergReferenceDataProvider) context.getBean("refDataProvider");
    return dataProvider;
  }
View Full Code Here


    try {
      csvReader = new CSVReader(new BufferedReader(new FileReader(args[0])));
      csvWriter = new CSVWriter(new BufferedWriter(new FileWriter(args[1])));
      String[] line;
      Pattern pattern = Pattern.compile("^(\\w\\w\\w).*?(\\d+)(M|Y)(\\d+)(M|Y)\\s*?(PY|RC)\\s*?(.*)$");
      BloombergReferenceDataProvider rawBbgRefDataProvider = getBloombergSecurityFileLoader();
      MongoDBValueCachingReferenceDataProvider bbgRefDataProvider = MongoCachedReferenceData.makeMongoProvider(rawBbgRefDataProvider, BloombergSwaptionFileLoader.class);
      while ((line = csvReader.readNext()) != null) {
        String name = line[NAME_FIELD];
        Matcher matcher = pattern.matcher(name);
        if (matcher.matches()) {
View Full Code Here

   *
   * @param testClass  the test class, not null
   * @return the data provider, not null
   */
  public static ReferenceDataProvider getCachingReferenceDataProvider(Class<?> testClass) {
    BloombergReferenceDataProvider brdp = getUnderlyingProvider();
    return getCachingReferenceDataProvider(brdp, testClass);
  }
View Full Code Here

   *
   * @return the provider, not null
   */
  public static BloombergReferenceDataProvider getUnderlyingProvider() {
    BloombergConnector connector = BloombergTestUtils.getBloombergConnector();
    BloombergReferenceDataProvider brdp = new BloombergReferenceDataProvider(connector);
    brdp.start();
    return brdp;
  }
View Full Code Here

   * @param refDataProvider  the provider to stop, null ignored
   */
  public static void stopCachingReferenceDataProvider(ReferenceDataProvider refDataProvider) {
    if (refDataProvider != null) {
      if (refDataProvider instanceof BloombergReferenceDataProvider) {
        BloombergReferenceDataProvider bbgProvider = (BloombergReferenceDataProvider) refDataProvider;
        bbgProvider.stop();
       
      } else if (refDataProvider instanceof AbstractValueCachingReferenceDataProvider) {
        stopCachingReferenceDataProvider(((AbstractValueCachingReferenceDataProvider) refDataProvider).getUnderlying());
       
      } else if (refDataProvider instanceof AbstractInvalidFieldCachingReferenceDataProvider) {
View Full Code Here

   *
   * @return the provider, not null
   */
  public static BloombergReferenceDataProvider getBloombergReferenceDataProvider() {
    BloombergConnector bbgConnector = BloombergTestUtils.getBloombergConnector();
    return new BloombergReferenceDataProvider(bbgConnector);
  }
View Full Code Here

   * Gets an example equity option ticker directly from Bloomberg reference data.
   *
   * @return the ticker, not null
   */
  public static String getSampleEquityOptionTicker() {
    BloombergReferenceDataProvider rdp = new BloombergReferenceDataProvider(getBloombergConnector());
    rdp.start();
   
    Set<ExternalId> options = BloombergDataUtils.getOptionChain(rdp, "AAPL US Equity");
    assertEquals(false, options.isEmpty());
    ExternalId aaplOptionId = options.iterator().next();
   
    rdp.stop();
   
    return aaplOptionId.getValue();
  }
View Full Code Here

  private LiveDataEntitlementChecker _entitlementChecker;

  @BeforeClass(enabled = false)
  public void setUpClass() {
    BloombergConnector connector = BloombergTestUtils.getBloombergConnector();
    BloombergReferenceDataProvider rdp = new BloombergReferenceDataProvider(connector);
    rdp.start();
   
    Map<LiveDataSpecification, DistributionSpecification> fixes = new HashMap<LiveDataSpecification, DistributionSpecification>();
    fixes.put(DIST_SPEC.getFullyQualifiedLiveDataSpecification(), DIST_SPEC);   
    FixedDistributionSpecificationResolver resolver = new FixedDistributionSpecificationResolver(fixes);
   
View Full Code Here

   
    s_logger.info("loading ref data with host: {} port: {} fields: {} identifies: {} outputfile {}", new Object[]{host, port, dataFieldFile, identifiersFile, outputFile});
   
    BloombergConnectorFactoryBean factory = new BloombergConnectorFactoryBean("BloombergRefDataCollector", host, Integer.valueOf(port));
    BloombergConnector bloombergConnector = factory.getObjectCreating();
    BloombergReferenceDataProvider refDataProvider = new BloombergReferenceDataProvider(bloombergConnector);
    refDataProvider.start();
   
    BloombergRefDataCollector refDataCollector = new BloombergRefDataCollector(new File(identifiersFile), refDataProvider, new File(dataFieldFile), new File(outputFile));
    refDataCollector.start();
  }
View Full Code Here

   * @param repo  the repository, not null
   * @return the provider, not null
   */
  protected ReferenceDataProvider initReferenceDataProvider(ComponentRepository repo) {
    BloombergConnector bloombergConnector = getBloombergConnector();
    BloombergReferenceDataProvider underlying = new BloombergReferenceDataProvider(bloombergConnector);
    repo.registerLifecycle(underlying);
   
    MongoConnector mongoConnector = getMongoConnector();
    CacheManager cacheManager = getCacheManager();
    if (mongoConnector != null) {
View Full Code Here

TOP

Related Classes of com.opengamma.bbg.referencedata.impl.BloombergReferenceDataProvider$BloombergReferenceDataProviderImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.