Package com.opengamma.engine.marketdata.spec

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


    }
  }

  private static MarketDataSpecification createLatestHistoricalSpec(String specStr) {
    if (specStr.isEmpty()) {
      return new LatestHistoricalMarketDataSpecification();
    }
    if (!specStr.startsWith(":")) {
      throw new IllegalArgumentException(specStr + " doesn't match 'latesthistorical[:time series rating]'");
    }
    String timeSeriesRating = specStr.substring(1).trim();
    if (timeSeriesRating.isEmpty()) {
      throw new IllegalArgumentException(specStr + " doesn't match 'latesthistorical[:time series rating]'");
    }
    return new LatestHistoricalMarketDataSpecification(timeSeriesRating);
  }
View Full Code Here


    } else {
      valuationInstant = Instant.now();
    }
    final boolean historicalInput = getCommandLine().hasOption(HISTORICAL_OPTION);

    final MarketDataSpecification marketDataSpecification = historicalInput ? new LatestHistoricalMarketDataSpecification() : MarketData.live();
    final ViewExecutionOptions viewExecutionOptions = ExecutionOptions.singleCycle(valuationInstant, marketDataSpecification, EnumSet.of(ViewExecutionFlags.AWAIT_MARKET_DATA));

    final List<RemoteViewProcessor> viewProcessors = getRemoteComponentFactory().getViewProcessors();
    if (viewProcessors.size() == 0) {
      s_logger.warn("No view processors found at {}", getRemoteComponentFactory().getBaseUri());
View Full Code Here

  /** Builds intances of {@link LatestHistoricalMarketDataSpecification}. */
  private static class LatestHistoricalSpecificationBuilder implements SpecificationBuilder {

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

  }

  @Test
  public void latestHistoricalValid() {
    MarketDataSpecification specNoRating = MarketDataSpecificationParser.parse("latesthistorical");
    assertEquals(new LatestHistoricalMarketDataSpecification(), specNoRating);
    MarketDataSpecification specWithRating = MarketDataSpecificationParser.parse("latesthistorical:RATING_NAME");
    assertEquals(new LatestHistoricalMarketDataSpecification("RATING_NAME"), specWithRating);
  }
View Full Code Here

TOP

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

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.