Interface BlotterChannel
- All Known Subinterfaces:
BlotterChannelInternal
- All Known Implementing Classes:
BlotterChannelImpl
BlotterItems. It enters your application through the
BlotterApplicationListener.blotterChannelOpened(com.caplin.datasource.blotter.BlotterChannel) method and includes methods such as
sendBlotterItem(com.caplin.datasource.blotter.BlotterItem) for populating the BlotterChannel with items.-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears allBlotterItems from the internal cache and sends a container clear so that these items are no longer requested when the channel is subscribed to.voidCloses the channel.Returns the parameters for the channelReturns the subject for the channel.Returns the username for the channelvoidremoveBlotterItem(String uniqueId) Removes theBlotterItemfrom the internal cache and sends a container remove so that this item is no longer requested when the channel is subscribed to.voidremoveBlotterItems(List<String> uniqueIds) RemovesBlotterItems from the internal cache and sends a container remove so that these items are no longer requested when the channel is subscribed to.voidsendBlotterItem(BlotterItem item) Adds theBlotterItemto the internal cache and sends a container add so that this item is requested when the channel is subscribed to.voidsendBlotterItemNotFound(String uniqueId) Sends a not found for aBlotterItem.voidsendBlotterItems(List<BlotterItem> items) AddsBlotterItems to the internal cache and sends a container add so that these items are requested when the channel is subscribed to.voidsendBlotterItemStatusOk(String uniqueId) Send status ok for aBlotterItem.voidsendBlotterItemStatusStale(String uniqueId) Send status stale for aBlotterItem.voidsendBlotterMapping(String newSubject) Sends aMappingMessageto the Liberator, requesting that the Liberator map thisBlotterChannelinstance's subject to the specified subjectnewSubject.voidSends a status ok on the channel.voidsendBlotterStatusOk(String message) Sends a status ok on the channel with custom message.voidSends a status stale on the channel.voidsendBlotterStatusStale(String message) Sends a status stale on the channel with custom message.voidSends an empty container on the channel.voidSets aBlotterChannelListeneron the channel.
-
Method Details
-
closeChannel
void closeChannel()Closes the channel.Sends a Subject Not Found on the channel's subject to let subscribers know that it is no longer serviced.
-
getSubject
String getSubject()Returns the subject for the channel.- Returns:
- subject for the channel
-
getUsername
String getUsername()Returns the username for the channel- Returns:
- username for the channel
-
getParameters
String getParameters()Returns the parameters for the channel- Returns:
- parameters for the channel
-
removeBlotterItem
Removes theBlotterItemfrom the internal cache and sends a container remove so that this item is no longer requested when the channel is subscribed to.- Parameters:
uniqueId- of the item to remove
-
removeBlotterItems
RemovesBlotterItems from the internal cache and sends a container remove so that these items are no longer requested when the channel is subscribed to.- Parameters:
uniqueIds- of the items to remove
-
clear
void clear()Clears allBlotterItems from the internal cache and sends a container clear so that these items are no longer requested when the channel is subscribed to. -
sendBlotterItem
Adds theBlotterItemto 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.
- Parameters:
item- to send
-
sendBlotterItemNotFound
Sends a not found for aBlotterItem.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.Should not be used with List data types.
- Parameters:
uniqueId- of item that cannot be serviced by your application.
-
sendBlotterItems
AddsBlotterItems 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.
- Parameters:
items- to send
-
sendBlotterMapping
Sends aMappingMessageto the Liberator, requesting that the Liberator map thisBlotterChannelinstance's subject to the specified subjectnewSubject.Note: Liberator applies mapping rules configured by mapping messages after it applies mapping rules configured by
object-mapconfig 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 callsendBlotterMapping(java.lang.String), passing it the subject of the group's blotter.- Parameters:
newSubject- the subject to map this blotter's subject to
-
sendBlotterItemStatusOk
Send status ok for aBlotterItem.Under normal circumstances this method is not used.
Should not be used with List data types.
- Parameters:
uniqueId- of the message whose status is OK
-
sendBlotterItemStatusStale
Send status stale for aBlotterItem.Under normal circumstances this method is not used.
Should not be used with List data types.
- Parameters:
uniqueId- of the message whose status is STALE
-
sendBlotterStatusOk
void sendBlotterStatusOk()Sends a status ok on the channel.Under normal circumstances this method is not used.
-
sendBlotterStatusStale
Sends a status stale on the channel with custom message.Under normal circumstances this method is not used.
-
sendBlotterStatusOk
Sends a status ok on the channel with custom message.Under normal circumstances this method is not used.
-
sendBlotterStatusStale
void sendBlotterStatusStale()Sends a status stale on the channel.Under normal circumstances this method is not used.
-
sendEmptyBlotter
void sendEmptyBlotter()Sends an empty container on the channel.Invoke when a
BlotterApplicationListener.blotterChannelOpened(com.caplin.datasource.blotter.BlotterChannel)callback is received and there are currently noBlotterItems 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 -
setBlotterChannelListener
Sets aBlotterChannelListeneron the channel.Specifically for the case where there is more than one Integration Adapter providing for the same channel subject.
See
BlotterConfigurationfor how to configure for this eventuality.Should not be used with List data types.
- Parameters:
listener- to receive requests for items not already cached by the BlotterAPI
-