Project 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
 Enumeration getAdvertisements()
          
 Document getDocument(MimeMediaType asMimeType)
          
protected  void setAdvertisements(List advs)
          set the responses to the query
 String toString()
          
 
Methods inherited from class net.jxta.protocol.DiscoveryResponseMsg
getAdvertisementType, getDiscoveryType, getExpirations, getPeerAdv, getPeerAdvertisement, getQueryAttr, getQueryValue, getResponseCount, getResponses, setDiscoveryType, setExpirations, setPeerAdv, setPeerAdvertisement, setQueryAttr, setQueryValue, setResponseCount, 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

getAdvertisements

public Enumeration getAdvertisements()

Specified by:
getAdvertisements in class DiscoveryResponseMsg

setAdvertisements

protected void setAdvertisements(List advs)
set the responses to the query

Parameters:
advs - the responses for this query

getDocument

public Document getDocument(MimeMediaType asMimeType)

Specified by:
getDocument in class DiscoveryResponseMsg

toString

public String toString()

Overrides:
toString in class Object

JXTA J2SE