Examples of LiveMarketDataSpecification


Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

  }

  private NamedMarketDataSpecificationRepository initNamedMarketDataSpecificationRepository(final ComponentRepository repo) {
    final InMemoryNamedMarketDataSpecificationRepository specRepository = new InMemoryNamedMarketDataSpecificationRepository();

    specRepository.addSpecification(BLOOMBERG_LIVE_SOURCE_NAME, new LiveMarketDataSpecification(BLOOMBERG_LIVE_SOURCE_NAME));
    final ComponentInfo info = new ComponentInfo(NamedMarketDataSpecificationRepository.class, getClassifier());
    repo.registerComponent(info, specRepository);
    return specRepository;
  }
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

    }
    String sourceName = specStr.substring(1).trim();
    if (sourceName.isEmpty()) {
      throw new IllegalArgumentException(specStr + " doesn't match 'live:source name'");
    }
    return new LiveMarketDataSpecification(sourceName);
  }
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

    assertTrue(permissions instanceof PermissiveMarketDataPermissionProvider);
  }

  public void testCompatible() {
    final InMemoryLKVMarketDataProvider provider = new InMemoryLKVMarketDataProvider();
    assertTrue(provider.isCompatible(new LiveMarketDataSpecification()));
  }
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

  }

  private static MarketDataSpecification getMarketDataSpecification(final CommandLine commandLine, final ToolContext toolContext) {
    String marketDataOption = trimToNull(commandLine.getOptionValue(LIVE_MARKET_DATA_OPT));
    if (marketDataOption != null) {
      return new LiveMarketDataSpecification(marketDataOption);
    }
    String snapshotOption = trimToNull(commandLine.getOptionValue(USER_MARKET_DATA_OPT));
    if (snapshotOption != null) {
      MarketDataSnapshotMaster snapshotMaster = toolContext.getMarketDataSnapshotMaster();
      if (snapshotMaster == null) {
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

  }

  private NamedMarketDataSpecificationRepository initNamedMarketDataSpecificationRepository(final ComponentRepository repo) {
    final InMemoryNamedMarketDataSpecificationRepository specRepository = new InMemoryNamedMarketDataSpecificationRepository();

    specRepository.addSpecification(SIMULATED_LIVE_SOURCE_NAME, new LiveMarketDataSpecification(SIMULATED_LIVE_SOURCE_NAME));
    final ComponentInfo info = new ComponentInfo(NamedMarketDataSpecificationRepository.class, getClassifier());
    repo.registerComponent(info, specRepository);
    return specRepository;
  }
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

  /** Builds intances of {@link LiveMarketDataSpecification}. */
  private static class LiveSpecificationBuilder implements SpecificationBuilder {

    @Override
    public MarketDataSpecification build(JSONObject json) throws JSONException {
      return new LiveMarketDataSpecification(json.getString(MarketDataSpecificationJsonReader.SOURCE));
    }
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

      return requestedMarketDataSpecs;
    }
    List<MarketDataSpecification> specs = Lists.newArrayListWithCapacity(requestedMarketDataSpecs.size());
    for (MarketDataSpecification spec : requestedMarketDataSpecs) {
      if (spec instanceof LiveMarketDataSpecification) {
        LiveMarketDataSpecification liveSpec = (LiveMarketDataSpecification) spec;
        MarketDataSpecification oldSpec = _marketDataSpecRepo.getSpecification(liveSpec.getDataSource());
        if (oldSpec == null) {
          throw new IllegalArgumentException("No live data source found called " + liveSpec.getDataSource());
        }
        specs.add(oldSpec);
      } else {
        specs.add(spec);
      }
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

    LiveDataAvailabilityNotificationListener availabilityNotificationListener =
        new LiveDataAvailabilityNotificationListener(getJmsMarketDataAvailabilityTopic(), factoryList, getJmsConnector());
    repo.registerLifecycle(availabilityNotificationListener);

    final InMemoryNamedMarketDataSpecificationRepository specRepository = new InMemoryNamedMarketDataSpecificationRepository();
    specRepository.addSpecification(description, new LiveMarketDataSpecification(description));

    final ComponentInfo specRepositoryInfo = new ComponentInfo(NamedMarketDataSpecificationRepository.class, getClassifier());
    repo.registerComponent(specRepositoryInfo, specRepository);
  }
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

      ViewProcessor viewProcessor = server.getViewProcessor();
      ConfigSource configSource = server.getConfigSource();
      String viewDefinitionName = "AUD Swaps (3m / 6m basis) (1)";
      UniqueId viewDefId = SimulationUtils.latestViewDefinitionId(viewDefinitionName, configSource);
      List<MarketDataSpecification> marketDataSpecs =
          ImmutableList.<MarketDataSpecification>of(new LiveMarketDataSpecification("Simulated live market data"));

      // define the simulation -----------------------------------------------------------------------------------------

      Simulation simulation = new Simulation("Example simulation");
      for (Double scalingFactor : SCALING_FACTORS) {
View Full Code Here

Examples of com.opengamma.engine.marketdata.spec.LiveMarketDataSpecification

  @Override
  public MarketDataProvider create(UserPrincipal user, MarketDataSpecification marketDataSpec) {
    ArgumentChecker.notNull(user, "user");
    ArgumentChecker.notNull(marketDataSpec, "marketDataSpec");
    LiveMarketDataSpecification liveSpec = (LiveMarketDataSpecification) marketDataSpec;
    if (liveSpec.getDataSource() == null) {
      return _defaultFactory.create(user);
    }
    LiveDataFactory liveDataFactory = _namedFactories.get(liveSpec.getDataSource());
    if (liveDataFactory == null) {
      throw new IllegalArgumentException("No provider could be created for data source '" + liveSpec.getDataSource() + "'");
    }
    return liveDataFactory.create(user);
  }
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.