Package com.opengamma.engine.target

Examples of com.opengamma.engine.target.ComputationTargetRequirement


   * @param valueName the name of the value to load, not null
   * @param targetType the target type, not null
   * @param targetId the external identifier of the target, not null
   */
  public ValueRequirement(final String valueName, final ComputationTargetType targetType, final ExternalId targetId) {
    this(valueName, new ComputationTargetRequirement(targetType, targetId));
  }
View Full Code Here


   * @param targetType the target type, not null
   * @param targetId the external identifier of the target, not null
   * @param constraints the value constraints that must be satisfied
   */
  public ValueRequirement(final String valueName, final ComputationTargetType targetType, final ExternalId targetId, final ValueProperties constraints) {
    this(valueName, new ComputationTargetRequirement(targetType, targetId), constraints);
  }
View Full Code Here

   * @param valueName the name of the value to load, not null
   * @param targetType the target type, not null
   * @param targetIds the external identifiers of the target, not null
   */
  public ValueRequirement(final String valueName, final ComputationTargetType targetType, final ExternalIdBundle targetIds) {
    this(valueName, new ComputationTargetRequirement(targetType, targetIds));
  }
View Full Code Here

   * @param targetType the target type, not null
   * @param targetIds the external identifiers of the target, not null
   * @param constraints the value constraints that must be satisfied
   */
  public ValueRequirement(final String valueName, final ComputationTargetType targetType, final ExternalIdBundle targetIds, final ValueProperties constraints) {
    this(valueName, new ComputationTargetRequirement(targetType, targetIds), constraints);
  }
View Full Code Here

    @Override
    public ComputationTargetReference visitComputationTargetRequirement(final ComputationTargetRequirement requirement) {
      final ComputationTargetType leafType = getLeafType(requirement.getType());
      if (leafType != null) {
        return MemoryUtils.instance(new ComputationTargetRequirement(leafType, requirement.getIdentifiers()));
      } else {
        return requirement;
      }
    }
View Full Code Here

    _resolver = resolver;
  }

  @Override
  public Security resolveSecurity(ExternalId id) {
    ComputationTargetRequirement securityReq = new ComputationTargetRequirement(ComputationTargetType.SECURITY, id);
    ComputationTargetSpecification securitySpec =
        _resolver.getSpecificationResolver().getTargetSpecification(securityReq);
    ComputationTarget target = _resolver.resolve(securitySpec);
    if (target == null) {
      return null;
View Full Code Here

    if (link.getTarget() != null) {
      uid = link.getTarget().getUniqueId();
      if (link.getObjectId() != null) {
        key = new ComputationTargetSpecification(ComputationTargetType.SECURITY, uid.toLatest());
      } else if (!link.getExternalId().isEmpty()) {
        key = new ComputationTargetRequirement(ComputationTargetType.SECURITY, link.getExternalId());
      } else {
        return;
      }
      if (uid == null) {
        throw new IllegalArgumentException("Provided a SecurityLink " + link + " where the UniqueId could not be identified. Error in underlying Source/Master.");
View Full Code Here

  public static ValueRequirement createRequirement(final ComputationTargetType type, final ObjectId oid) {
    return createRequirement(new ComputationTargetSpecification(type, oid.atLatestVersion()), RELATIVE_REFERENCED);
  }

  public static ValueRequirement createRequirement(final ComputationTargetType type, final ExternalId eid) {
    return createRequirement(new ComputationTargetRequirement(type, eid), RELATIVE_REFERENCED);
  }
View Full Code Here

  public static ValueRequirement createRequirement(final ComputationTargetType type, final ExternalId eid) {
    return createRequirement(new ComputationTargetRequirement(type, eid), RELATIVE_REFERENCED);
  }

  public static ValueRequirement createRequirement(final ComputationTargetType type, final ExternalIdBundle eids) {
    return createRequirement(new ComputationTargetRequirement(type, eids), RELATIVE_REFERENCED);
  }
View Full Code Here

    final List<ComputationTargetType> types = type.accept(s_getNestedType, null);
    if (types == null) {
      if (message.getByName(IDENTIFIER_FIELD_NAME) == null) {
        return ComputationTargetSpecification.NULL;
      } else {
        return new ComputationTargetRequirement(type, ExternalIdBundle.EMPTY);
      }
    } else if (types.isEmpty()) {
      FudgeField field = message.getByName(IDENTIFIER_FIELD_NAME);
      if (field == null) {
        field = message.getByName("computationTargetId");
      }
      if (field.getValue() instanceof FudgeMsg) {
        return new ComputationTargetRequirement(type, deserializer.fieldValueToObject(ExternalIdBundle.class, field));
      } else {
        return new ComputationTargetSpecification(type, message.getFieldValue(UniqueId.class, field));
      }
    } else {
      ComputationTargetReference result = null;
      final Iterator<ComputationTargetType> itrType = types.iterator();
      for (final FudgeField field : message.getAllByName(IDENTIFIER_FIELD_NAME)) {
        type = itrType.next();
        if (field.getValue() instanceof FudgeMsg) {
          final ExternalIdBundle identifiers = deserializer.fieldValueToObject(ExternalIdBundle.class, field);
          if (result == null) {
            result = new ComputationTargetRequirement(type, identifiers);
          } else {
            result = result.containing(type, identifiers);
          }
        } else {
          final UniqueId identifier = message.getFieldValue(UniqueId.class, field);
View Full Code Here

TOP

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

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.