Package com.opengamma.core.security

Examples of com.opengamma.core.security.Security


    _samplingFunction = samplingFunction;
  }

  @Override
  public boolean canApplyTo(final FunctionCompilationContext context, final ComputationTarget target) {
    final Security security = target.getPosition().getSecurity();
    return security instanceof StandardCDSSecurity ||
        security instanceof LegacyCDSSecurity ||
        security instanceof CreditDefaultSwapOptionSecurity ||
        security instanceof CreditDefaultSwapIndexSecurity;
  }
View Full Code Here


    _applicableCurrencies = applicableCurrencies;
  }

  @Override
  public boolean canApplyTo(final FunctionCompilationContext context, final ComputationTarget target) {
    final Security security = target.getPositionOrTrade().getSecurity();
    if (!(security instanceof FinancialSecurity)) {
      return false;
    }
    if (FXUtils.isFXSecurity(security)) {
      return false;
View Full Code Here

    return ComputationTargetType.POSITION;
  }

  @Override
  public boolean canApplyTo(final FunctionCompilationContext context, final ComputationTarget target) {
    final Security security = target.getPosition().getSecurity();
    if (FXUtils.isFXSecurity(security)) {
      // Can't do FX securities with this because they don't have a single currency we can use
      return false;
    }
    return true;
View Full Code Here

    return results;
  }

  @Override
  public Security getSingle(ExternalIdBundle bundle) {
    Security result = getUnderlying().getSingle(bundle);
    processResult(result);
    return result;
  }
View Full Code Here

    return result;
  }

  @Override
  public Security getSingle(ExternalIdBundle bundle, VersionCorrection versionCorrection) {
    Security result = getUnderlying().getSingle(bundle, versionCorrection);
    processResult(result);
    return result;
  }
View Full Code Here

    return result;
  }

  @Override
  public Security get(UniqueId uniqueId) {
    Security security = getFromRedis(uniqueId);
    if (security == null) {
      s_logger.warn("Unable to satisfy {} using Redis", uniqueId);
      security = getUnderlying().get(uniqueId);
      processResult(security);
    } else {
View Full Code Here

    return security;
  }

  @Override
  public Security get(ObjectId objectId, VersionCorrection versionCorrection) {
    Security result = getUnderlying().get(objectId, versionCorrection);
    processResult(result);
    return result;
  }
View Full Code Here

        byte[] data = jedis.get(redisKey);
        if (data == null) {
          return null;
        }
       
        Security security = null;
        try {
          // REVIEW kirk 2013-06-05 -- This will definitely fail, but this class is a work in progress
          // and likely to never work in its current form.
          security = SecurityFudgeUtil.convertFromFudge(getFudgeContext(), null, data);
        } catch (Exception e) {
View Full Code Here

*/
public class CreditDefaultSwapIndexCS01PnLFunction extends CreditInstrumentCS01PnLFunction {

  @Override
  public boolean canApplyTo(final FunctionCompilationContext context, final ComputationTarget target) {
    final Security security = target.getPosition().getSecurity();
    return security instanceof CreditDefaultSwapIndexSecurity;
  }
View Full Code Here

        return new ObjectsPair<ManageablePosition, ManageableSecurity[]>(null, null);
      }

      // Write the related security(ies)
      ManageableSecurityLink sLink = position.getSecurityLink();
      Security security = sLink.resolveQuiet(_securitySource);
      if ((security != null) && (security instanceof ManageableSecurity)) {
       
        // Find underlying security
        // TODO support multiple underlyings; unfortunately the system does not provide a standard way
        // to retrieve underlyings
        if (((ManageableSecurity) security).propertyNames().contains("underlyingId")) {
          ExternalId id = (ExternalId) ((ManageableSecurity) security).property("underlyingId").get();
       
          Security underlying;
          try {
            underlying = _securitySource.getSingle(id.toBundle());
            if (underlying != null) {
              return new ObjectsPair<ManageablePosition, ManageableSecurity[]>(
                  position,
View Full Code Here

TOP

Related Classes of com.opengamma.core.security.Security

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.