Class BlotterChannelImpl
- All Implemented Interfaces:
com.caplin.container.impl.cache.CacheMissListener
,BlotterChannel
-
Constructor Summary
ConstructorDescriptionBlotterChannelImpl
(com.caplin.container.impl.Runtime runtime, String username, String parameters, com.caplin.container.impl.cache.Cache blotterCache, BlotterConfiguration configuration, BlotterProviderInternalImpl blotterProviderInternal) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears allBlotterItem
s from the internal cache and sends a container clear so that these items are no longer requested when the channel is subscribed to.void
Closes the channel.int
getCount()
getItemFields
(String itemSubject) getKey()
Returns the parameters for the channelReturns the subject for the channel.Returns the username for the channelboolean
isLastDiscard
(com.caplin.container.impl.sender.Sender sender) void
onCacheMiss
(String subject) void
removeBlotterItem
(String uniqueId) Removes theBlotterItem
from the internal cache and sends a container remove so that this item is no longer requested when the channel is subscribed to.void
removeBlotterItems
(List<String> uniqueIds) RemovesBlotterItem
s from the internal cache and sends a container remove so that these items are no longer requested when the channel is subscribed to.void
sendBlotterItem
(BlotterItem blotterItem) Adds theBlotterItem
to the internal cache and sends a container add so that this item is requested when the channel is subscribed to.void
sendBlotterItemNotFound
(String uniqueId) Sends a not found for aBlotterItem
.void
sendBlotterItems
(List<BlotterItem> newItems) AddsBlotterItem
s to the internal cache and sends a container add so that these items are requested when the channel is subscribed to.void
sendBlotterItemStatusOk
(String uniqueId) Send status ok for aBlotterItem
.void
sendBlotterItemStatusStale
(String uniqueId) Send status stale for aBlotterItem
.void
sendBlotterMapping
(String newSubject) Sends aMappingMessage
to the Liberator, requesting that the Liberator map thisBlotterChannel
instance's subject to the specified subjectnewSubject
.void
Sends a status ok on the channel.void
sendBlotterStatusOk
(String message) Sends a status ok on the channel with custom message.void
Sends a status stale on the channel.void
sendBlotterStatusStale
(String message) Sends a status stale on the channel with custom message.void
Sends an empty container on the channel.void
Sets aBlotterChannelListener
on the channel.toString()
-
Constructor Details
-
BlotterChannelImpl
public BlotterChannelImpl(com.caplin.container.impl.Runtime runtime, String username, String parameters, com.caplin.container.impl.cache.Cache blotterCache, BlotterConfiguration configuration, BlotterProviderInternalImpl blotterProviderInternal)
-
-
Method Details
-
sendBlotterItem
Description copied from interface:BlotterChannel
Adds the
BlotterItem
to the internal cache and sends a container add so that this item is requested when the channel is subscribed to.If an item with the same unique id already exists in the internal cache then that item's fields will be updated with this one. This will then trigger an update for any users currently subscribed to this item.
- Specified by:
sendBlotterItem
in interfaceBlotterChannel
- Parameters:
blotterItem
- to send
-
sendBlotterItems
Description copied from interface:BlotterChannel
Adds
BlotterItem
s to the internal cache and sends a container add so that these items are requested when the channel is subscribed to.If any items with the same unique id already exists in the internal cache then these items fields will be updated with these one. This will then trigger an update for any users currently subscribed to these items.
- Specified by:
sendBlotterItems
in interfaceBlotterChannel
- Parameters:
newItems
- to send
-
sendBlotterMapping
Description copied from interface:BlotterChannel
Sends a
MappingMessage
to the Liberator, requesting that the Liberator map thisBlotterChannel
instance's subject to the specified subjectnewSubject
.Note: Liberator applies mapping rules configured by mapping messages after it applies mapping rules configured by
object-map
config items.This method can be used to provide a user with access to a shared group blotter via a general subject, such as /PRIVATE/FX/GROUPBLOTTER. In the
BlotterApplicationListener.blotterChannelOpened(com.caplin.datasource.blotter.BlotterChannel)
method for the general subject, determine which group the user is a member of and callBlotterChannel.sendBlotterMapping(java.lang.String)
, passing it the subject of the group's blotter.- Specified by:
sendBlotterMapping
in interfaceBlotterChannel
- Parameters:
newSubject
- the subject to map this blotter's subject to
-
removeBlotterItem
Description copied from interface:BlotterChannel
Removes the
BlotterItem
from the internal cache and sends a container remove so that this item is no longer requested when the channel is subscribed to.- Specified by:
removeBlotterItem
in interfaceBlotterChannel
- Parameters:
uniqueId
- of the item to remove
-
removeBlotterItems
Description copied from interface:BlotterChannel
Removes
BlotterItem
s from the internal cache and sends a container remove so that these items are no longer requested when the channel is subscribed to.- Specified by:
removeBlotterItems
in interfaceBlotterChannel
- Parameters:
uniqueIds
- of the items to remove
-
clear
public void clear()Description copied from interface:BlotterChannel
Clears all
BlotterItem
s from the internal cache and sends a container clear so that these items are no longer requested when the channel is subscribed to.- Specified by:
clear
in interfaceBlotterChannel
-
setBlotterChannelListener
Description copied from interface:BlotterChannel
Sets a
BlotterChannelListener
on the channel.Specifically for the case where there is more than one Integration Adapter providing for the same channel subject.
See
BlotterConfiguration
for how to configure for this eventuality.- Specified by:
setBlotterChannelListener
in interfaceBlotterChannel
- Parameters:
listener
- to receive requests for items not already cached by the BlotterAPI
-
sendBlotterStatusStale
public void sendBlotterStatusStale()Description copied from interface:BlotterChannel
Sends a status stale on the channel.
Under normal circumstances this method is not used.
- Specified by:
sendBlotterStatusStale
in interfaceBlotterChannel
-
sendBlotterStatusOk
public void sendBlotterStatusOk()Description copied from interface:BlotterChannel
Sends a status ok on the channel.
Under normal circumstances this method is not used.
- Specified by:
sendBlotterStatusOk
in interfaceBlotterChannel
-
sendBlotterStatusStale
Description copied from interface:BlotterChannel
Sends a status stale on the channel with custom message.
Under normal circumstances this method is not used.
- Specified by:
sendBlotterStatusStale
in interfaceBlotterChannel
-
sendBlotterStatusOk
Description copied from interface:BlotterChannel
Sends a status ok on the channel with custom message.
Under normal circumstances this method is not used.
- Specified by:
sendBlotterStatusOk
in interfaceBlotterChannel
-
sendEmptyBlotter
public void sendEmptyBlotter()Description copied from interface:BlotterChannel
Sends an empty container on the channel.
Invoke when a
BlotterApplicationListener.blotterChannelOpened(com.caplin.datasource.blotter.BlotterChannel)
callback is received and there are currently noBlotterItem
s to be added for the channel. I.e. ABlotterApplicationListener.blotterChannelOpened(com.caplin.datasource.blotter.BlotterChannel)
for a historic trade data BlotterChannel for a user who has not yet traded would be serviced with this method.Note: This method is not required if the blotter Configuration option
BlotterConfiguration.setAutoSendEmptyContainer()
is turned on, in which case the API will send out an empty container for a blotter channel that was opened - unless it is materialized paths- Specified by:
sendEmptyBlotter
in interfaceBlotterChannel
-
sendBlotterItemStatusStale
Description copied from interface:BlotterChannel
Send status stale for a
BlotterItem
.Under normal circumstances this method is not used.
- Specified by:
sendBlotterItemStatusStale
in interfaceBlotterChannel
- Parameters:
uniqueId
- of the message whose status is STALE
-
sendBlotterItemStatusOk
Description copied from interface:BlotterChannel
Send status ok for a
BlotterItem
.Under normal circumstances this method is not used.
- Specified by:
sendBlotterItemStatusOk
in interfaceBlotterChannel
- Parameters:
uniqueId
- of the message whose status is OK
-
sendBlotterItemNotFound
Description copied from interface:BlotterChannel
Sends a not found for a
BlotterItem
.Specifically for the case where there is more than one Integration Adapter providing for the same channel subject.
Sent in response to a
BlotterChannelListener.onBlotterItemRequest(com.caplin.datasource.blotter.BlotterChannel, java.lang.String)
when the item requested is not serviceable by your application.- Specified by:
sendBlotterItemNotFound
in interfaceBlotterChannel
- Parameters:
uniqueId
- of item that cannot be serviced by your application.
-
toString
-
closeChannel
@JMXBeanOperation(name="close-blotter-channel", description="Close blotter channel") public void closeChannel()Description copied from interface:BlotterChannel
Closes the channel.
Sends a Subject Not Found on the channel's subject to let subscribers know that it is no longer serviced.
- Specified by:
closeChannel
in interfaceBlotterChannel
-
getItemSubjects
-
getItemCount
@JMXBeanAttribute(name="item-count", description="Number of items associated with this blotter channel") public Long getItemCount() -
getItemFields
-
getInstantiationTime
@JMXBeanAttribute(name="instantiation-time", description="Time at which this blotter channel was instantiated") public Date getInstantiationTime() -
getUsername
@JMXBeanAttribute(name="username", description="Username of the blotter channel") public String getUsername()Description copied from interface:BlotterChannel
Returns the username for the channel
- Specified by:
getUsername
in interfaceBlotterChannel
- Returns:
- username for the channel
-
getSubject
@JMXBeanAttribute(name="subject", description="Subject of the blotter channel") public String getSubject()Description copied from interface:BlotterChannel
Returns the subject for the channel.
- Specified by:
getSubject
in interfaceBlotterChannel
- Returns:
- subject for the channel
-
getKey
-
onCacheMiss
- Specified by:
onCacheMiss
in interfacecom.caplin.container.impl.cache.CacheMissListener
-
getCount
public int getCount() -
getParameters
Description copied from interface:BlotterChannel
Returns the parameters for the channel
- Specified by:
getParameters
in interfaceBlotterChannel
- Returns:
- parameters for the channel
-
isLastDiscard
public boolean isLastDiscard(com.caplin.container.impl.sender.Sender sender) -
getRecordSubscriptionsOnChannel
-