Class BlotterConfiguration
- java.lang.Object
-
- com.caplin.datasource.blotter.BlotterConfiguration
-
public class BlotterConfiguration extends java.lang.Object
Configuration for the Blotter Provider.
-
-
Constructor Summary
Constructors Constructor Description BlotterConfiguration(java.lang.String blotterIdentifier, java.lang.String channelNamespace, java.lang.String itemNamespace)
Instantiates a new Blotter configuration.BlotterConfiguration(java.lang.String blotterIdentifier, java.lang.String channelNamespace, java.lang.String itemNamespace, java.lang.String subContainerNamespace)
Instantiates a new Blotter configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBlotterIdentifier()
Gets the blotter identifier name.java.lang.String
getChannelNamespace()
Gets the channel namespace.com.caplin.container.Configuration
getContainerConfiguration()
int
getContainerThrottleMillis()
Get the current millisecond delay used for container throttlingjava.lang.String
getItemNamespace()
Gets the item namespace.int
getSubContainerMaxDepth()
Gets the max depth of the sub containers.java.lang.String
getSubContainerNamespace()
Gets the sub channel namespace.boolean
isAutoPermit()
Gets whether automatically permitted.boolean
isAutoSendEmptyContainer()
Gets whether an empty container should be sent automatically as a response to a requestboolean
isChannelUsingImageFlag()
Returns true if image flags are used in the channel for its initial message, or false otherwise.boolean
isItemUsingImageFlag()
Returns true if image flags are used on each channel item for their initial messages, or false otherwise.boolean
isMoveItemToTopWhenModified()
Gets whether items should be moved to the top of the container upon modificationboolean
isPrefixIdWithIdentifier()
When true then the ID will be prefixed with the blotterIdentifier followed by a dash.boolean
isUseGenericObjects()
Gets whether generic objects should be used instead of Type1 Recordsvoid
setAutoPermit(boolean autoPermit)
Sets auto permit enabled/disabled.void
setAutoSendEmptyContainer()
Sets whether an empty container should automatically be sent or not when the channel opensvoid
setChannelUsingImageFlag(boolean isChannelUsingImageFlag)
Set to true and the channel container will use an image flag when sending the initial messagevoid
setContainerThrottleMillis(int millis)
Specify the millisecond delay used to throttle subsequent operations to a single container.void
setItemUsingImageFlag(boolean isItemUsingImageFlag)
Set to true and the channel items will use image flags when sending their initial messagesvoid
setMoveItemToTopWhenModified(boolean moveItemToTopWhenModified)
Sets whether to move an existing item to the top of the container when sendBlotterItem with an Item with the same ID gets called againvoid
setPrefixIdWithIdentifier(boolean prefixIdWithIdentifier)
Set to false to turn off prefixing of ID's with the blotterIdentifier followed by a -.void
setSubcontainerMaxDepth(int subcontainerMaxDepth)
Sets the subcontainer maximum depth.void
setUseGenericObjects(boolean useGenericObjects)
Set whether the API should use generic objects instead of Type1 records.java.lang.String
toString()
-
-
-
Constructor Detail
-
BlotterConfiguration
public BlotterConfiguration(java.lang.String blotterIdentifier, java.lang.String channelNamespace, java.lang.String itemNamespace, java.lang.String subContainerNamespace)
Instantiates a new Blotter configuration.
The blotter identifier can be anything but its recommended it is the name of your blotter, e.g. OrderBlotter, HistoricBlotter, ActivityBlotter. As this identifier will appear in the logging
The channel namespace must be a namespace subject which contains %u or %U. E.g. /BLOTTER/%u/CHANNEL
The item namespace must be a namespace subject which contains both %u or %U and %i. E.g. /BLOTTER/%u/ITEM/%i
The sub channel namespace must be a namespace subject which contains both %u or %U and %i. E.g. /BLOTTER/%u/SUBCONTAINER/%i
- %U = username with session that requested the subject. E.g. admin-0
- %u = username that requested the subject. E.g. admin
- %i = unique id relating to the blotter item requested, must be the last variable part of the namespace. E.g. 1234 and it will be prefixed with the BlotterIdentifier
- Parameters:
blotterIdentifier
- the blotter identifierchannelNamespace
- the channel namespaceitemNamespace
- the item namespacesubContainerNamespace
- the sub channel namespace
-
BlotterConfiguration
public BlotterConfiguration(java.lang.String blotterIdentifier, java.lang.String channelNamespace, java.lang.String itemNamespace)
Instantiates a new Blotter configuration.
The blotter identifier can be anything but its recommended it is the name of your blotter, e.g. OrderBlotter, HistoricBlotter, ActivityBlotter. As this identifier will appear in the logging
The channel namespace must be a namespace subject which contains %u or %U. E.g. /BLOTTER/%u/CHANNEL
The item namespace must be a namespace subject which contains both %u or %U and %i. E.g. /BLOTTER/%u/ITEM/%i
- %U = username with session that requested the subject. E.g. admin-0
- %u = username that requested the subject. E.g. admin
- %i = unique id relating to the blotter item requested, must be the last variable part of the namespace. E.g. 1234 and it will be prefixed with the BlotterIdentifier
- Parameters:
blotterIdentifier
- the blotter identifierchannelNamespace
- the channel namespaceitemNamespace
- the item namespace
-
-
Method Detail
-
isChannelUsingImageFlag
public boolean isChannelUsingImageFlag()
Returns true if image flags are used in the channel for its initial message, or false otherwise.
- Returns:
- Returns true if the channel uses image flags
-
setChannelUsingImageFlag
public void setChannelUsingImageFlag(boolean isChannelUsingImageFlag)
Set to true and the channel container will use an image flag when sending the initial message
The default, recommended setting is true. The use case for setting to false is to prevent blotter channel contents being overwritten when two providers provide to the same channel
- Parameters:
isChannelUsingImageFlag
- boolean used to set the channel image flag
-
isItemUsingImageFlag
public boolean isItemUsingImageFlag()
Returns true if image flags are used on each channel item for their initial messages, or false otherwise.
- Returns:
- Returns true if channel items use image flags
-
setItemUsingImageFlag
public void setItemUsingImageFlag(boolean isItemUsingImageFlag)
Set to true and the channel items will use image flags when sending their initial messages
The default, recommended setting is true. The use case for setting to false is to prevent items being overwritten when two providers provide for the same channel
- Parameters:
isItemUsingImageFlag
- boolean used to set the channel items image flags
-
getChannelNamespace
public java.lang.String getChannelNamespace()
Gets the channel namespace.
- Returns:
- the channel namespace in the blotter configuration
-
getItemNamespace
public java.lang.String getItemNamespace()
Gets the item namespace.
- Returns:
- the item namespace in the blotter configuration
-
getSubContainerNamespace
public java.lang.String getSubContainerNamespace()
Gets the sub channel namespace.
- Returns:
- the sub channel namespace in the blotter configuration
-
setSubcontainerMaxDepth
public void setSubcontainerMaxDepth(int subcontainerMaxDepth)
Sets the subcontainer maximum depth.
Specify at which level in the tree to start using materialised path representation of subcontainers rather than separate containers. A subscription to a container at the level of maximum depth will return all items below it in the tree. Each item's location in the tree will be represented Address field as if in actual subcontainers.
- Parameters:
subcontainerMaxDepth
- the subcontainer maximum depth
-
getSubContainerMaxDepth
public int getSubContainerMaxDepth()
Gets the max depth of the sub containers.
- Returns:
- the max depth of the sub containers
-
setAutoPermit
public void setAutoPermit(boolean autoPermit)
Sets auto permit enabled/disabled.
Configures whether Liberator should automatically allow subscriptions to every Blotter item within a BlotterChannel or it should check the permissions for every BlotterItem. If the DataSource is trusted, it should only send out updates that that user is permissioned for so checking isn't strictly necessary.
- Parameters:
autoPermit
- whether to automatically permit BlotterItems or not.
-
isAutoPermit
public boolean isAutoPermit()
Gets whether automatically permitted.
- Returns:
- whether BlotterItems are automatically permitted or not.
-
getBlotterIdentifier
public java.lang.String getBlotterIdentifier()
Gets the blotter identifier name.
- Returns:
- the blotter identifier in the blotter configuration
-
setAutoSendEmptyContainer
public void setAutoSendEmptyContainer()
Sets whether an empty container should automatically be sent or not when the channel opens
-
isAutoSendEmptyContainer
public boolean isAutoSendEmptyContainer()
Gets whether an empty container should be sent automatically as a response to a request
Default: false
- Returns:
- true if an empty container should automatically be sent out
-
setUseGenericObjects
public void setUseGenericObjects(boolean useGenericObjects)
Set whether the API should use generic objects instead of Type1 records.
Default: false
- Parameters:
useGenericObjects
- true for generic objects
-
isUseGenericObjects
public boolean isUseGenericObjects()
Gets whether generic objects should be used instead of Type1 Records
- Returns:
- true for generic objects, false for Type1 records
-
setMoveItemToTopWhenModified
public void setMoveItemToTopWhenModified(boolean moveItemToTopWhenModified)
Sets whether to move an existing item to the top of the container when sendBlotterItem with an Item with the same ID gets called again
Default: false
- Parameters:
moveItemToTopWhenModified
- true to move item to the top, false to leave existing items where they are
-
isMoveItemToTopWhenModified
public boolean isMoveItemToTopWhenModified()
Gets whether items should be moved to the top of the container upon modification
- Returns:
- true to move item, false to leave it where it is
-
isPrefixIdWithIdentifier
public boolean isPrefixIdWithIdentifier()
When true then the ID will be prefixed with the blotterIdentifier followed by a dash. Default is true.
Changing this to false breaks setups where two providers supply different rows of the same blotter!
- Returns:
- true to prefix Blotter ID's with the blotterIdentifier followed by a -
-
setPrefixIdWithIdentifier
public void setPrefixIdWithIdentifier(boolean prefixIdWithIdentifier)
Set to false to turn off prefixing of ID's with the blotterIdentifier followed by a -.
Changing this to false breaks setups where two providers supply different rows of the same blotter
- Parameters:
prefixIdWithIdentifier
- default: true
-
setContainerThrottleMillis
public void setContainerThrottleMillis(int millis)
Specify the millisecond delay used to throttle subsequent operations to a single container. This essentially combines multiple addElement calls into one single container update if all the adds happen within the throttle millisecond period
- Parameters:
millis
- millisecond delay used for throttling
-
getContainerThrottleMillis
public int getContainerThrottleMillis()
Get the current millisecond delay used for container throttling
- Returns:
- current millisecond delay for container throttling
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getContainerConfiguration
public com.caplin.container.Configuration getContainerConfiguration()
- Returns:
- the container configuration
-
-