Package com.opengamma.engine.value

Examples of com.opengamma.engine.value.ValueProperties


  private ValueSpecification buildValueSpecificationWithCurrency(String valueName) {

    UniqueId uid = UniqueId.of("scheme", "value");
    ComputationTargetSpecification cts = new ComputationTargetSpecification(ComputationTargetType.POSITION, uid);

    ValueProperties props = ValueProperties.builder()
        .with(ValuePropertyNames.FUNCTION, "fn")
        .with(ValuePropertyNames.CURRENCY, "USD")
        .get();

    return new ValueSpecification(valueName, cts, props);
View Full Code Here


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

  @Path("defaultProperties/{defaultProperties}")
  public DependencyGraphTraceProviderResource setDefaultProperties(@PathParam("defaultProperties") final String defaultProperties) {
    ValueProperties valueProperties = ValueProperties.parse(defaultProperties);
    DependencyGraphTraceBuilderProperties properties = _properties.defaultProperties(valueProperties);
    return new DependencyGraphTraceProviderResource(_provider, _fudgeContext, properties);
  }
View Full Code Here

    return new FudgeMsgEnvelope(fudgeMsg);
  }

  private ValueRequirement toValueRequirement(final String valueName, final ComputationTargetReference target) {
    final String name;
    final ValueProperties constraints;
    final int i = valueName.indexOf('{');
    if ((i > 0) && (valueName.charAt(valueName.length() - 1) == '}')) {
      name = valueName.substring(0, i);
      constraints = ValueProperties.parse(valueName.substring(i));
    } else {
View Full Code Here

      return false;
    }
  }

  protected ValueProperties getRequirementConstraints(final ValueRequirement desiredValue) {
    final ValueProperties desiredConstraints = desiredValue.getConstraints();
    final ValueProperties.Builder requiredConstraints = ValueProperties.builder();
    Set<String> values = desiredConstraints.getValues(HistoricalTimeSeriesFunctionUtils.START_DATE_PROPERTY);
    if ((values == null) || values.isEmpty()) {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.START_DATE_PROPERTY, DateConstraint.NULL.toString());
    } else {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.START_DATE_PROPERTY, values);
    }
    values = desiredConstraints.getValues(HistoricalTimeSeriesFunctionUtils.INCLUDE_START_PROPERTY);
    if ((values == null) || values.isEmpty()) {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.INCLUDE_START_PROPERTY, HistoricalTimeSeriesFunctionUtils.YES_VALUE);
    } else {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.INCLUDE_START_PROPERTY, values);
    }
    values = desiredConstraints.getValues(HistoricalTimeSeriesFunctionUtils.END_DATE_PROPERTY);
    if ((values == null) || values.isEmpty()) {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.END_DATE_PROPERTY, DateConstraint.VALUATION_TIME.toString());
    } else {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.END_DATE_PROPERTY, values);
    }
    values = desiredConstraints.getValues(HistoricalTimeSeriesFunctionUtils.INCLUDE_END_PROPERTY);
    if ((values == null) || values.isEmpty()) {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.INCLUDE_END_PROPERTY, HistoricalTimeSeriesFunctionUtils.YES_VALUE);
    } else {
      requiredConstraints.with(HistoricalTimeSeriesFunctionUtils.INCLUDE_END_PROPERTY, values);
    }
View Full Code Here

    //process single value properties:
    String calcConfigName = properties.getCalculationConfigurationName();
    uri = DependencyGraphTraceProviderResource.uriCalculationConfigurationName(uri, calcConfigName);

    ValueProperties defaultProperties = properties.getDefaultProperties();
    uri = DependencyGraphTraceProviderResource.uriDefaultProperties(uri, defaultProperties);

    List<MarketDataSpecification> marketData = properties.getMarketData();
    if (marketData != null) {
      uri = DependencyGraphTraceProviderResource.uriMarketData(uri, marketData);
View Full Code Here

  private URI processRequirements(URI uri, Collection<ValueRequirement> requirements) {
    for (ValueRequirement valueRequirement : requirements) {

      String valueName = valueRequirement.getValueName();

      ValueProperties constraints = valueRequirement.getConstraints();

      String contraintStr = constraints.isEmpty() ? "" : constraints.toString();

      String constrainedValueName = valueName + contraintStr;

      ComputationTargetReference targetReference = valueRequirement.getTargetReference();
      String targetType = targetReference.getType().toString();
View Full Code Here

    final RiskRun run = _batchMaster.startRiskRun(_cycleMetadataStub, Maps.<String, String>newHashMap(), RunCreationMode.AUTO, SnapshotMode.PREPARED);

    final InMemoryViewComputationResultModel result = new InMemoryViewComputationResultModel();
    final ComputationTargetSpecification computationTargetSpec = new ComputationTargetSpecification(ComputationTargetType.SECURITY, UniqueId.of("Sec", "APPL"));
    final ValueProperties properties = ValueProperties.with(ValuePropertyNames.FUNCTION, "asd").get();
    final ValueSpecification valueSpec = new ValueSpecification("value", computationTargetSpec, properties);
    final ComputedValueResult cvr = new ComputedValueResult(valueSpec, 1000.0, AggregatedExecutionLog.EMPTY, null, null, InvocationResult.SUCCESS);
    //cvr.setRequirements(newHashSet(_requirement));
    result.addValue("config_1", cvr);
   
View Full Code Here

  protected static String getViewDefaultCurrencyISO(final FunctionCompilationContext context) {
    ViewCalculationConfiguration viewCalculationConfiguration = context.getViewCalculationConfiguration();
    if (viewCalculationConfiguration == null) {
      return null;
    }
    ValueProperties defaultProperties = viewCalculationConfiguration.getDefaultProperties();
    if (defaultProperties == null) {
      return null;
    }
    final Set<String> currencies = defaultProperties.getValues(ValuePropertyNames.CURRENCY);
    if (currencies == null) {
      return null;
    }
    if (currencies.size() != 1) {
      return null;
View Full Code Here

  private static Pair<String, ValueSpecification> target(final GridCell cell) {
    final int row = cell.getRow();
    final int col = cell.getColumn();
    final ComputationTargetSpecification target = new ComputationTargetSpecification(ComputationTargetType.POSITION,
                                                                               UniqueId.of("Cell", row + "," + col));
    final ValueProperties properties = ValueProperties.with(ValuePropertyNames.FUNCTION, "fnName").get();
    return Pair.of("Default", new ValueSpecification("valueName(" + row + "," + col + ")", target, properties));
  }
View Full Code Here

    }
    return ret;
  }

  protected static String getSingleProperty(final ValueSpecification spec, final String propertyName) {
    final ValueProperties properties = spec.getProperties();
    final Set<String> curves = properties.getValues(propertyName);
    if (curves.size() != 1) {
      throw new IllegalArgumentException("Couldn't find curve property from " + spec);
    }
    final String curve = Iterables.get(curves, 0);
    return curve;
View Full Code Here

TOP

Related Classes of com.opengamma.engine.value.ValueProperties

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.