Package com.opengamma.engine.marketdata.spec

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


    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }

  @Path("marketDataSnapshot/{snapshotId}")
  public DependencyGraphTraceProviderResource setMarketDataSnapshot(@PathParam("snapshotId") final String snapshotId) {
    UserMarketDataSpecification marketData = MarketData.user(UniqueId.parse(snapshotId));
    DependencyGraphTraceBuilderProperties properties = _properties.addMarketData(marketData);
    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
View Full Code Here


  private static MarketDataSpecification createSnapshotSpec(String specStr) {
    if (!specStr.startsWith(":")) {
      throw new IllegalArgumentException(specStr + " doesn't match 'snapshot:snapshot ID'");
    }
    String id = specStr.substring(1).trim();
    return new UserMarketDataSpecification(UniqueId.parse(id));
  }
View Full Code Here

      request.setName(snapshotOption);
      MarketDataSnapshotSearchResult searchResult = snapshotMaster.search(request);
      if (searchResult.getDocuments().isEmpty()) {
        throw new OpenGammaRuntimeException("No matching snapshot for given name [" + marketDataOption + "]");
      }
      return new UserMarketDataSpecification(searchResult.getFirstDocument().getUniqueId());
    }
    String historicalOption = trimToNull(commandLine.getOptionValue(HISTORICAL_MARKET_DATA_OPT));
    if (historicalOption != null) {
      Matcher matcher = USER_OR_HISTORICAL_PATTERN.matcher(historicalOption);
      if (matcher.matches()) {
View Full Code Here

  /** Builds instances of {@link UserMarketDataSpecification}. */
  private static class SnapshotSpecificationBuilder implements SpecificationBuilder {

    @Override
    public MarketDataSpecification build(JSONObject json) throws JSONException {
      return new UserMarketDataSpecification(UniqueId.parse(json.getString(MarketDataSpecificationJsonReader.SNAPSHOT_ID)));
    }
View Full Code Here

  @Test
  public void getTraceMarketDataUser() {
    DependencyGraphTraceBuilderProperties properties = new DependencyGraphTraceBuilderProperties();

    String snapshotId = "Foo~1";
    UserMarketDataSpecification marketData = MarketData.user(UniqueId.parse(snapshotId));

    properties = properties.addMarketData(marketData);

    URI uri = _provider.buildUri(properties);
View Full Code Here

  }

  @Test
  public void addMarketData() {
    String snapshotId = "Foo~1";
    UserMarketDataSpecification marketData = MarketData.user(UniqueId.parse(snapshotId));

    final DependencyGraphTraceBuilderProperties builder1 = createBuilder();
    List<MarketDataSpecification> defaultMD = builder1.getMarketData();
    final DependencyGraphTraceBuilderProperties builder2 = builder1.addMarketData(marketData);
View Full Code Here

  @Override
  public boolean isCompatible(final MarketDataSpecification marketDataSpec) {
    if (!(marketDataSpec instanceof UserMarketDataSpecification)) {
      return false;
    }
    final UserMarketDataSpecification userMarketDataSpec = (UserMarketDataSpecification) marketDataSpec;
    return getSnapshotId().equals(userMarketDataSpec.getUserSnapshotId());
  }
View Full Code Here

    s_logger.error("Call to deprecated constructor (see PLAT-1459)");
  }

  @Override
  public MarketDataProvider create(final UserPrincipal marketDataUser, final MarketDataSpecification marketDataSpec) {
    final UserMarketDataSpecification userMarketDataSpec = (UserMarketDataSpecification) marketDataSpec;
    final UserMarketDataProvider marketDataProvider = new UserMarketDataProvider(getSnapshotSource(), userMarketDataSpec.getUserSnapshotId());
    return marketDataProvider;
  }
View Full Code Here

  }

  @Test
  public void snapshotValid() {
    MarketDataSpecification spec = MarketDataSpecificationParser.parse("snapshot:scheme~value~version");
    assertEquals(new UserMarketDataSpecification(UniqueId.of("scheme", "value", "version")), spec);
  }
View Full Code Here

    String[] args = {"-n", PORTFOLIO_NAME, "--snapshot", "snaphshotName"};
    ViewStatusOption statusOption = ViewStatusOption.getViewStatusReporterOption(s_parser.parse(s_options, args), s_toolContext);
    assertNotNull(statusOption);
   
    assertTrue(statusOption.getMarketDataSpecification() instanceof UserMarketDataSpecification);
    UserMarketDataSpecification marketDataSpecification = (UserMarketDataSpecification) statusOption.getMarketDataSpecification();
    assertEquals(s_mockUniqueId, marketDataSpecification.getUserSnapshotId());
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.marketdata.spec.UserMarketDataSpecification

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.