Project JXTA

net.jxta.protocol
Class ResolverQueryMsg

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

public abstract class ResolverQueryMsg
extends java.lang.Object

This class defines the Generic ResolverService message "Query" The default behavior of this abstract class is simply a place holder for the generic resolver query fields. note that no XML processing is performed by this class. The processing of the message is left to the class extending this class.

This message is part of the PeerGroup ResolverService Protocol

 <?xml version="1.0"?>
 <ResolverQuery>
   <handlername> name </handlername>
   <credentialServiecUri> uri </credentialServiecUri>
   <credentialToken> token </credentialToken>
   <queryid> id </queryid>
   <query> query </query>
 </ResolverQuery>
 
Note: queryid is unique to the originating node only, it can be utilized to match queries to responses Tag $Name: $

Since:
JXTA 1.0
See Also:
ResolverResponseMsg

Field Summary
 int queryid
           
 
Constructor Summary
ResolverQueryMsg()
           
 
Method Summary
static java.lang.String getAdvertisementType()
          All messages have a type (in xml this is !doctype) which identifies the message
 java.lang.String getCredentialServieUri()
          returns the credentialServiecUri name
 java.lang.String getCredentialToken()
          returns the credentialToken
abstract  Document getDocument(MimeMediaType asMimeType)
          Write advertisement into a document.
 java.lang.String getHandlerName()
          returns the handlername
 java.lang.String getQuery()
          returns the query
 int getQueryId()
          returns queryid value
 java.lang.String getSrc()
          Returns the source of the query
 void setCredentialServiceUri(java.lang.String uri)
          set the credentialServiecUri
 void setCredentialToken(java.lang.String token)
          set the value of the credential Token
 void setHandlerName(java.lang.String name)
          set the handlername
 void setQuery(java.lang.String Query)
          set the Query string
 void setQueryId(int id)
          set the query id.
 void setSrc(java.lang.String p)
          Set the source of the query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryid

public int queryid
Constructor Detail

ResolverQueryMsg

public ResolverQueryMsg()
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:ResolverQuery"
Since:
JXTA 1.0

getHandlerName

public java.lang.String getHandlerName()
returns the handlername
Returns:
String handlername name
Since:
JXTA 1.0

getCredentialServieUri

public java.lang.String getCredentialServieUri()
returns the credentialServiecUri name
Returns:
String credentialServiecUri name
Since:
JXTA 1.0

getCredentialToken

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

getQueryId

public int getQueryId()
returns queryid value
Returns:
int queryid value
Since:
JXTA 1.0

getQuery

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

setHandlerName

public void setHandlerName(java.lang.String name)
set the handlername
Parameters:
name - handler name
Since:
JXTA 1.0

setCredentialServiceUri

public void setCredentialServiceUri(java.lang.String uri)
set the credentialServiecUri
Parameters:
uri - string representing credentialServiecUri
Since:
JXTA 1.0

setCredentialToken

public void setCredentialToken(java.lang.String token)
set the value of the credential Token
Parameters:
token - string representing the credential Token
Since:
JXTA 1.0

setQueryId

public void setQueryId(int id)
set the query id. Each query has a unique id.
Parameters:
id - int id
Since:
JXTA 1.0

setQuery

public void setQuery(java.lang.String Query)
set the Query string
Parameters:
Query - string representing the query
Since:
JXTA 1.0

setSrc

public void setSrc(java.lang.String p)
Set the source of the query
Parameters:
src - is a String containing the peerid of the source
Since:
JXTA 1.0

getSrc

public java.lang.String getSrc()
Returns the source of the query
Returns:
String the peerid of the source of the 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 format.
Parameters:
asMimeType - mime-type requested representation for the returned document
Returns:
Document document representing the advertisement
Throws:
Eception - error creating the document representing the message.
Since:
JXTA 1.0

Project JXTA