ecologylab.services.distributed.impl
Class MessageWithMetadata<M extends ServiceMessage,A>

java.lang.Object
  extended by ecologylab.services.distributed.impl.MessageWithMetadata<M,A>
All Implemented Interfaces:
java.lang.Comparable<MessageWithMetadata<M,A>>

public class MessageWithMetadata<M extends ServiceMessage,A>
extends java.lang.Object
implements java.lang.Comparable<MessageWithMetadata<M,A>>

Represents a RequestMessage that has been translated to XML. This object encapsulates the XML String, along with the request's UID, SID, and a user specified Attachment;

Author:
Zachary O. Toups (toupsz@cs.tamu.edu), Bill Hamilton (bill@ecologylab.net)

Constructor Summary
MessageWithMetadata()
           
MessageWithMetadata(M response)
           
MessageWithMetadata(M response, long uid)
           
MessageWithMetadata(M response, long uid, A attachment)
           
 
Method Summary
 void clear()
          Resets this for re-use.
 int compareTo(MessageWithMetadata<M,A> arg0)
           
 A getAttachment()
           
 M getMessage()
           
 long getUid()
           
 void setAttachment(A attachment)
           
 void setMessage(M response)
           
 void setUid(long uid)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageWithMetadata

public MessageWithMetadata(M response,
                           long uid,
                           A attachment)

MessageWithMetadata

public MessageWithMetadata(M response,
                           long uid)

MessageWithMetadata

public MessageWithMetadata(M response)

MessageWithMetadata

public MessageWithMetadata()
Method Detail

clear

public void clear()
Resets this for re-use.


getMessage

public M getMessage()
Returns:
the request

setMessage

public void setMessage(M response)

getUid

public long getUid()
Returns:
the uid

getAttachment

public A getAttachment()
Returns:
the attachment

compareTo

public int compareTo(MessageWithMetadata<M,A> arg0)
Specified by:
compareTo in interface java.lang.Comparable<MessageWithMetadata<M extends ServiceMessage,A>>

setUid

public void setUid(long uid)
Parameters:
uid - the uid to set

setAttachment

public void setAttachment(A attachment)
Parameters:
attachment - the attachment to set