Project JXTA

net.jxta.protocol
Class DiscoveryQueryMsg

java.lang.Object
  |
  +--net.jxta.protocol.DiscoveryQueryMsg

public abstract class DiscoveryQueryMsg
extends java.lang.Object

This class defines the DiscoveryService message "Query" The default behavior of this abstract class is simply a place holder for the generic resolver query fields. This message is part of the Peer DiscoveryService Protocol.

      <?xml version="1.0" standalone='yes'?>
       <DiscoveryQuery>
        <type>int</type>
        <threshold>int</threshold>
        <peeradv>peeradv</peeradv>
        <attribute>attribute</attribute>
        <value>attribute</value>
       </DiscoveryQuery>
 

Since:
JXTA 1.0
See Also:
DiscoveryResponseMsg

Field Summary
static int threshold
          default threshold to limit the number of responses from one peer
 int type
           
 
Constructor Summary
DiscoveryQueryMsg()
           
 
Method Summary
static java.lang.String getAdvertisementType()
          All messages have a type (in xml this is !doctype) which identifies the message
 java.lang.String getAttr()
          returns the Attr value
 int getDiscoveryType()
          Get the response type
abstract  Document getDocument(MimeMediaType asMimeType)
          Write advertisement into a document.
 java.lang.String getPeerAdv()
          returns the responding's peer advertisement
 int getThreshold()
          Get the Threshold for number of responses
 java.lang.String getValue()
          returns the value of Attr
 void setAttr(java.lang.String attr)
          set the attr
 void setDiscoveryType(int type)
          set the Response type whether it's peer, or group dsicovery
 void setPeerAdv(java.lang.String peer)
          set the Response type whether it's peer, or group dsicovery
 void setThreshold(int threshold)
          set the threshold
 void setValue(java.lang.String value)
          set the query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threshold

public static int threshold
default threshold to limit the number of responses from one peer

type

public int type
Constructor Detail

DiscoveryQueryMsg

public DiscoveryQueryMsg()
Method Detail

getAdvertisementType

public static java.lang.String getAdvertisementType()
All messages have a type (in xml this is !doctype) which identifies the message
Returns:
String "jxta:ResolverResponse"
Since:
JXTA 1.0

getThreshold

public int getThreshold()
Get the Threshold for number of responses
Returns:
int threshold
Since:
JXTA 1.0

getDiscoveryType

public int getDiscoveryType()
Get the response type
Returns:
int PEER, or GROUP discovery type response
Since:
JXTA 1.0

getPeerAdv

public java.lang.String getPeerAdv()
returns the responding's peer advertisement
Returns:
String handlername name
Since:
JXTA 1.0

getAttr

public java.lang.String getAttr()
returns the Attr value
Returns:
String value of Attribute
Since:
JXTA 1.0

getValue

public java.lang.String getValue()
returns the value of Attr
Returns:
String
Since:
JXTA 1.0

setThreshold

public void setThreshold(int threshold)
set the threshold
Parameters:
threshold - value to be set
Since:
JXTA 1.0

setDiscoveryType

public void setDiscoveryType(int type)
set the Response type whether it's peer, or group dsicovery
Parameters:
type - type of discovery
Since:
JXTA 1.0

setPeerAdv

public void setPeerAdv(java.lang.String peer)
set the Response type whether it's peer, or group dsicovery
Parameters:
peer -  
Since:
JXTA 1.0

setAttr

public void setAttr(java.lang.String attr)
set the attr
Parameters:
attr - attribut of the query
Since:
JXTA 1.0

setValue

public void setValue(java.lang.String value)
set the query
Parameters:
value - value of the attribute to query
Since:
JXTA 1.0

getDocument

public abstract Document getDocument(MimeMediaType asMimeType)
                              throws java.lang.Exception
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 representation.
Parameters:
asMimeType - mime-type format requested
Returns:
Document representaion of the document as an advertisement
Throws:
java.lang.Exception - error generating the document
Since:
JXTA 1.0

Project JXTA