|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectguarana.framework.message.Header
public class Header
Represents the header of a Message
.
- The default message type is EVENT_MESSAGE
Field Summary | |
---|---|
String |
CORRELATION_ID
The universal identifier that indicates to which request message a reply is for. |
long |
EXPIRATION_DATE
The date when the message expires, potentially turning it into an 'invalid' message. |
String |
MESSAGE_ID
The message ID. |
MessagePriority |
PRIORITY
Establishes the priority of this message. |
String |
RETURN_ADDRESS
Identifier that indicates where to deliver the reply message. |
int |
SEQUENCE_NUMBER
The number which identifies the child message within a sequence. |
int |
SEQUENCE_SIZE
The total number of child messages from a split parent message into a sequence of messages. |
static long |
serialVersionUID
|
MessageType |
TYPE
The type which describes the 'intention' of this message. |
Constructor Summary | |
---|---|
Header()
Constructs a new Header. |
Method Summary | |
---|---|
void |
addAllDynamicAttributes(Map<String,Object> attributes)
Adds several dynamic attributes at once. |
void |
addCorrelationIDValue(String correlationID)
Adds a correlation ID value to the list of correlation id values this message has. |
Object |
addDynamicAttribute(String name,
Object value)
Adds a dynamic attribute to the header. |
void |
addSequenceNumberValue(int sequenceNumber)
Adds a sequence number value to the list of sequence number values this message has. |
void |
addSequenceSizeValue(int sequenceSize)
Adds a sequence size value to the list of sequence size values this message has. |
Header |
copy()
Creates a copy of this header. |
Map<String,Object> |
getAllDynamicAttributes()
Returns all dynamic attributes from the header. |
Object |
getDynamicAttribute(String name)
Returns the value of an specific dynamic attribute. |
Set<Parent> |
getParents()
Returns all parents of this message. |
String |
pollCorrelationIDValue()
Polls the last correlation ID from the list of values. |
int |
pollSequenceNumberValue()
Polls the last sequence number value from the list. |
int |
pollSequenceSizeValue()
Polls the last sequence size value from the list. |
Object |
removeDynamicAttribute(String name)
Removes a dynamic attribute from the header. |
void |
removeParents()
Removes all parents from this message. |
void |
setParents(Set<Parent> parents)
Sets all ancestors for this message. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
public String MESSAGE_ID
4190888b-fe50-42d6-83d9-4b6241d92920
(an example of message ID).
public MessageType TYPE
MessageType
public MessagePriority PRIORITY
MessagePriority
public int SEQUENCE_SIZE
public int SEQUENCE_NUMBER
public String CORRELATION_ID
public String RETURN_ADDRESS
public long EXPIRATION_DATE
Constructor Detail |
---|
public Header()
Method Detail |
---|
public Object addDynamicAttribute(String name, Object value)
name
- The name which uniquely identifies the attribute in the header.value
- The value of the attribute.
public Object removeDynamicAttribute(String name)
name
- The name of the attribute to remove.
public Object getDynamicAttribute(String name)
name
- The name of the attribute.
public void addAllDynamicAttributes(Map<String,Object> attributes)
attributes
- the attributes to add.public Map<String,Object> getAllDynamicAttributes()
public void removeParents()
public Set<Parent> getParents()
public void setParents(Set<Parent> parents)
parents
- The set of ancestors.public void addCorrelationIDValue(String correlationID)
correlationID
- The correlation IDpublic String pollCorrelationIDValue()
null
if it has polled the last value.
null
if the list is empty()public void addSequenceSizeValue(int sequenceSize)
sequenceSize
- The sequence size.public int pollSequenceSizeValue()
-1
if it has polled the last value.
Sequence size is always greater than zero.
-1
if the list is empty().public void addSequenceNumberValue(int sequenceNumber)
sequenceNumber
- The sequence number.public int pollSequenceNumberValue()
-1
if it has polled the last value.
Sequence numbers are always greater than zero.
-1
if the list is empty().public Header copy()
null
if the header could not be copied.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |