Package com.caplin.datasource.blotter
Class BlotterItem
- java.lang.Object
-
- com.caplin.datasource.blotter.BlotterItem
-
public class BlotterItem extends java.lang.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)
andBlotterChannel.sendBlotterItems(java.util.List)
methods on theBlotterChannel
received onBlotterApplicationListener
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
BlotterChannel
s as they are completely separate from them.
-
-
Constructor Summary
Constructors Constructor Description BlotterItem(java.lang.String uniqueId)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getField(java.lang.String name)
java.util.Map<java.lang.String,java.lang.String>
getFields()
java.lang.String
getHexEncodedUniqueId()
BlotterItem
getParent()
java.lang.String
getUniqueId()
void
setField(java.lang.String name, java.lang.String value)
void
setFields(java.util.Map<java.lang.String,java.lang.String> fieldMap)
void
setParent(BlotterItem parentBlotterItem)
Deprecated.void
setParentItem(BlotterItem parentItem)
com.caplin.container.RecordItem
toRecordItem(BlotterConfiguration configuration, java.lang.String username, java.lang.String parameters)
java.lang.String
toString()
-
-
-
Constructor Detail
-
BlotterItem
public BlotterItem(java.lang.String uniqueId)
- Parameters:
uniqueId
- Unique identifier for this blotter item. This id is used when removing items from theBlotterChannel
and in the callback inBlotterChannelListener
.
-
-
Method Detail
-
getUniqueId
public java.lang.String getUniqueId()
- Returns:
- uniqueId The uniqueId this BlotterItem was instantiated with.
-
setParent
@Deprecated public void setParent(BlotterItem parentBlotterItem)
Deprecated.- 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 java.lang.String getField(java.lang.String name)
- Parameters:
name
- Key associated with a value- Returns:
- Value of this field
-
setField
public void setField(java.lang.String name, java.lang.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 java.util.Map<java.lang.String,java.lang.String> getFields()
- Returns:
- A map containing all fields present on this BlotterItem.
-
setFields
public void setFields(java.util.Map<java.lang.String,java.lang.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String containing this BlotterItem's uniqueId and fields.
-
toRecordItem
public com.caplin.container.RecordItem toRecordItem(BlotterConfiguration configuration, java.lang.String username, java.lang.String parameters)
-
getHexEncodedUniqueId
public java.lang.String getHexEncodedUniqueId()
- Returns:
- Unique identifier for this blotter item encoded in hex.
-
-