JXTA

net.jxta.impl.protocol
Class DiscoveryResponse

java.lang.Object
  extended by net.jxta.protocol.DiscoveryResponseMsg
      extended by net.jxta.impl.protocol.DiscoveryResponse

public class DiscoveryResponse
extends DiscoveryResponseMsg

DiscoveryResponse.

This message is part of the standard JXTA Peer Discovery Protocol (PDP).

 <xs:element name="DiscoveryResponse" type="jxta:DiscoveryResponse"/>

 <xs:complexType name="DiscoveryResponse">
   <xs:sequence>
     <xs:element name="Type" type="jxta:DiscoveryQueryType"/>
     <xs:element name="Count" type="xs:unsignedInt" minOccurs="0"/>
     <xs:element name="Attr" type="xs:string" minOccurs="0"/>
     <xs:element name="Value" type="xs:string" minOccurs="0"/>
     <!-- The following should refer to a peer adv, but is instead a whole doc for historical reasons -->
     <xs:element name="PeerAdv" minOccurs="0">
     <xs:complexType>
       <xs:simpleContent>
         <xs:extension base="xs:string">
           <xs:attribute name="Expiration" type="xs:unsignedLong"/>
         </xs:extension>
       </xs:simpleContent>
     </xs:complexType>
     </xs:element>
     <xs:element name="Response" maxOccurs="unbounded">
     <xs:complexType>
       <xs:simpleContent>
         <xs:extension base="xs:string">
           <xs:attribute name="Expiration" type="xs:unsignedLong"/>
         </xs:extension>
       </xs:simpleContent>
     </xs:complexType>
     </xs:element>
   </xs:sequence>
 </xs:complexType>
 

See Also:
DiscoveryService, DiscoveryServiceImpl, JXTA Protocols Specification : Peer Discovery Protocol

Field Summary
 
Fields inherited from class net.jxta.protocol.DiscoveryResponseMsg
advertisements, attr, expirations, peerAdvertisement, responses, type, value
 
Constructor Summary
DiscoveryResponse()
          Constructor for new instances.
DiscoveryResponse(Element root)
          Construct from a StructuredDocument
 
Method Summary
 Document getDocument(MimeMediaType asMimeType)
          Write advertisement into a document. asMimeType is a mime media-type specification and provides the form of the document which is being requested.
 String toString()
          Return a string representation of this message.
 
Methods inherited from class net.jxta.protocol.DiscoveryResponseMsg
getAdvertisements, getAdvertisementType, getDiscoveryType, getExpirations, getPeerAdvertisement, getQueryAttr, getQueryValue, getResponseCount, getResponses, setDiscoveryType, setExpirations, setPeerAdvertisement, setQueryAttr, setQueryValue, setResponses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscoveryResponse

public DiscoveryResponse()
Constructor for new instances.


DiscoveryResponse

public DiscoveryResponse(Element root)
Construct from a StructuredDocument

Parameters:
root - Description of the Parameter
Method Detail

getDocument

public Document getDocument(MimeMediaType asMimeType)
Write advertisement 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/text" encodes the document in a form nice for printing out and "text/xml" which provides an XML format.

Specified by:
getDocument in class DiscoveryResponseMsg
Parameters:
asMimeType - mime-type requested
Returns:
Document document that represents the advertisement

toString

public String toString()
Return a string representation of this message. The string will contain the message formated as a UTF-8 encoded XML Document.

Overrides:
toString in class Object
Returns:
String a String containing the message.

JXSE