FinancialSecurity financialSec = (FinancialSecurity) security;
financialSec.accept(new SecurityTemplateModelObjectBuilder(out, data().getSecurityMaster(), data().getOrganizationMaster()));
} else {
if (security.getSecurityType().equals(SecurityEntryData.EXTERNAL_SENSITIVITIES_SECURITY_TYPE)) {
RawSecurity rawSecurity = (RawSecurity) security;
FudgeMsgEnvelope msg = OpenGammaFudgeContext.getInstance().deserialize(rawSecurity.getRawData());
SecurityEntryData securityEntryData = OpenGammaFudgeContext.getInstance().fromFudgeMsg(SecurityEntryData.class, msg.getMessage());
out.put("securityEntryData", securityEntryData);
RawSecurity underlyingRawSecurity = (RawSecurity) getSecurity(securityEntryData.getFactorSetId(), data().getSecurityMaster());
if (underlyingRawSecurity != null) {
FudgeMsgEnvelope factorIdMsg = OpenGammaFudgeContext.getInstance().deserialize(underlyingRawSecurity.getRawData());
@SuppressWarnings("unchecked")
List<FactorExposureData> factorExposureDataList = OpenGammaFudgeContext.getInstance().fromFudgeMsg(List.class, factorIdMsg.getMessage());
s_logger.error(factorExposureDataList.toString());
List<FactorExposure> factorExposuresList = convertToFactorExposure(factorExposureDataList);
out.put("factorExposuresList", factorExposuresList);
} else {
s_logger.error("Couldn't find security");
}
}
if (security.getSecurityType().equals(FactorExposureData.EXTERNAL_SENSITIVITIES_RISK_FACTORS_SECURITY_TYPE)) {
RawSecurity rawSecurity = (RawSecurity) security;
FudgeMsgEnvelope msg = OpenGammaFudgeContext.getInstance().deserialize(rawSecurity.getRawData());
@SuppressWarnings("unchecked")
List<FactorExposureData> factorExposureDataList = OpenGammaFudgeContext.getInstance().fromFudgeMsg(List.class, msg.getMessage());
List<FactorExposure> factorExposuresList = convertToFactorExposure(factorExposureDataList);
out.put("factorExposuresList", factorExposuresList);
}
}
}