Project JXTA

net.jxta.protocol
Class PipeResolverMessage

java.lang.Object
  extended by net.jxta.protocol.PipeResolverMessage

public abstract class PipeResolverMessage
extends Object

This abstract class defines the PipeResolver Message.

This message is part of the Pipe Resolver Protocol.

See Also:
PipeService, PipeAdvertisement, JXTA Protocols Specification : Standard JXTA Protocols

Nested Class Summary
static class PipeResolverMessage.MessageType
          An enumeration class for message types.
 
Constructor Summary
PipeResolverMessage()
          Creates a new unintialized pipe resolver message
 
Method Summary
 void addPeerID(ID id)
          Add a peer to the set of peers to which this query is directed.
abstract  Document getDocument(MimeMediaType asMimeType)
          Write message into a document. asMimeType is a mime media-type specification and provides the form of the document which is being requested.
 PeerAdvertisement getInputPeerAdv()
           
static String getMessageType()
          returns the Message type.
 PipeResolverMessage.MessageType getMsgType()
          Returns whether this message is a query or a response.
 Set getPeerIDs()
          Returns a Set (possibly empty) containing the peer ids which should respond to this query.
 ID getPipeID()
          Return the id of the pipe which is the subject of this message.
 String getPipeType()
          Return the pipe type of the pipe which is the subject of this message.
 boolean isFound()
          If true then the pipe was found ont he
 void setFound(boolean isFound)
           
 void setInputPeerAdv(PeerAdvertisement peerAdv)
           
 void setMsgType(PipeResolverMessage.MessageType type)
          Sets the message type of this message.
 void setPipeID(ID id)
          Set the id of pipe which is to be subject of this message.
 void setPipeType(String type)
          Set the pipe type of the pipe which is the subject of this message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipeResolverMessage

public PipeResolverMessage()
Creates a new unintialized pipe resolver message

Method Detail

getMessageType

public static String getMessageType()
returns the Message type. This will match the XML doctype declaration.

Returns:
a string

getDocument

public abstract Document getDocument(MimeMediaType asMimeType)
Write message into a document. asMimeType is a mime media-type specification and provides the form of the document which is being requested. Two standard document forms are defined. "text/plain" encodes the document in "pretty-print" format for human viewing and "text/xml" which provides an XML format.

Parameters:
asMimeType - MimeMediaType format representation requested
Returns:
Document the document to be used in the construction

getMsgType

public PipeResolverMessage.MessageType getMsgType()
Returns whether this message is a query or a response.

Returns:
the type of this message.

setMsgType

public void setMsgType(PipeResolverMessage.MessageType type)
Sets the message type of this message.

Parameters:
type - the type this message is to be.

getPipeID

public ID getPipeID()
Return the id of the pipe which is the subject of this message.

Returns:
the id of the pipe which is the subject of this message.

setPipeID

public void setPipeID(ID id)
Set the id of pipe which is to be subject of this message.

Parameters:
id - the pipe id which is the subject of this message.

getPipeType

public String getPipeType()
Return the pipe type of the pipe which is the subject of this message.

Returns:
the pipe type of the pipe which is the subject of this message.

setPipeType

public void setPipeType(String type)
Set the pipe type of the pipe which is the subject of this message.

Parameters:
type - The pipe type of the pipe which is to be the subject of this message.

getPeerIDs

public Set getPeerIDs()
Returns a Set (possibly empty) containing the peer ids which should respond to this query.

Returns:
set containing the peer ids to which this peer is directed.

addPeerID

public void addPeerID(ID id)
Add a peer to the set of peers to which this query is directed.

Parameters:
id - the peer id to add.

isFound

public boolean isFound()
If true then the pipe was found ont he


setFound

public void setFound(boolean isFound)

getInputPeerAdv

public PeerAdvertisement getInputPeerAdv()

setInputPeerAdv

public void setInputPeerAdv(PeerAdvertisement peerAdv)

JXTA J2SE