JXTA

net.jxta.impl.protocol
Class LimitedRangeRdvMsg

java.lang.Object
  extended by net.jxta.impl.protocol.LimitedRangeRdvMsg

public class LimitedRangeRdvMsg
extends Object

The LimitedRangeRdv walk header message.


 <xs:simpleType name="WalkDirection">
   <xs:restriction base="xs:unsignedInt">
     <!-- UP -->
     <xs:enumeration value="1" />
     <!-- DOWN -->
     <xs:enumeration value="2" />
     <!-- BOTH -->
     <xs:enumeration value="3" />
   </xs:restriction>
 </xs:simpleType>
 

<xs:complexType name="LimitedRangeRdvMessage"> <xs:sequence> <xs:element name="TTL" type="xs:unsignedInt" /> <xs:element name="Dir" type="jxta:WalkDirection" /> <xs:element name="SrcPeerID" type="jxta:JXTAID" /> <xs:element name="SrcSvcName" type="xs:string" /> <xs:element name="SrcSvcParams" minOccurs="0" type="xs:string" /> </xs:sequence> </xs:complexType>

Since:
JXTA 2.0
See Also:
LimitedRangeWalk, LimitedRangeWalker, LimitedRangeGreeter

Nested Class Summary
static class LimitedRangeRdvMsg.WalkDirection
          Enumeration of possible walk directions.
 
Constructor Summary
LimitedRangeRdvMsg()
          Constructor
LimitedRangeRdvMsg(Element root)
          Construct from a StructuredDocument
 
Method Summary
 LimitedRangeRdvMsg clone()
          
 LimitedRangeRdvMsg.WalkDirection getDirection()
          Get the direction the message will take
 Document getDocument(MimeMediaType mediaType)
           
static String getMessageType()
          Our DOCTYPE
 ID getSrcPeerID()
          Get the Source PeerID (walk originiator)
 String getSrcSvcName()
          Get the Source Service Name (listening for the response)
 String getSrcSvcParams()
          Get the Source Service Param (listening for the response)
 int getTTL()
          Get the TTL
protected  boolean handleElement(XMLElement elem)
          Process an individual element from the document during parse.
 void setDirection(LimitedRangeRdvMsg.WalkDirection dir)
          Set the direction the message will take
 void setSrcPeerID(ID srcPeerID)
          Set the Source PeerID (walk originiator)
 void setSrcSvcName(String srcSvcName)
          Set the Source Service Name (listening for the response)
 void setSrcSvcParams(String srcSvcParams)
          Set the Source Service Params (listening for the response)
 void setTTL(int ttl)
          set the TTL
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedRangeRdvMsg

public LimitedRangeRdvMsg()
Constructor


LimitedRangeRdvMsg

public LimitedRangeRdvMsg(Element root)
Construct from a StructuredDocument

Parameters:
root - the element
Method Detail

clone

public LimitedRangeRdvMsg clone()

Overrides:
clone in class Object

getTTL

public int getTTL()
Get the TTL

Returns:
Time To Live

setTTL

public void setTTL(int ttl)
set the TTL

Parameters:
ttl - TTL

getDirection

public LimitedRangeRdvMsg.WalkDirection getDirection()
Get the direction the message will take

Returns:
UP, DOWN or BOTH

setDirection

public void setDirection(LimitedRangeRdvMsg.WalkDirection dir)
Set the direction the message will take

Parameters:
dir - direction

getSrcSvcName

public String getSrcSvcName()
Get the Source Service Name (listening for the response)

Returns:
Source Service Name

setSrcSvcName

public void setSrcSvcName(String srcSvcName)
Set the Source Service Name (listening for the response)

Parameters:
srcSvcName - Source Service Name

getSrcSvcParams

public String getSrcSvcParams()
Get the Source Service Param (listening for the response)

Returns:
Source Service Param

setSrcSvcParams

public void setSrcSvcParams(String srcSvcParams)
Set the Source Service Params (listening for the response)

Parameters:
srcSvcParams - Source Service Params

getSrcPeerID

public ID getSrcPeerID()
Get the Source PeerID (walk originiator)

Returns:
Source PeerID

setSrcPeerID

public void setSrcPeerID(ID srcPeerID)
Set the Source PeerID (walk originiator)

Parameters:
srcPeerID - Source PeerID

getMessageType

public static String getMessageType()
Our DOCTYPE

Returns:
the type of this message.

handleElement

protected boolean handleElement(XMLElement elem)
Process an individual element from the document during parse. Normally, implementations will allow the base advertisments a chance to handle the element before attempting ot handle the element themselves. ie.


  protected boolean handleElement( Element elem ) {
 

if ( super.handleElement() ) { // it's been handled. return true; }

... handle elements here ...

// we don't know how to handle the element return false; }

Parameters:
elem - the element to be processed.
Returns:
true if the element was recognized, otherwise false.

getDocument

public Document getDocument(MimeMediaType mediaType)

JXSE