public class SimpleMessageGroup extends java.lang.Object implements MessageGroup
MessageStore
and group id. The
group will grow during its lifetime, when messages are add
ed to it. This MessageGroup is thread safe.Modifier and Type | Field and Description |
---|---|
java.util.concurrent.BlockingQueue<Message<?>> |
messages |
Constructor and Description |
---|
SimpleMessageGroup(java.util.Collection<? extends Message<?>> messages,
java.lang.Object groupId) |
SimpleMessageGroup(java.util.Collection<? extends Message<?>> messages,
java.lang.Object groupId,
long timestamp,
boolean complete) |
SimpleMessageGroup(MessageGroup messageGroup) |
SimpleMessageGroup(java.lang.Object groupId) |
Modifier and Type | Method and Description |
---|---|
void |
add(Message<?> message) |
boolean |
canAdd(Message<?> message)
Query if the message can be added.
|
void |
clear() |
void |
complete() |
java.lang.Object |
getGroupId() |
long |
getLastModified() |
int |
getLastReleasedMessageSequenceNumber()
Returns the sequenceNumber of the last released message.
|
java.util.Collection<Message<?>> |
getMessages()
Returns all available Messages from the group at the time of invocation
|
Message<?> |
getOne() |
int |
getSequenceSize() |
long |
getTimestamp() |
boolean |
isComplete() |
void |
remove(Message<?> message) |
void |
setLastModified(long lastModified) |
void |
setLastReleasedMessageSequenceNumber(int sequenceNumber) |
int |
size() |
java.lang.String |
toString() |
public final java.util.concurrent.BlockingQueue<Message<?>> messages
public SimpleMessageGroup(java.lang.Object groupId)
public SimpleMessageGroup(java.util.Collection<? extends Message<?>> messages, java.lang.Object groupId)
public SimpleMessageGroup(java.util.Collection<? extends Message<?>> messages, java.lang.Object groupId, long timestamp, boolean complete)
public SimpleMessageGroup(MessageGroup messageGroup)
public long getTimestamp()
getTimestamp
in interface MessageGroup
public void setLastModified(long lastModified)
public long getLastModified()
getLastModified
in interface MessageGroup
public boolean canAdd(Message<?> message)
MessageGroup
canAdd
in interface MessageGroup
public void add(Message<?> message)
public void remove(Message<?> message)
public int getLastReleasedMessageSequenceNumber()
MessageGroup
getLastReleasedMessageSequenceNumber
in interface MessageGroup
public java.util.Collection<Message<?>> getMessages()
MessageGroup
getMessages
in interface MessageGroup
public void setLastReleasedMessageSequenceNumber(int sequenceNumber)
public java.lang.Object getGroupId()
getGroupId
in interface MessageGroup
public boolean isComplete()
isComplete
in interface MessageGroup
public void complete()
complete
in interface MessageGroup
public int getSequenceSize()
getSequenceSize
in interface MessageGroup
public int size()
size
in interface MessageGroup
public Message<?> getOne()
getOne
in interface MessageGroup
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object