restgroupsClient
Class RestGroupsMessage

java.lang.Object
  extended by restgroupsClient.RestGroupsMessage
All Implemented Interfaces:
java.lang.Cloneable

public class RestGroupsMessage
extends java.lang.Object
implements java.lang.Cloneable

Class representation of RestGroups messages.

Author:
tkob

Constructor Summary
RestGroupsMessage()
          Default constructor.
RestGroupsMessage(org.jdom.Element element)
          Creates an instance from given XML 'message' element.
 
Method Summary
 java.lang.Object clone()
           
 boolean fromXml(org.jdom.Element messageElement)
          Extracts fields values from given 'message' XML element.
 byte[] getData()
          Returns the message's payload.
 boolean getEndianMismatch()
          Returns the message's endian mismatch.
 java.util.List<java.lang.String> getGroups()
          Returns the message's addresses
 RestGroupsMessageMembershipInfo getMembershipInfo()
          Returns the message's membershipInfo.
 RestGroupsMessageGuarantee getMessageGuarantee()
          Returns the message's guarantee.
 RestGroupsMessageType getMessageType()
          Returns the message's type.
 java.lang.String getSender()
          Returns the message's sender.
 short getType()
          Returns the message's type (label).
 void setData(byte[] data)
          Sets the message's payload.
 void setEndianMismatch(boolean endianMismatch)
          Sets the message's endian mismatch.
 void setGroups(java.util.List<java.lang.String> groups)
          Sets the message's addressees.
 void setMembershipInfo(RestGroupsMessageMembershipInfo membershipInfo)
          Sets the message's membershipInfo object.
 void setMessageGuarantee(RestGroupsMessageGuarantee guarantee)
          Sets the message's guarantee.
 void setMessageType(RestGroupsMessageType messageType)
          Sets the message's type.
 void setSender(java.lang.String sender)
          Sets the message's type.
 void setType(short type)
          Sets the message's type (label).
 org.jdom.Element toXml()
          Serializes this object to the XML format.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestGroupsMessage

public RestGroupsMessage()
Default constructor.


RestGroupsMessage

public RestGroupsMessage(org.jdom.Element element)
Creates an instance from given XML 'message' element.

Parameters:
element - 'message' XML element
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

fromXml

public boolean fromXml(org.jdom.Element messageElement)
Extracts fields values from given 'message' XML element.

Parameters:
messageElement - 'message' XML element
Returns:
true on success, false otherwise

toXml

public org.jdom.Element toXml()
Serializes this object to the XML format.

Returns:
this object serialized to the XML format

setMessageType

public void setMessageType(RestGroupsMessageType messageType)
Sets the message's type.

Parameters:
messageType - new message's type

getMessageType

public RestGroupsMessageType getMessageType()
Returns the message's type.

Returns:
message's type

setSender

public void setSender(java.lang.String sender)
Sets the message's type.

Parameters:
sender - new message's type

getSender

public java.lang.String getSender()
Returns the message's sender.

Returns:
the message's sender

setMessageGuarantee

public void setMessageGuarantee(RestGroupsMessageGuarantee guarantee)
Sets the message's guarantee.

Parameters:
guarantee - new message's guarantee

getMessageGuarantee

public RestGroupsMessageGuarantee getMessageGuarantee()
Returns the message's guarantee.

Returns:
the message's guarantee

setGroups

public void setGroups(java.util.List<java.lang.String> groups)
Sets the message's addressees.

Parameters:
groups - the new message's addressees

getGroups

public java.util.List<java.lang.String> getGroups()
Returns the message's addresses

Returns:
the message's addresses

setData

public void setData(byte[] data)
Sets the message's payload.

Parameters:
data - the new message's payload

getData

public byte[] getData()
Returns the message's payload.

Returns:
the message's payload

setType

public void setType(short type)
Sets the message's type (label).

Parameters:
type - the new message's type

getType

public short getType()
Returns the message's type (label).

Returns:
the message's type.

setEndianMismatch

public void setEndianMismatch(boolean endianMismatch)
Sets the message's endian mismatch.

Parameters:
endianMismatch - the message's endian mismatch

getEndianMismatch

public boolean getEndianMismatch()
Returns the message's endian mismatch.

Returns:
the message's endian mismatch

setMembershipInfo

public void setMembershipInfo(RestGroupsMessageMembershipInfo membershipInfo)
Sets the message's membershipInfo object.

Parameters:
membershipInfo - the new message's membershipInfo object

getMembershipInfo

public RestGroupsMessageMembershipInfo getMembershipInfo()
Returns the message's membershipInfo.

Returns:
the message's membershipInfo.