com.echomine.jabber.msg
Class ServiceInfoIQMessage

java.lang.Object
  extended by com.echomine.jabber.JabberMessage
      extended by com.echomine.jabber.JabberJDOMMessage
          extended by com.echomine.jabber.AbstractJabberMessage
              extended by com.echomine.jabber.JabberIQMessage
                  extended by com.echomine.jabber.msg.ServiceInfoIQMessage
All Implemented Interfaces:
JabberMessageParsable

public class ServiceInfoIQMessage
extends JabberIQMessage

Implementation class for working with the Info namespace of the JEP-0030 Service Discovery protocol. The service discovery protocol is a new protocol that will eventually replace the older JEP-0094 Agent Information and JEP-0011 Browsing specs.

Note that this JEP is still considered Experimental. Thus, the protocol may well not have been implemented on the server side. Even though the older Agents namespace is deprecated, it does not mean that you should stop using it. It also doesn't mean that you should use the new disco protocol judiciously without checking to make sure it is supported by the remote server. How would you know? For now, you will just have to try both and see what happens.

Read up on the list of categories, namespaces, and types at the Jabber Registry for an up-to-date list that you may use. The registrar is located at http://www.jabber.org/registrar/

Current Implementation: JEP-0030 Version 2.0

Since:
0.8a4
See Also:
ServiceItemsIQMessage

Field Summary
 
Fields inherited from class com.echomine.jabber.JabberIQMessage
TYPE_GET, TYPE_RESULT, TYPE_SET
 
Fields inherited from class com.echomine.jabber.AbstractJabberMessage
TYPE_ERROR
 
Fields inherited from class com.echomine.jabber.JabberMessage
messageID
 
Constructor Summary
ServiceInfoIQMessage()
           
ServiceInfoIQMessage(java.lang.String type)
          defaults to iq type get for retrieval or for parsing incoming messages
 
Method Summary
 void addFeature(java.lang.String feature)
          Adds a new feature support.
 void addIdentity(ServiceIdentity identity)
          adds a new identity to the list of services that are supported
 java.lang.String encode()
          encodes the additional data
 java.util.List getFeatures()
           
 java.util.List getIdentities()
           
 int getMessageType()
          the default message type is unknown.
 java.lang.String getNode()
           
 JabberMessage parse(JabberMessageParser parser, Element msgTree)
          parses the additional data out of the DOM
 void setNode(java.lang.String node)
          sets the node to the specified node value, or null to set it to none
 
Methods inherited from class com.echomine.jabber.AbstractJabberMessage
getErrorMessage, getFrom, getTo, getType, isError, setErrorMessage, setFrom, setTo, setType
 
Methods inherited from class com.echomine.jabber.JabberJDOMMessage
getDOM, getXMLOutputter, setMessageID, toString
 
Methods inherited from class com.echomine.jabber.JabberMessage
getMessageID, getReplyMessage, getTimeout, getXMessage, getXMessages, interrupt, isReplyRequired, isSendXMessages, isSynchronized, replyReceived, setReplyRequired, setSendXMessages, setSynchronized, setTimeout, setXMessage, setXMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceInfoIQMessage

public ServiceInfoIQMessage(java.lang.String type)
defaults to iq type get for retrieval or for parsing incoming messages


ServiceInfoIQMessage

public ServiceInfoIQMessage()
Method Detail

getMessageType

public int getMessageType()
Description copied from class: JabberJDOMMessage
the default message type is unknown. It doesn't mean that there is no type. It just means that there is no known message parser for this particular object.

Overrides:
getMessageType in class JabberIQMessage
Returns:
the message type id
See Also:
JabberCode

getNode

public java.lang.String getNode()
Returns:
the optional node name of the message, or null if none exists.

setNode

public void setNode(java.lang.String node)
sets the node to the specified node value, or null to set it to none


addIdentity

public void addIdentity(ServiceIdentity identity)
adds a new identity to the list of services that are supported


addFeature

public void addFeature(java.lang.String feature)
Adds a new feature support. The feature is normally a namespace or a protocol name registered with the Jabber registrar.


getIdentities

public java.util.List getIdentities()
Returns:
a unmodifiable list of ServiceIdentity objects

getFeatures

public java.util.List getFeatures()
Returns:
a unmodifiable list of String objects representing features

parse

public JabberMessage parse(JabberMessageParser parser,
                           Element msgTree)
                    throws ParseException
parses the additional data out of the DOM

Specified by:
parse in interface JabberMessageParsable
Overrides:
parse in class AbstractJabberMessage
Throws:
ParseException

encode

public java.lang.String encode()
                        throws ParseException
encodes the additional data

Overrides:
encode in class JabberJDOMMessage
Throws:
ParseException - if something went wrong during encoding


Copyright © 2001-2005 Echomine. All Rights Reserved.