Examples of DbSecurityMaster


Examples of com.opengamma.masterdb.security.DbSecurityMaster

  }

  //-------------------------------------------------------------------------
  @Override
  public DbSecurityMaster createObject() {
    DbSecurityMaster master = new DbSecurityMaster(getDbConnector());
    if (getUniqueIdScheme() != null) {
      master.setUniqueIdScheme(getUniqueIdScheme());
    }
    if (getMaxRetries() != null) {
      master.setMaxRetries(getMaxRetries());
    }
    if (getJmsConnector() != null) {
      JmsChangeManager cm = new JmsChangeManager(getJmsConnector().ensureTopicName(getJmsChangeManagerTopic()));
      master.setChangeManager(cm);
      cm.start();
    }
    if (getCacheManager() != null) {
      master.setDetailProvider(new EHCachingSecurityMasterDetailProvider(new HibernateSecurityMasterDetailProvider(), getCacheManager()));
    }
    return master;
  }
View Full Code Here

Examples of com.opengamma.masterdb.security.DbSecurityMaster

    ConfigurableApplicationContext appcontext = getApplicationContext();
   
    ReferenceDataProvider bbgRefDataProvider = appcontext.getBean("sharedReferenceDataProvider", ReferenceDataProvider.class);
    String bloombergKey = BloombergDomainIdentifierResolver.toBloombergKey(underlyingId);
    SecurityProvider secProvider = appcontext.getBean("bloombergSecurityProvider", SecurityProvider.class);
    DbSecurityMaster secMaster = appcontext.getBean("dbSecurityMaster", DbSecurityMaster.class);
    DefaultSecurityLoader loader = new DefaultSecurityLoader(secMaster, secProvider);
   
    Set<ExternalId> optionChain = BloombergDataUtils.getOptionChain(bbgRefDataProvider, bloombergKey);
    if (optionChain != null && !optionChain.isEmpty()) {
      loader.loadSecurities(toBundles(optionChain));
View Full Code Here

Examples of com.opengamma.masterdb.security.DbSecurityMaster

  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> configuration) throws Exception {
    ComponentInfo info = new ComponentInfo(SecurityMaster.class, getClassifier());
   
    // create
    DbSecurityMaster master = new DbSecurityMaster(getDbConnector());
    master.registerMetrics(OpenGammaMetricRegistry.getSummaryInstance(), OpenGammaMetricRegistry.getDetailedInstance(), "DbSecurityMaster-" + getClassifier());
    if (getUniqueIdScheme() != null) {
      master.setUniqueIdScheme(getUniqueIdScheme());
    }
    if (getMaxRetries() != null) {
      master.setMaxRetries(getMaxRetries());
    }
    if (getJmsChangeManagerTopic() != null) {
      JmsChangeManager cm = new JmsChangeManager(getJmsConnector(), getJmsChangeManagerTopic());
      master.setChangeManager(cm);
      repo.registerLifecycle(cm);
      if (getJmsConnector().getClientBrokerUri() != null) {
        info.addAttribute(ComponentInfoAttributes.JMS_BROKER_URI, getJmsConnector().getClientBrokerUri().toString());
      }
      info.addAttribute(ComponentInfoAttributes.JMS_CHANGE_MANAGER_TOPIC, getJmsChangeManagerTopic());
    }
    if (getDetailProvider() != null) {
      SecurityMasterDetailProvider dp = getDetailProvider().newInstance();
      if (getCacheManager() != null) {
        master.setDetailProvider(new EHCachingSecurityMasterDetailProvider(dp, getCacheManager()));
      } else {
        master.setDetailProvider(dp);
      }
    }
    checkSchema(master.getSchemaVersion(), "sec");
   
    // register
    info.addAttribute(ComponentInfoAttributes.LEVEL, 1);
    info.addAttribute(ComponentInfoAttributes.REMOTE_CLIENT_JAVA, RemoteSecurityMaster.class);
    info.addAttribute(ComponentInfoAttributes.UNIQUE_ID_SCHEME, master.getUniqueIdScheme());
    repo.registerComponent(info, master);
   
    // publish
    if (isPublishRest()) {
      repo.getRestComponents().publish(info, new DataDbSecurityMasterResource(master));
View Full Code Here

Examples of com.opengamma.masterdb.security.DbSecurityMaster

    _bbgProvider = BloombergTestUtils.getBloombergReferenceDataProvider();
    _bbgProvider.start();
    ReferenceDataProvider cachingProvider = BloombergTestUtils.getMongoCachingReferenceDataProvider(_bbgProvider);
    ExchangeDataProvider exchangeProvider = DefaultExchangeDataProvider.getInstance();
    BloombergSecurityProvider secProvider = new BloombergSecurityProvider(cachingProvider, exchangeProvider );
    _securityMaster = new DbSecurityMaster(getDbConnector());
    _securityMaster.setDetailProvider(new HibernateSecurityMasterDetailProvider());
    _securityLoader = new DefaultSecurityLoader(_securityMaster, secProvider);
  }
View Full Code Here

Examples of com.opengamma.masterdb.security.DbSecurityMaster

    _tempFile = File.createTempFile("portfolio-", ".csv");
    s_logger.info("Created temp file: " + _tempFile.getAbsolutePath());

    _portfolioMaster = new DbPortfolioMaster(getDbConnector());
    _positionMaster = new DbPositionMaster(getDbConnector());
    _securityMaster = new DbSecurityMaster(getDbConnector());

    _toolContext = new ToolContext();
    _toolContext.setPortfolioMaster(_portfolioMaster);
    _toolContext.setPositionMaster(_positionMaster);
    _toolContext.setSecurityMaster(_securityMaster);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.