public class SimpleMessageGroup extends java.lang.Object implements MessageGroup
MessageStore and group id.
The group will grow during its lifetime, when messages are added to it.
This MessageGroup is thread safe.| Constructor and Description |
|---|
SimpleMessageGroup(java.util.Collection<? extends org.springframework.messaging.Message<?>> messages,
java.lang.Object groupId) |
SimpleMessageGroup(java.util.Collection<? extends org.springframework.messaging.Message<?>> messages,
java.lang.Object groupId,
long timestamp,
boolean complete) |
SimpleMessageGroup(java.util.Collection<org.springframework.messaging.Message<?>> internalStore,
java.util.Collection<? extends org.springframework.messaging.Message<?>> messages,
java.lang.Object groupId,
long timestamp,
boolean complete,
boolean storePreLoaded) |
SimpleMessageGroup(MessageGroup messageGroup) |
SimpleMessageGroup(java.lang.Object groupId) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.springframework.messaging.Message<?> messageToAdd)
Add the message to this group.
|
boolean |
canAdd(org.springframework.messaging.Message<?> message)
Query if the message can be added.
|
void |
clear() |
void |
complete()
Complete the group.
|
boolean |
containsSequence(java.lang.Integer sequence)
Return true if a message with this sequence number header exists in
the group.
|
java.lang.Object |
getGroupId() |
long |
getLastModified() |
int |
getLastReleasedMessageSequenceNumber() |
java.util.Collection<org.springframework.messaging.Message<?>> |
getMessages()
Returns all available Messages from the group at the time of invocation
|
org.springframework.messaging.Message<?> |
getOne() |
int |
getSequenceSize() |
long |
getTimestamp() |
boolean |
isComplete() |
boolean |
remove(org.springframework.messaging.Message<?> message)
Remove the message from this group.
|
void |
setLastModified(long lastModified) |
void |
setLastReleasedMessageSequenceNumber(int sequenceNumber) |
int |
size() |
java.lang.String |
toString() |
public SimpleMessageGroup(java.lang.Object groupId)
public SimpleMessageGroup(java.util.Collection<? extends org.springframework.messaging.Message<?>> messages,
java.lang.Object groupId)
public SimpleMessageGroup(MessageGroup messageGroup)
public SimpleMessageGroup(java.util.Collection<? extends org.springframework.messaging.Message<?>> messages,
java.lang.Object groupId,
long timestamp,
boolean complete)
public SimpleMessageGroup(java.util.Collection<org.springframework.messaging.Message<?>> internalStore,
java.util.Collection<? extends org.springframework.messaging.Message<?>> messages,
java.lang.Object groupId,
long timestamp,
boolean complete,
boolean storePreLoaded)
public long getTimestamp()
getTimestamp in interface MessageGrouppublic void setLastModified(long lastModified)
setLastModified in interface MessageGrouppublic long getLastModified()
getLastModified in interface MessageGrouppublic boolean canAdd(org.springframework.messaging.Message<?> message)
MessageGroupcanAdd in interface MessageGroupmessage - The message.public void add(org.springframework.messaging.Message<?> messageToAdd)
MessageGroupadd in interface MessageGroupmessageToAdd - the message to add.public boolean remove(org.springframework.messaging.Message<?> message)
MessageGroupremove in interface MessageGroupmessage - the message to remove.true if a message was removed.public int getLastReleasedMessageSequenceNumber()
getLastReleasedMessageSequenceNumber in interface MessageGrouppublic java.util.Collection<org.springframework.messaging.Message<?>> getMessages()
MessageGroupgetMessages in interface MessageGrouppublic void setLastReleasedMessageSequenceNumber(int sequenceNumber)
setLastReleasedMessageSequenceNumber in interface MessageGrouppublic java.lang.Object getGroupId()
getGroupId in interface MessageGrouppublic boolean isComplete()
isComplete in interface MessageGrouppublic void complete()
MessageGroupcomplete in interface MessageGrouppublic int getSequenceSize()
getSequenceSize in interface MessageGrouppublic int size()
size in interface MessageGrouppublic org.springframework.messaging.Message<?> getOne()
getOne in interface MessageGrouppublic void clear()
clear in interface MessageGrouppublic boolean containsSequence(java.lang.Integer sequence)
sequence - the sequence number.public java.lang.String toString()
toString in class java.lang.Object