Package com.atlassian.jira.cluster
Class OfBizClusterMessageStore
java.lang.Object
com.atlassian.jira.cluster.OfBizClusterMessageStore
Responsible for storing and retrieving cluster messages in the underlying database.
- Since:
- v6.1
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMessage(String sourceNode, String destinationNode, String message) Creates a ClusterMessage and stores it in the underlying databaseintdeleteByIds(List<Long> ids) intdeleteMessage(ClusterMessage clusterMessage) intdeleteMessagesBefore(Date before) getIdsBefore(Timestamp cutoffTime, int limit) getLatestMessageByNodeId(String nodeId) Get the id of the latest message in the store for a node..getMessages(Node sourceNode, Node destinationNode, Long afterMessageId) Retrieves the messages destined for the given node, from a source node.org.ofbiz.core.entity.GenericValuestoreMessage(ClusterMessage message) Stores the message in the underlying database.
-
Field Details
-
DESTINATION_NODE
- See Also:
-
ENTITY
- See Also:
-
ID
- See Also:
-
MESSAGE
- See Also:
-
SOURCE_NODE
- See Also:
-
CLAIMED_BY_NODE
- See Also:
-
MESSAGE_TIME
- See Also:
-
-
Constructor Details
-
OfBizClusterMessageStore
-
-
Method Details
-
storeMessage
Stores the message in the underlying database.- Parameters:
message- - the message to store in the underlying table
-
createMessage
public ClusterMessage createMessage(@Nonnull String sourceNode, @Nonnull String destinationNode, @Nonnull String message) Creates a ClusterMessage and stores it in the underlying database- Parameters:
sourceNode- the ID of the source node (required)destinationNode- the ID of the destination node (required)message- the message to send (required)
-
getMessages
Retrieves the messages destined for the given node, from a source node. Returns messages with either the specific node id, or destined for all, but they must have been sent from another node - no listening to your own messages. We process each source node separately because the message Ids are not monotonically increasing across nodes.- Parameters:
sourceNode- The sending nodedestinationNode- The listening nodeafterMessageId- Only messages with a higher Message Id than this id will be returned. If starting beyond is null will return all messages for the source destinationNode pair.- Returns:
- a non-null list
-
deleteMessage
-
getLatestMessageByNodeId
Get the id of the latest message in the store for a node.. That is the message with the highest id or null if there are no messages.- Parameters:
nodeId- the id of the node.- Returns:
- the id of the latest message in the store.
-
deleteMessagesBefore
-
getIdsBefore
-
deleteByIds
-