Package com.opengamma.engine.target

Examples of com.opengamma.engine.target.ComputationTargetType


//      final long runId = rs.getLong("run_id");
      final double value = rs.getDouble("value");
      final String valueName = rs.getString("name");
//      final Timestamp evalInstant = rs.getTimestamp("eval_instant");
//      final long computeNodeId = rs.getLong("compute_node_id");
      final ComputationTargetType computationTargetType = ComputationTargetType.parse(rs.getString("target_type"));
      final String valueRequirementsSyntheticForm = rs.getString("synthetic_form");
      final String targetTypeIdScheme = rs.getString("target_type_id_scheme");
      final String targetTypeIdValue = rs.getString("target_type_id_value");
      final String targetTypeIdVersion = rs.getString("target_type_id_version");
      final UniqueId targetId = UniqueId.of(targetTypeIdScheme, targetTypeIdValue, targetTypeIdVersion);
View Full Code Here


  public void testSimplifyType() {
    final ComputationTargetResolver.AtVersionCorrection underlying = Mockito.mock(ComputationTargetResolver.AtVersionCorrection.class);
    final ConcurrentMap<ComputationTargetReference, UniqueId> resolutions = new ConcurrentHashMap<ComputationTargetReference, UniqueId>();
    final Set<UniqueId> expiredResolutions = new HashSet<UniqueId>();
    final ComputationTargetResolver.AtVersionCorrection resolver = TargetResolutionLogger.of(underlying, resolutions, expiredResolutions);
    final ComputationTargetType type = ComputationTargetType.of(TestSecurity.class);
    Mockito.when(underlying.simplifyType(type)).thenReturn(ComputationTargetType.SECURITY);
    assertSame(resolver.simplifyType(type), ComputationTargetType.SECURITY);
  }
View Full Code Here

    int i = 0, j = 0;
    types[i++] = ComputationTargetType.PRIMITIVE;
    types[i++] = ComputationTargetType.POSITION;
    types[i++] = ComputationTargetType.of(Foo.class);
    while (i < types.length) {
      final ComputationTargetType type = types[j++];
      types[i++] = type.containing(ComputationTargetType.PRIMITIVE);
      types[i++] = ComputationTargetType.PORTFOLIO_NODE.containing(type);
      types[i++] = type.or(types[j]);
    }
    for (ComputationTargetType type : types) {
      assertEncodeDecodeCycle(ComputationTargetType.class, type);
    }
  }
View Full Code Here

 
  private void processStatusResult(ViewComputationResultModel fullResult, PerViewStatusResult statusResult) {
    ViewCalculationResultModel calculationResult = fullResult.getCalculationResult(DEFAULT_CALC_CONFIG);
    Collection<ComputationTargetSpecification> allTargets = calculationResult.getAllTargets();
    for (ComputationTargetSpecification targetSpec : allTargets) {
      ComputationTargetType targetType = targetSpec.getSpecification().getType();
      if (isValidTargetType(targetType)) {
        Map<Pair<String, ValueProperties>, ComputedValueResult> values = calculationResult.getValues(targetSpec);
        for (Map.Entry<Pair<String, ValueProperties>, ComputedValueResult> valueEntry : values.entrySet()) {
          String valueName = valueEntry.getKey().getFirst();
          String currency = getCurrency(targetSpec.getUniqueId(), targetType);
          s_logger.debug("{} currency returned for id:{} targetType:{}", currency, targetSpec.getUniqueId(), targetType);
          if (currency != null) {
            ComputedValueResult computedValue = valueEntry.getValue();
            if (isGoodValue(computedValue)) {
              statusResult.put(new ViewStatusKeyBean(_securityType, valueName, currency, targetType.getName()), ViewStatus.VALUE);
            }
          } else {
            s_logger.error("Discarding result as NULL return as Currency for id: {} targetType:{}", targetSpec.getUniqueId(), targetType);
          }
        }
View Full Code Here

    public void viewDefinitionCompiled(CompiledViewDefinition compiledViewDefinition, boolean hasMarketDataPermissions) {
      s_logger.error("View definition compiled");
      CompiledViewCalculationConfiguration compiledCalculationConfiguration = compiledViewDefinition.getCompiledCalculationConfiguration(DEFAULT_CALC_CONFIG);
      Map<ValueSpecification, Set<ValueRequirement>> terminalOutputs = compiledCalculationConfiguration.getTerminalOutputSpecifications();
      for (ValueSpecification valueSpec : terminalOutputs.keySet()) {
        ComputationTargetType computationTargetType = valueSpec.getTargetSpecification().getType();
        if (isValidTargetType(computationTargetType)) {
          UniqueId uniqueId = valueSpec.getTargetSpecification().getUniqueId();
          String currency = getCurrency(uniqueId, computationTargetType);
          if (currency != null) {
            _statusResult.put(new ViewStatusKeyBean(_securityType, valueSpec.getValueName(), currency, computationTargetType.getName()), ViewStatus.NO_VALUE);
          } else {
            s_logger.error("Discarding result as NULL return as Currency for id: {} targetType:{}", uniqueId, computationTargetType);
          }
        }
      }
View Full Code Here

    return new PortfolioTreeModel(portfolioId, toolContext);
  }
 
  private ResolutionFailureTreeTableModel createResolutionFailureTreeTableModel(final Object leafNode, final String valueReq) {
    DependencyGraphTraceBuilderProperties properties = new DependencyGraphTraceBuilderProperties();
    ComputationTargetType targetType = null;
    if (leafNode instanceof Position) {
      targetType = ComputationTargetType.POSITION;
    } else if (leafNode instanceof Trade) {
      targetType = ComputationTargetType.TRADE;
    } else if (leafNode instanceof PortfolioNode) {
View Full Code Here

    for (ViewResultEntry viewResultEntry : allResults) {
      String calcConfig = viewResultEntry.getCalculationConfiguration();
      ValueSpecification valueSpec = viewResultEntry.getComputedValue().getSpecification();
      ComputedValue computedValue = viewResultEntry.getComputedValue();
     
      ComputationTargetType type = valueSpec.getTargetSpecification().getType();
     
      if (type.isTargetType(ComputationTargetType.POSITION)) {
       
        String destinationName = _jmsTopicNameResolver.resolve(new JmsTopicNameResolveRequest(calcConfig, valueSpec));
        FudgeMsg fudgeMsg = _fudgeContext.toFudgeMsg(computedValue).getMessage();
        final byte[] bytes = _fudgeContext.toByteArray(fudgeMsg);
       
View Full Code Here

    String valueName = "name";
    String targetType = "POSITION";
    String externalId = "Foo~1";

    //expected arg
    ComputationTargetType expectedTargetType = ComputationTargetType.POSITION;
    ExternalId expectedExternalId = ExternalId.parse(externalId);
    ValueRequirement valueRequirement = new ValueRequirement(valueName, new ComputationTargetRequirement(expectedTargetType, expectedExternalId));

    DependencyGraphTraceProviderResource newResource = _resource.setValueRequirementByExternalId(valueName, targetType, externalId);
View Full Code Here

    String targetType = "POSITION";
    String uniqueId = "Foo~1";

    //expected arg
    UniqueId expectedUniqueId = UniqueId.parse(uniqueId);
    ComputationTargetType expectedTargetType = ComputationTargetType.POSITION;
    ValueRequirement valueRequirement = new ValueRequirement(valueName, new ComputationTargetSpecification(expectedTargetType, expectedUniqueId));

    DependencyGraphTraceProviderResource newResource = _resource.setValueRequirementByUniqueId(valueName, targetType, uniqueId);

    assertTrue(newResource.getProperties().getRequirements().contains(valueRequirement));
View Full Code Here

    details.put("indent", row.getDepth());
    if (row.getParentRow() != null) {
      final int[] parentRowIds = getGridStructure().getRowIds(row.getParentRow().getTarget());
      details.put("parentRowId", parentRowIds[0]);
    }
    ComputationTargetType targetType = row.getTarget().getType();
    details.put("type", targetType.toString());

    if (targetType == ComputationTargetType.POSITION) {
      Position position = row.getPosition();
      details.put("posId", position.getUniqueId());
      details.put("position", position.getSecurity().getName());
View Full Code Here

TOP

Related Classes of com.opengamma.engine.target.ComputationTargetType

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.