Project JXTA

net.jxta.impl.protocol
Class SrdiMessageImpl

java.lang.Object
  extended bynet.jxta.protocol.SrdiMessage
      extended bynet.jxta.impl.protocol.SrdiMessageImpl

public class SrdiMessageImpl
extends SrdiMessage

SrdiMessageImpl provides the SRDI message binding


Nested Class Summary
 
Nested classes inherited from class net.jxta.protocol.SrdiMessage
SrdiMessage.Entry
 
Field Summary
static String entryTag
          Entry element name
static String expirationTag
          Expiration element name
static String pidTag
          PeerID element name
static String pKeyTag
          Primary Key element name
static String sKeyTag
          Secondary Key element name
static String ttlTag
          ttl element name
static String valTag
          Value element name
 
Constructor Summary
SrdiMessageImpl()
          Construct an empty doc
SrdiMessageImpl(Element root)
          Construct from a StructuredDocument
SrdiMessageImpl(InputStream stream)
          Deprecated. It's better to generate the document yourself. This method cannot deduce the mime type of the content.
SrdiMessageImpl(PeerID peerid, int ttl, String pKey, List entries)
          Construct a msg from entries
SrdiMessageImpl(PeerID peerid, int ttl, String pKey, String key, String value, long expiration)
          Construct a msg consisting of a single entry
SrdiMessageImpl(String peerid, int ttl, String pKey, List entries)
          Construct a doc from vectors of strings
 
Method Summary
 Document getDocument(MimeMediaType encodeAs)
          return a Document representation of this object
 void readIt(XMLElement doc)
           
 String toString()
          returns the document string representation of this object
 
Methods inherited from class net.jxta.protocol.SrdiMessage
addEntry, addEntry, decrementTTL, getEntries, getMessageType, getPeerID, getPrimaryKey, getTTL, setEntries, setPeerID, setPrimaryKey, setTTL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pidTag

public static final String pidTag
PeerID element name

See Also:
Constant Field Values

ttlTag

public static final String ttlTag
ttl element name

See Also:
Constant Field Values

entryTag

public static final String entryTag
Entry element name

See Also:
Constant Field Values

pKeyTag

public static final String pKeyTag
Primary Key element name

See Also:
Constant Field Values

sKeyTag

public static final String sKeyTag
Secondary Key element name

See Also:
Constant Field Values

valTag

public static final String valTag
Value element name

See Also:
Constant Field Values

expirationTag

public static final String expirationTag
Expiration element name

See Also:
Constant Field Values
Constructor Detail

SrdiMessageImpl

public SrdiMessageImpl()
Construct an empty doc


SrdiMessageImpl

public SrdiMessageImpl(InputStream stream)
                throws IOException
Deprecated. It's better to generate the document yourself. This method cannot deduce the mime type of the content.

Construct a doc from InputStream

Parameters:
stream - the underlying input stream.
Throws:
IOException - if an I/O error occurs.

SrdiMessageImpl

public SrdiMessageImpl(Element root)
Construct from a StructuredDocument

Parameters:
root - the underlying document

SrdiMessageImpl

public SrdiMessageImpl(PeerID peerid,
                       int ttl,
                       String pKey,
                       List entries)
Construct a msg from entries

Parameters:
peerid - PeerID associated with this message
ttl - TTL
pKey - primary key
entries - the entries for this message

SrdiMessageImpl

public SrdiMessageImpl(PeerID peerid,
                       int ttl,
                       String pKey,
                       String key,
                       String value,
                       long expiration)
Construct a msg consisting of a single entry

Parameters:
peerid - PeerID associated with this message
ttl - TTL
pKey - primary key
key - the secondary key
value - value for the key
expiration - expirations for this entry

SrdiMessageImpl

public SrdiMessageImpl(String peerid,
                       int ttl,
                       String pKey,
                       List entries)
Construct a doc from vectors of strings

Parameters:
peerid - PeerID associated with this message
ttl - TTL
pKey - primary key
entries - the entries for this message
Method Detail

readIt

public void readIt(XMLElement doc)
Parameters:
doc -

getDocument

public Document getDocument(MimeMediaType encodeAs)
return a Document representation of this object

Parameters:
encodeAs -
Returns:
document represtation of this object

toString

public String toString()
returns the document string representation of this object

Returns:
String representation of the of this message type

JXTA J2SE