Project JXTA

net.jxta.protocol
Class DiscoveryResponseMsg

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

public abstract class DiscoveryResponseMsg
extends java.lang.Object

This class defines the DiscoveryService message "Response" The default behavior of this abstract class is simply a place holder for the generic resolver query fields. This message is the response to the DiscoveryQueryMsg.

This message is part of the Peer DiscoveryService protocol

 <?xml version="1.0"?>
 <DiscoveryResponse>
   <count>int<count>
   <type>int</type>
   <peeradv> adv </peeradv>
   <attr> attribute </attr>
   <value> value </value>
   <responses>adv</responses>
     ......
   <responses>adv</responses>
 </DiscoveryResponse>
Tag $Name: $

Since:
JXTA 1.0
See Also:
DiscoveryQueryMsg

Field Summary
 int count
           
 int type
           
 
Constructor Summary
DiscoveryResponseMsg()
           
 
Method Summary
static java.lang.String getAdvertisementType()
          All messages have a type (in xml this is !doctype) which identifies the message
 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
 java.lang.String getQueryAttr()
          returns the attributes used by the query
 java.lang.String getQueryValue()
          returns the value used by the query
 int getResponseCount()
          Get the reponse count
 java.util.Enumeration getResponses()
          returns the response(s)
 void setDiscoveryType(int type)
          set the Response type whether it's peer, or group dsicovery
 void setPeerAdv(java.lang.String peer)
          set the response peer advertisement
 void setQueryAttr(java.lang.String attr)
          set the attribute used by the query
 void setQueryValue(java.lang.String value)
          set the value used by the query
 void setResponseCount(int count)
          set the response count in this message
 void setResponses(java.util.Enumeration responses)
          set the responses to the query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public int type

count

public int count
Constructor Detail

DiscoveryResponseMsg

public DiscoveryResponseMsg()
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

getResponseCount

public int getResponseCount()
Get the reponse count
Returns:
int count
Since:
JXTA 1.0

getDiscoveryType

public int getDiscoveryType()
Get the response type
Returns:
int type of discovery message 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 peer advertisement
Since:
JXTA 1.0

getQueryAttr

public java.lang.String getQueryAttr()
returns the attributes used by the query
Returns:
String attribute of the query
Since:
JXTA 1.0

getQueryValue

public java.lang.String getQueryValue()
returns the value used by the query
Returns:
String value used by the query
Since:
JXTA 1.0

getResponses

public java.util.Enumeration getResponses()
returns the response(s)
Returns:
Enumeration of String responses
Since:
JXTA 1.0

setResponseCount

public void setResponseCount(int count)
set the response count in this message
Parameters:
count - number of response in this message
Since:
JXTA 1.0

setDiscoveryType

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

setPeerAdv

public void setPeerAdv(java.lang.String peer)
set the response peer advertisement
Parameters:
peer -  
Since:
JXTA 1.0

setQueryAttr

public void setQueryAttr(java.lang.String attr)
set the attribute used by the query
Parameters:
attr -  
Since:
JXTA 1.0

setQueryValue

public void setQueryValue(java.lang.String value)
set the value used by the query
Parameters:
value -  
Since:
JXTA 1.0

setResponses

public void setResponses(java.util.Enumeration responses)
set the responses to the query
Parameters:
responses -  
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 format.
Parameters:
asMimeType - mime-typ requested
Returns:
Document document that represents the advertisement
Throws:
java.lang.Exception - error generating the document representing the message.
Since:
JXTA 1.0

Project JXTA