|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.integration.gemfire.store.KeyValueMessageGroup
public class KeyValueMessageGroup
A MessageGroup that manipulates keys and values to provide persistence.
Responsible for managing one group's messages as a MessageGroup.
| Constructor Summary | |
|---|---|
KeyValueMessageGroup()
default javabean ctor (so that this object plays well as a Serializable object) |
|
KeyValueMessageGroup(java.lang.Object groupId)
|
|
KeyValueMessageGroup(java.lang.Object groupId,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> marked,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> unmarked)
|
|
KeyValueMessageGroup(java.lang.Object groupId,
long timestamp,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> marked,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> unmarked)
|
|
| Method Summary | |
|---|---|
void |
add(Message<?> message)
Add this Message to the
MessageGroup, delegating in this case to the unmarked field |
protected java.lang.String |
baseKey(Message<?> msg)
|
boolean |
canAdd(Message<?> message)
Query if the message can be added. |
protected boolean |
containsSequenceNumber(java.util.Collection<Message<?>> messages,
java.lang.Integer messageSequenceNumber)
|
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
getGroupId()
|
java.util.Collection<Message<?>> |
getMarked()
|
protected java.util.Collection<Message<?>> |
getMessagesForMessageGroup(java.util.Map<java.lang.String,Message<?>> region)
this method will be used to discover all the messages for a given group in a Region |
Message<?> |
getOne()
|
int |
getSequenceSize()
|
long |
getTimestamp()
|
java.util.Collection<Message<?>> |
getUnmarked()
|
protected java.lang.String |
groupKey()
the groupKey is based on the groupID and it sits at the beginning of all the keys for this MessageGroups keys |
int |
hashCode()
|
boolean |
isComplete()
|
protected boolean |
isMember(Message<?> message)
This method determines whether messages have been added to this group that supersede the given message based on its sequence id. |
void |
mark(Message<?> messageToMark)
Mark the given message in this group. |
void |
markAll()
|
protected java.lang.String |
markedKey(Message<?> msg)
the only reason we differentiate the keys is so that conceptually you could use the same Map instance for both marked and unmarked messages. |
void |
remove(Message<?> message)
Removes this Message from this MessageGroup's memory |
void |
setMarked(java.util.Map<java.lang.String,Message<?>> marked)
|
void |
setUnmarked(java.util.Map<java.lang.String,Message<?>> unmarked)
|
int |
size()
|
protected java.lang.String |
unmarkedKey(Message<?> msg)
the only reason we differentiate the keys is so that conceptually you could use the same Map instance for both marked and unmarked messages. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KeyValueMessageGroup()
Serializable object)
public KeyValueMessageGroup(java.lang.Object groupId)
public KeyValueMessageGroup(java.lang.Object groupId,
long timestamp,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> marked,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> unmarked)
public KeyValueMessageGroup(java.lang.Object groupId,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> marked,
java.util.concurrent.ConcurrentMap<java.lang.String,Message<?>> unmarked)
| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void setUnmarked(java.util.Map<java.lang.String,Message<?>> unmarked)
public void setMarked(java.util.Map<java.lang.String,Message<?>> marked)
public long getTimestamp()
getTimestamp in interface MessageGrouppublic boolean canAdd(Message<?> message)
canAdd in interface MessageGrouppublic void add(Message<?> message)
Message to the
MessageGroup, delegating in this case to the unmarked field
message - the Message you are adding to the Mapprotected java.lang.String markedKey(Message<?> msg)
Map instance for both marked and unmarked messages.
This method simply differentiates the key, building on baseKey(org.springframework.integration.Message)'s return value
msg - the Message from which the key should be generated.
protected java.lang.String unmarkedKey(Message<?> msg)
Map instance for both marked and unmarked messages.
This method simply differentiates the key, building on baseKey(org.springframework.integration.Message)'s return value
msg - the Message from which the key should be generated.
public void remove(Message<?> message)
Message from this MessageGroup's memory
message - the message to removeprotected java.lang.String groupKey()
MessageGroups keys
getGroupId()protected java.lang.String baseKey(Message<?> msg)
public java.util.Collection<Message<?>> getUnmarked()
getUnmarked in interface MessageGroupprotected java.util.Collection<Message<?>> getMessagesForMessageGroup(java.util.Map<java.lang.String,Message<?>> region)
Region
region - the region from which we're hoping to discover these Messages
public java.util.Collection<Message<?>> getMarked()
getMarked in interface MessageGrouppublic java.lang.Object getGroupId()
getGroupId in interface MessageGrouppublic boolean isComplete()
isComplete in interface MessageGrouppublic int getSequenceSize()
getSequenceSize in interface MessageGrouppublic void mark(Message<?> messageToMark)
messageToMark - the message that should be markedpublic void markAll()
public int size()
size in interface MessageGrouppublic Message<?> getOne()
getOne in interface MessageGroupprotected boolean isMember(Message<?> message)
message - the message to test for candidacy
protected boolean containsSequenceNumber(java.util.Collection<Message<?>> messages,
java.lang.Integer messageSequenceNumber)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||