Project JXTA

net.jxta.protocol
Class DiscoveryQueryMsg

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

public abstract class DiscoveryQueryMsg
extends Object

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

See Also:
DiscoveryService, DiscoveryResponseMsg

Constructor Summary
DiscoveryQueryMsg()
           
 
Method Summary
static String getAdvertisementType()
          All messages have a type (in xml this is !doctype) which identifies the message
 String getAttr()
          returns the Attr value
 int getDiscoveryType()
          Get the response type
abstract  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 getPeerAdv()
          Deprecated. Peer Advertisement is available directly via getPeerAdvertisement().
 PeerAdvertisement getPeerAdvertisement()
          returns the querying peer's advertisement
 int getThreshold()
          Get the Threshold for number of responses
 String getValue()
          returns the value of Attr
 void setAttr(String attr)
          set the attr
 void setDiscoveryType(int type)
          set the Response type whether it's peer, or group discovery
 void setPeerAdv(String newAdv)
          Deprecated. access peer advertisement directly
 void setPeerAdvertisement(PeerAdvertisement newAdv)
          returns the responding peer's advertisement
 void setThreshold(int threshold)
          set the threshold
 void setValue(String value)
          set the query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoveryQueryMsg

public DiscoveryQueryMsg()
Method Detail

getAttr

public String getAttr()
returns the Attr value

Returns:
String value of Attribute

getDiscoveryType

public int getDiscoveryType()
Get the response type

Returns:
int PEER, or GROUP discovery type response

getDocument

public abstract 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 representation.

Parameters:
asMimeType - mime-type format requested
Returns:
Document representation of the document as an advertisement

getPeerAdv

public String getPeerAdv()
Deprecated. Peer Advertisement is available directly via getPeerAdvertisement().

returns the responding peer advertisement

Returns:
String handlername name

setPeerAdv

public void setPeerAdv(String newAdv)
Deprecated. access peer advertisement directly


getPeerAdvertisement

public PeerAdvertisement getPeerAdvertisement()
returns the querying peer's advertisement

Returns:
peer advertisement of querier.

setPeerAdvertisement

public void setPeerAdvertisement(PeerAdvertisement newAdv)
returns the responding peer's advertisement

Parameters:
newAdv - peer advertisement of querier.

getThreshold

public int getThreshold()
Get the Threshold for number of responses

Returns:
int threshold

getValue

public String getValue()
returns the value of Attr

Returns:
String

setAttr

public void setAttr(String attr)
set the attr

Parameters:
attr - attribute of the query

setDiscoveryType

public void setDiscoveryType(int type)
set the Response type whether it's peer, or group discovery

Parameters:
type - type of discovery

setThreshold

public void setThreshold(int threshold)
set the threshold

Parameters:
threshold - value to be set

setValue

public void setValue(String value)
set the query

Parameters:
value - value of the attribute to query

getAdvertisementType

public static String getAdvertisementType()
All messages have a type (in xml this is !doctype) which identifies the message

Returns:
String "jxta:DiscoveryQuery"

JXTA J2SE