org.softamis.net.exchange.support
Class MessageContent<K extends java.io.Serializable,V extends java.io.Serializable,A extends java.io.Serializable>

java.lang.Object
  extended by org.softamis.net.exchange.support.MessageContent<K,V,A>
Type Parameters:
K - type of keys used to identify registry items
V - type of values stored in the registry

public class MessageContent<K extends java.io.Serializable,V extends java.io.Serializable,A extends java.io.Serializable>
extends java.lang.Object

Class that represents internal data that is sent as network notification. Data stored in this class will be transfered by network in serializable form (which could be obtained via proper implementation of CommunicationProtocol

Author:
Andrew Sazonov
See Also:
CommunicationProtocol

Field Summary
protected  A fFrom
          Origin of the message
protected  ItemEntry<K,V> fItemEntry
          Data for item
protected  byte fMessageType
          Type of message
protected  java.lang.String fSignature
          Signature of notification used to determine whether this is own notification
protected  A fTo
          Destination of the message
 
Constructor Summary
MessageContent()
           
MessageContent(java.lang.String aSignature)
           
 
Method Summary
protected  boolean equals(java.lang.String aFirst, java.lang.String aSecond)
           
 A getFrom()
          Returns origin of the message
 ItemEntry<K,V> getItemEntry()
          Returns data for item
 byte getMessageType()
          Returns type of notification
 java.lang.String getSignature()
          Returns signature of notification used to determine whether this is own notification
 A getTo()
          Returns destination of the message
protected  boolean isAcceptSignature(java.lang.String aSignature)
           
protected  void readContent(java.io.ObjectInput aIn)
           
 boolean readExternal(java.io.ObjectInput aIn)
           
 void setFrom(A aFrom)
          Sets origin of the message
 void setItemEntry(ItemEntry<K,V> aItemEntry)
          Sets data for item
 void setMessageType(byte aMessageType)
          Sets type of notification
 void setSignature(java.lang.String aSignature)
          Sets signature of notification used to determine whether this is own notification
 void setTo(A aTo)
          Sets destination of the message
 void writeExternal(java.io.ObjectOutput aOut)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fMessageType

protected byte fMessageType
Type of message

See Also:
CommunicationHelper

fTo

protected A extends java.io.Serializable fTo
Destination of the message


fFrom

protected A extends java.io.Serializable fFrom
Origin of the message


fSignature

protected java.lang.String fSignature
Signature of notification used to determine whether this is own notification


fItemEntry

protected ItemEntry<K extends java.io.Serializable,V extends java.io.Serializable> fItemEntry
Data for item

Constructor Detail

MessageContent

public MessageContent()

MessageContent

public MessageContent(java.lang.String aSignature)
Method Detail

getMessageType

public byte getMessageType()
Returns type of notification

Returns:
type of message

setMessageType

public void setMessageType(byte aMessageType)
Sets type of notification

Parameters:
aMessageType - type of message

getItemEntry

public ItemEntry<K,V> getItemEntry()
Returns data for item

Returns:
data for item

setItemEntry

public void setItemEntry(ItemEntry<K,V> aItemEntry)
Sets data for item

Parameters:
aItemEntry - data for item

getTo

public A getTo()
Returns destination of the message

Returns:
destination of the message

setTo

public void setTo(A aTo)
Sets destination of the message

Parameters:
aTo - destination of the message

getFrom

public A getFrom()
Returns origin of the message

Returns:
origin of the message

setFrom

public void setFrom(A aFrom)
Sets origin of the message

Parameters:
aFrom - origin of the message

getSignature

public java.lang.String getSignature()
Returns signature of notification used to determine whether this is own notification

Returns:
signature

setSignature

public void setSignature(java.lang.String aSignature)
Sets signature of notification used to determine whether this is own notification

Parameters:
aSignature - signature

writeExternal

public void writeExternal(java.io.ObjectOutput aOut)
                   throws java.io.IOException
Throws:
java.io.IOException

readExternal

public boolean readExternal(java.io.ObjectInput aIn)
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

isAcceptSignature

protected boolean isAcceptSignature(java.lang.String aSignature)

equals

protected boolean equals(java.lang.String aFirst,
                         java.lang.String aSecond)

readContent

protected void readContent(java.io.ObjectInput aIn)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException