Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

net.jxta.impl.protocol
Class DiscoveryQuery  view DiscoveryQuery download DiscoveryQuery.java

java.lang.Object
  extended bynet.jxta.protocol.DiscoveryQueryMsg
      extended bynet.jxta.impl.protocol.DiscoveryQuery

public class DiscoveryQuery
extends net.jxta.protocol.DiscoveryQueryMsg

Implements the Discovery Query Message according to the schema defined by the standard JXTA Peer Discovery Protocol (PDP).

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

 <xsd:simpleType name="DiscoveryQueryType">
   <xsd:restriction base="xsd:string">
     <!-- peer -->
     <xsd:enumeration value="0"/>
     <!-- group -->
     <xsd:enumeration value="1"/>
     <!-- adv -->
     <xsd:enumeration value="2"/>
   </xsd:restriction>
 </xsd:simpleType>

 <xs:complexType name="DiscoveryQuery">
   <xs:sequence>
     <xs:element name="Type" type="jxta:DiscoveryQueryType"/>
     <xs:element name="Threshold" 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" type="xs:string" minOccurs="0"/>
   </xs:sequence>
 </xs:complexType>
 


Field Summary
private static org.apache.log4j.Logger LOG
           
private static java.lang.String peerAdvTag
           
private static java.lang.String queryAttrTag
           
private static java.lang.String queryValueTag
           
private static java.lang.String thresholdTag
           
private static java.lang.String typeTag
           
 
Fields inherited from class net.jxta.protocol.DiscoveryQueryMsg
 
Constructor Summary
DiscoveryQuery()
          Default constructor
DiscoveryQuery(net.jxta.document.Element doc)
          Construct from a StructuredDocument
 
Method Summary
 net.jxta.document.Document getDocument(net.jxta.document.MimeMediaType asMimeType)
          null
protected  boolean handleElement(net.jxta.document.Element raw)
          Process an individual element from the document during parse.
protected  void initialize(net.jxta.document.Element root)
          Intialize a Discovery Query from a portion of a structured document.
 java.lang.String toString()
          Deprecated. should not be used. use getDocument().toString() instead.
 
Methods inherited from class net.jxta.protocol.DiscoveryQueryMsg
getAdvertisementType, getAttr, getDiscoveryType, getPeerAdv, getPeerAdvertisement, getThreshold, getValue, setAttr, setDiscoveryType, setPeerAdv, setPeerAdvertisement, setThreshold, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

typeTag

private static final java.lang.String typeTag
See Also:
Constant Field Values

peerAdvTag

private static final java.lang.String peerAdvTag
See Also:
Constant Field Values

thresholdTag

private static final java.lang.String thresholdTag
See Also:
Constant Field Values

queryAttrTag

private static final java.lang.String queryAttrTag
See Also:
Constant Field Values

queryValueTag

private static final java.lang.String queryValueTag
See Also:
Constant Field Values
Constructor Detail

DiscoveryQuery

public DiscoveryQuery()
Default constructor


DiscoveryQuery

public DiscoveryQuery(net.jxta.document.Element doc)
Construct from a StructuredDocument

Method Detail

handleElement

protected boolean handleElement(net.jxta.document.Element raw)
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;
      }
  


initialize

protected void initialize(net.jxta.document.Element root)
Intialize a Discovery Query from a portion of a structured document.


getDocument

public net.jxta.document.Document getDocument(net.jxta.document.MimeMediaType asMimeType)
null


toString

public java.lang.String toString()
Deprecated. should not be used. use getDocument().toString() instead.

return the string representaion of this doc