Project JXTA

net.jxta.impl.endpoint.cbjx
Class CbJxMessageInfo

java.lang.Object
  extended by net.jxta.impl.endpoint.cbjx.CbJxMessageInfo

public class CbJxMessageInfo
extends Object

this class defines the xml document used to store message information that is useful for the cbjx endpoint


Constructor Summary
CbJxMessageInfo()
          creates a new information object
CbJxMessageInfo(InputStream stream, MimeMediaType type)
          creates a new Message information by parsing the given stream
 
Method Summary
 EndpointAddress getDestinationAddress()
          retrieve the destination address of the message
 Document getDocument(MimeMediaType asMimeType)
          returns a Document containing the information's document tree
 Certificate getPeerCert()
          retrieve the peer certificate
 EndpointAddress getSourceAddress()
          retrieve the original source address of the message
 ID getSourceID()
          retrieve the source id of the message
protected  boolean handleElement(XMLElement elem)
          Called to handle elements during parsing.
protected  void initialize(Element root)
          internal method to process a document into an advertisement.
 void setDestinationAddress(EndpointAddress addr)
          set the destination address of the message
 void setPeerCert(Certificate cert)
          set the peer certificate
 void setSourceAddress(EndpointAddress addr)
          set the source address of the messsage
 void setSourceID(ID src)
          set the source id of the message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CbJxMessageInfo

public CbJxMessageInfo()
creates a new information object


CbJxMessageInfo

public CbJxMessageInfo(InputStream stream,
                       MimeMediaType type)
                throws IOException
creates a new Message information by parsing the given stream

Parameters:
stream - the InputStream source of the info data
Throws:
IOException - if the info can't be parsed from the stream
Method Detail

getPeerCert

public Certificate getPeerCert()
retrieve the peer certificate

Returns:
Certificate the peer certificate

setPeerCert

public void setPeerCert(Certificate cert)
set the peer certificate

Parameters:
cert - the peer certificate

getDestinationAddress

public EndpointAddress getDestinationAddress()
retrieve the destination address of the message

Returns:
String the original destination address of the message

setDestinationAddress

public void setDestinationAddress(EndpointAddress addr)
set the destination address of the message

Parameters:
addr - the destination address

getSourceAddress

public EndpointAddress getSourceAddress()
retrieve the original source address of the message

Returns:
String the original source address of the message

setSourceAddress

public void setSourceAddress(EndpointAddress addr)
set the source address of the messsage

Parameters:
addr - the source address

getSourceID

public ID getSourceID()
retrieve the source id of the message

Returns:
String the source id of the sender

setSourceID

public void setSourceID(ID src)
set the source id of the message

Parameters:
src - the ID of the sender

getDocument

public Document getDocument(MimeMediaType asMimeType)
returns a Document containing the information's document tree

Parameters:
asMimeType - the desired MIME type for the information rendering
Returns:
Document the Document containing the information's document tree

handleElement

protected boolean handleElement(XMLElement elem)
Called to handle elements during parsing.

Parameters:
elem - Element to parse
Returns:
true if element was handled, otherwise false.

initialize

protected void initialize(Element root)
internal method to process a document into an advertisement.

Parameters:
root - where to start.

JXTA J2SE