Class OfBizClusterMessageStore

java.lang.Object
com.atlassian.jira.cluster.OfBizClusterMessageStore

public class OfBizClusterMessageStore extends Object
Responsible for storing and retrieving cluster messages in the underlying database.
Since:
v6.1
  • Field Details

  • Constructor Details

    • OfBizClusterMessageStore

      public OfBizClusterMessageStore(OfBizDelegator ofBizDelegator)
  • Method Details

    • storeMessage

      public org.ofbiz.core.entity.GenericValue storeMessage(@Nonnull ClusterMessage message)
      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

      public List<ClusterMessage> getMessages(Node sourceNode, Node destinationNode, Long afterMessageId)
      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 node
      destinationNode - The listening node
      afterMessageId - 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

      public int deleteMessage(ClusterMessage clusterMessage)
    • getLatestMessageByNodeId

      public Long getLatestMessageByNodeId(String nodeId)
      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

      public int deleteMessagesBefore(Date before)
    • getIdsBefore

      public List<Long> getIdsBefore(Timestamp cutoffTime, int limit)
    • deleteByIds

      public int deleteByIds(List<Long> ids)