Package com.opengamma.master.security

Examples of com.opengamma.master.security.RawSecurity


  }

  private List<FactorExposureData> decodeSensitivities(final SecuritySource secSource, final RawSecurity rawSecurity) {
    final FudgeMsgEnvelope msg = OpenGammaFudgeContext.getInstance().deserialize(rawSecurity.getRawData());
    final SecurityEntryData securityEntryData = OpenGammaFudgeContext.getInstance().fromFudgeMsg(SecurityEntryData.class, msg.getMessage());
    final RawSecurity underlyingRawSecurity = (RawSecurity) secSource.getSingle(securityEntryData.getFactorSetId().toBundle());
    if (underlyingRawSecurity != null) {
      final FudgeMsgEnvelope factorIdMsg = OpenGammaFudgeContext.getInstance().deserialize(underlyingRawSecurity.getRawData());
      @SuppressWarnings("unchecked")
      final
      List<FactorExposureData> factorExposureDataList = OpenGammaFudgeContext.getInstance().fromFudgeMsg(List.class, factorIdMsg.getMessage());
      return factorExposureDataList;
    } else {
View Full Code Here


      return true;
    }
    if (!(target.getPosition().getSecurity() instanceof RawSecurity)) {
      return false;
    }
    final RawSecurity security = (RawSecurity) target.getPosition().getSecurity();
    return security.getSecurityType().equals(SecurityEntryData.EXTERNAL_SENSITIVITIES_SECURITY_TYPE);
  }
View Full Code Here

*/
public class ExternallyProvidedSecurityMarkFunction extends AbstractFunction.NonCompiledInvoker {

  @Override
  public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
    final RawSecurity security = (RawSecurity) target.getSecurity();
    final SecurityEntryData securityEntryData = RawSecurityUtils.decodeSecurityEntryData(security);
    final Object latestDataPointObject = inputs.getValue(ValueRequirementNames.HISTORICAL_TIME_SERIES_LATEST);
    if (latestDataPointObject == null) {
      throw new OpenGammaRuntimeException("Could not get latest data point");
    }
View Full Code Here

    return RawSecurityUtils.isExternallyProvidedSensitivitiesSecurity(target.getSecurity());
  }

  @Override
  public Set<ValueRequirement> getRequirements(final FunctionCompilationContext context, final ComputationTarget target, final ValueRequirement desiredValue) {
    final RawSecurity security = (RawSecurity) target.getSecurity();
    final SecurityEntryData securityEntryData = RawSecurityUtils.decodeSecurityEntryData(security);
    final HistoricalTimeSeriesResolver resolver = OpenGammaCompilationContext.getHistoricalTimeSeriesResolver(context);
    final HistoricalTimeSeriesResolutionResult timeSeries = resolver.resolve(securityEntryData.getId().toBundle(), null, "LITHIUM", null, "PX_LAST", null);
    if (timeSeries == null) {
      return null;
View Full Code Here

        timeSeries.getHistoricalTimeSeriesInfo().getUniqueId(), ValueProperties.none()));
  }

  @Override
  public Set<ValueSpecification> getResults(final FunctionCompilationContext context, final ComputationTarget target) {
    final RawSecurity security = (RawSecurity) target.getSecurity();
    final SecurityEntryData securityEntryData = RawSecurityUtils.decodeSecurityEntryData(security);
    return Collections.<ValueSpecification>singleton(new ValueSpecification(ValueRequirementNames.MARK, target.toSpecification(), createValueProperties().with(ValuePropertyNames.CURRENCY,
        securityEntryData.getCurrency().getCode()).get()));
  }
View Full Code Here

      return true;
    }
    if (!(target.getPosition().getSecurity() instanceof RawSecurity)) {
      return false;
    }
    final RawSecurity security = (RawSecurity) target.getPosition().getSecurity();
    return security.getSecurityType().equals(SecurityEntryData.EXTERNAL_SENSITIVITIES_SECURITY_TYPE);
  }
View Full Code Here

  @Override
  public boolean canApplyTo(final FunctionCompilationContext context, final ComputationTarget target) {
    if (!(target.getPosition().getSecurity() instanceof RawSecurity)) {
      return false;
    }
    final RawSecurity security = (RawSecurity) target.getPosition().getSecurity();
    if (!security.getSecurityType().equals(SecurityEntryData.EXTERNAL_SENSITIVITIES_SECURITY_TYPE)) {
      return false;
    }
    final Currency currency = FinancialSecurityUtils.getCurrency(security);
    if (currency == null) {
      return false;
View Full Code Here

  @Override
  public boolean canApplyTo(final FunctionCompilationContext context, final ComputationTarget target) {
    if (!(target.getSecurity() instanceof RawSecurity)) {
      return false;
    }
    final RawSecurity security = (RawSecurity) target.getSecurity();
    return security.getSecurityType().equals(SecurityEntryData.EXTERNAL_SENSITIVITIES_SECURITY_TYPE);
  }
View Full Code Here

        curveCalculationConfig = curveConfigValues.iterator().next();
      }
    }
    assert curveName != null;
    assert curveCalculationConfig != null;
    final RawSecurity security = (RawSecurity) target.getSecurity();
    //final BigDecimal qty = target.getPosition().getQuantity();
    final ValueRequirement curveRequirement = getCurveRequirement(target, curveName, curveCalculationConfig);
    final Object curveObject = inputs.getValue(curveRequirement);
    if (curveObject == null) {
      throw new OpenGammaRuntimeException("Could not get " + curveRequirement);
View Full Code Here

TOP

Related Classes of com.opengamma.master.security.RawSecurity

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.