Package org.fudgemsg

Examples of org.fudgemsg.MutableFudgeMsg


  public static MutableFudgeMsg toFudgeMsg(final FudgeSerializer serializer, final UniqueId object) {
    if (object == null) {
      return null;
    }
    final MutableFudgeMsg msg = serializer.newMessage();
    toFudgeMsg(serializer, object, msg);
    return msg;
  }
View Full Code Here


    /** The inflation node type field */
    private static final String INFLATION_NODE_TYPE_FIELD = "inflationNodeType";

    @Override
    public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final ZeroCouponInflationNode object) {
      final MutableFudgeMsg message = serializer.newMessage();
      message.add(null, 0, object.getClass().getName());
      message.add(TENOR_FIELD, object.getTenor().getPeriod().toString());
      message.add(INFLATION_CONVENTION_FIELD, object.getInflationLegConvention());
      message.add(FIXED_CONVENTION_FIELD, object.getFixedLegConvention());
      message.add(INFLATION_NODE_TYPE_FIELD, object.getInflationNodeType().name());
      message.add(CURVE_MAPPER_ID_FIELD, object.getCurveNodeIdMapperName());
      if (object.getName() != null) {
        message.add(NAME_FIELD, object.getName());
      }
      return message;
    }
View Full Code Here

  /** The future prefix field */
  private static final String PREFIX_FIELD = "prefix";

  @Override
  public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final SyntheticFutureCurveInstrumentProvider object) {
    final MutableFudgeMsg message = serializer.newMessage();
    message.add(PREFIX_FIELD, object.getFuturePrefix());
    return message;
  }
View Full Code Here

  private static final String STRIP_NAME = "strip";
  private static final String IDENTIFIER_NAME = "identifier";
 
  @Override
  public MutableFudgeMsg buildMessage(FudgeSerializer serializer, FixedIncomeStripWithIdentifier object) {
    MutableFudgeMsg message = serializer.newMessage();
    serializer.addToMessage(message, STRIP_NAME, null, object.getStrip());
    serializer.addToMessage(message, IDENTIFIER_NAME, null, object.getSecurity());
    return message;
  }
View Full Code Here

    ByteArrayFudgeMessageReceiver fudgeReceiver = new ByteArrayFudgeMessageReceiver(collectingReceiver);
    DirectInvocationByteArrayMessageSender byteArraySender = new DirectInvocationByteArrayMessageSender(fudgeReceiver);
    ByteArrayFudgeMessageSender fudgeSender = new ByteArrayFudgeMessageSender(byteArraySender, context);
    TaxonomyGatheringFudgeMessageSender gatheringSender = new TaxonomyGatheringFudgeMessageSender(fudgeSender, tmpFile.getAbsolutePath(), context, 1000L);
   
    MutableFudgeMsg msg1 = context.newMessage();
    msg1.add("name1", 1);
    msg1.add("name2", 1);
    msg1.add("name3", 1);
    msg1.add("name1", 1);
    MutableFudgeMsg msg2 = context.newMessage();
    msg1.add("name4", msg2);
    msg2.add(14, 1);
    msg2.add("name5", "foo");
   
    gatheringSender.send(msg1);
   
    assertTrue(gatheringSender.getCurrentTaxonomy().containsKey("name1"));
    assertTrue(gatheringSender.getCurrentTaxonomy().containsKey("name2"));
View Full Code Here

  private static final Logger LOG = LoggerFactory.getLogger(BloombergIRFuturePriceCurveInstrumentProviderFudgeBuilder.class);
 
  @Override
  public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final BloombergIRFuturePriceCurveInstrumentProvider object) {
    final MutableFudgeMsg message = serializer.newMessage();
    FudgeSerializer.addClassHeader(message, BloombergIRFuturePriceCurveInstrumentProvider.class);
    message.add("futurePrefix", object.getFuturePrefix());
    message.add("postfix", object.getPostfix());
    message.add("dataFieldName", object.getDataFieldName());
   
    String scheme = object.getTickerScheme();
    if (scheme == null) {
      scheme = "BLOOMBERG_TICKER_WEAK";
      LOG.warn("{} FuturePriceCurveSpecification field, tickerScheme, was null. Using BLOOMBERG_TICKER_WEAK. Please Update in Configurations by choosing desired tickerScheme and saving.",
          object.getFuturePrefix());
    }
    message.add("tickerScheme", scheme);
    return message;
  }
View Full Code Here

    /** The spot lag field */
    private static final String SPOT_LAG_FIELD = "spotLag";

    @Override
    public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final InflationLegConvention object) {
      final MutableFudgeMsg message = serializer.newMessage();
      FudgeSerializer.addClassHeader(message, InflationLegConvention.class);
      serializer.addToMessage(message, PRICE_INDEX_FIELD, null, object.getPriceIndexConvention());
      message.add(BUSINESS_DAY_CONVENTION_FIELD, object.getBusinessDayConvention().getConventionName());
      message.add(DAYCOUNT_FIELD, object.getDayCount().getConventionName());
      message.add(IS_EOM_FIELD, object.isIsEOM());
      message.add(MONTH_LAG_FIELD, object.getMonthLag());
      message.add(SPOT_LAG_FIELD, object.getSpotLag());
      message.add(NAME_FIELD, object.getName());
      serializer.addToMessage(message, EXTERNAL_ID_BUNDLE_FIELD, null, object.getExternalIdBundle());
      serializer.addToMessage(message, UNIQUE_ID_FIELD, null, object.getUniqueId());
      return message;
    }
View Full Code Here

    /** The convention field */
    private static final String CONVENTION_FIELD = "convention";

    @Override
    public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final ConventionDocument object) {
      final MutableFudgeMsg message = serializer.newMessage();
      FudgeSerializer.addClassHeader(message, ConventionDocument.class);
      serializer.addToMessageWithClassHeaders(message, CONVENTION_FIELD, null, object.getConvention(), object.getConvention().getClass());
      return message;
    }
View Full Code Here

@FudgeBuilderFor(BloombergSwaptionVolatilitySurfaceInstrumentProvider.class)
public class BloombergSwaptionVolatilitySurfaceInstrumentProviderFudgeBuilder implements FudgeBuilder<BloombergSwaptionVolatilitySurfaceInstrumentProvider> {

  @Override
  public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final BloombergSwaptionVolatilitySurfaceInstrumentProvider object) {
    final MutableFudgeMsg message = serializer.newMessage();
    FudgeSerializer.addClassHeader(message, BloombergSwaptionVolatilitySurfaceInstrumentProvider.class);
    message.add(PREFIX_FIELD_NAME, object.getCountryPrefix());
    message.add("type", object.getTypePrefix());
    message.add(POSTFIX_FIELD_NAME, object.getPostfix());
    message.add("zeroPadFirstTenor", object.isZeroPadSwapMaturityTenor()); //TODO rename the field name
    message.add("zeroPadSecondTenor", object.isZeroPadSwaptionExpiryTenor()); //TODO rename the field name
    message.add(DATA_FIELD_NAME, object.getDataFieldName());
    return message;
  }
View Full Code Here

  private static final String PREFIX = "prefix";
  private static final String SPOT_PREFIX = "spotPrefix";

  @Override
  public MutableFudgeMsg buildMessage(final FudgeSerializer serializer, final BloombergFXForwardCurveInstrumentProvider object) {
    final MutableFudgeMsg message = serializer.newMessage();
    message.add(PREFIX, object.getPrefix());
    message.add(POSTFIX, object.getPostfix());
    if (!object.getSpotPrefix().equals(object.getPrefix())) {
      message.add(SPOT_PREFIX, object.getSpotPrefix());
    }
    message.add(DATA_FIELD_NAME, object.getDataFieldName());
    return message;
  }
View Full Code Here

TOP

Related Classes of org.fudgemsg.MutableFudgeMsg

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.