Project JXTA

net.jxta.protocol
Class DiscoveryResponseMsg

java.lang.Object
  extended by net.jxta.protocol.DiscoveryResponseMsg

public abstract class DiscoveryResponseMsg
extends 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.

See Also:
DiscoveryService, DiscoveryQueryMsg

Field Summary
protected  List advertisements
          

values are Advertisement

protected  String attr
          attribute used by the query
protected  List expirations
          Expirations
protected  PeerAdvertisement peerAdvertisement
          Responding peer's advertisement
protected  List responses
          

values are String or InputStream

protected  int type
          Advertisement type used by the query

FIXME 20040514 bondolo@jxta.org not a great default...

protected  String value
          Value used by the query
 
Constructor Summary
DiscoveryResponseMsg()
           
 
Method Summary
abstract  Enumeration getAdvertisements()
          returns the response advertisement objects
static String getAdvertisementType()
          All messages have a type(in xml this is !
 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.
 Enumeration getExpirations()
          Gets the expirations attribute of the DiscoveryResponseMsg object
 String getPeerAdv()
          Deprecated. access peer advertisement directly
 PeerAdvertisement getPeerAdvertisement()
          returns the responding peer's advertisement
 String getQueryAttr()
          returns the attributes used by the query
 String getQueryValue()
          returns the value used by the query
 int getResponseCount()
          Get the response count
 Enumeration getResponses()
          returns the response(s)
 void setDiscoveryType(int type)
          set the Response type whether it's peer, or group discovery
 void setExpirations(Vector expirations)
          set the expirations for this query
 void setPeerAdv(String newAdv)
          Deprecated. access peer advertisement directly
 void setPeerAdvertisement(PeerAdvertisement newAdv)
          Sets the responding peer's advertisement
 void setQueryAttr(String attr)
          set the attribute used by the query
 void setQueryValue(String value)
          set the value used by the query
 void setResponseCount(int count)
          Deprecated. Response count is now derived from responses. This call is ignored.
 void setResponses(Vector 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

attr

protected String attr
attribute used by the query


peerAdvertisement

protected PeerAdvertisement peerAdvertisement
Responding peer's advertisement


responses

protected List responses


advertisements

protected List advertisements


expirations

protected List expirations
Expirations


type

protected int type
Advertisement type used by the query

FIXME 20040514 bondolo@jxta.org not a great default...


value

protected String value
Value used by the query

Constructor Detail

DiscoveryResponseMsg

public DiscoveryResponseMsg()
Method Detail

getAdvertisementType

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

Returns:
String "jxta:ResolverResponse"

getAdvertisements

public abstract Enumeration getAdvertisements()
returns the response advertisement objects

Returns:
Enumeration of Advertisements responses

getDiscoveryType

public int getDiscoveryType()
Get the response type

Returns:
int type of discovery message PEER, GROUP or ADV discovery type response

setDiscoveryType

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

Parameters:
type - int representing the type

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 format.

Parameters:
asMimeType - mime-type requested
Returns:
Document document that represents the advertisement

getPeerAdv

public String getPeerAdv()
Deprecated. access peer advertisement directly


setPeerAdv

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


getPeerAdvertisement

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

Returns:
the Peer's advertisement

setPeerAdvertisement

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

Parameters:
newAdv - the responding Peer's advertisement

getQueryAttr

public String getQueryAttr()
returns the attributes used by the query

Returns:
String attribute of the query

getQueryValue

public String getQueryValue()
returns the value used by the query

Returns:
String value used by the query

getResponseCount

public int getResponseCount()
Get the response count

Returns:
int count

setResponseCount

public void setResponseCount(int count)
Deprecated. Response count is now derived from responses. This call is ignored.

set the response count in this message. does nothing

Parameters:
count - number of response in this message

getExpirations

public Enumeration getExpirations()
Gets the expirations attribute of the DiscoveryResponseMsg object

Returns:
The expirations value

setExpirations

public void setExpirations(Vector expirations)
set the expirations for this query

Parameters:
expirations - the expirations for this query

getResponses

public Enumeration getResponses()
returns the response(s)

Returns:
Enumeration of String responses

setResponses

public void setResponses(Vector responses)
set the responses to the query

Parameters:
responses -

setQueryAttr

public void setQueryAttr(String attr)
set the attribute used by the query

Parameters:
attr -

setQueryValue

public void setQueryValue(String value)
set the value used by the query

Parameters:
value -

JXTA J2SE