Class BlotterItem

java.lang.Object
com.caplin.datasource.blotter.BlotterItem

public class BlotterItem extends Object

BlotterItem is the data type representing a single item on the blotter. It is identified by the uniqueId passed into the constructor. It provides methods for setting its fields.

BlotterItems are passed into the BlotterChannel.sendBlotterItem(BlotterItem) and BlotterChannel.sendBlotterItems(java.util.List) methods on the BlotterChannel received on BlotterApplicationListener callbacks.

The uniqueId replaces the '%i' in the itemNamespace passed into the BlotterConfiguration to create the record subject for this item.

BlotterItems can be reused in different BlotterChannels as they are completely separate from them.

  • Constructor Details

    • BlotterItem

      public BlotterItem(String uniqueId)
      Parameters:
      uniqueId - Unique identifier for this blotter item. This id is used when removing items from the BlotterChannel and in the callback in BlotterChannelListener.
  • Method Details

    • getUniqueId

      public String getUniqueId()
      Returns:
      uniqueId The uniqueId this BlotterItem was instantiated with.
    • setParent

      @Deprecated public void setParent(BlotterItem parentBlotterItem)
      Parameters:
      parentBlotterItem - The parent of this BlotterItem. To change the parent of the BlotterItem, the item must be removed and resent.
    • getParent

      public BlotterItem getParent()
      Returns:
      uniqueId The parent of this BlotterItem.
    • setParentItem

      public void setParentItem(BlotterItem parentItem)
      Parameters:
      parentItem - The parent of this BlotterItem. To change the parent of the BlotterItem, the item must be removed and resent.
    • getField

      public String getField(String name)
      Parameters:
      name - Key associated with a value
      Returns:
      Value of this field
    • setField

      public void setField(String name, String value)
      Parameters:
      name - Field name associate with a value. These must be present in the fields.conf used to configure the DataSource.
      value - Value to send associated with this field name
    • getFields

      public Map<String,String> getFields()
      Returns:
      A map containing all fields present on this BlotterItem.
    • setFields

      public void setFields(Map<String,String> fieldMap)
      Parameters:
      fieldMap - Map of fields and values for this BlotterItem. The field names must be present in the fields.conf used to configure the DataSource.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      String containing this BlotterItem's uniqueId and fields.
    • toRecordItem

      public com.caplin.container.RecordItem toRecordItem(BlotterConfiguration configuration, String username, String parameters)
    • getHexEncodedUniqueId

      public String getHexEncodedUniqueId()
      Returns:
      Unique identifier for this blotter item encoded in hex.