com.echomine.jabber.msg
Class BrowseIQMessage

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.BrowseIQMessage
All Implemented Interfaces:
JabberMessageParsable

public class BrowseIQMessage
extends JabberIQMessage

This message encapsulates all browsing-related messages. The new Browsing framework for Jabber allows you to retrieve any information regarding a service/conference/application/etc. It gives your a way to retrieve information about a specific JID. For instance, if the jid is a user, browsing the user will return the services/functions supported by the client (ie. xhtml, pgp/encryption, oob file transfers, etc). Browsing to a server will return a list of agents/services that the server supports (ie. icq, conferencing, msn, irc, etc). Thus, the browsing framework become extremely generic.

Inside a browse result message, you will receive a list of services that the JID supports. You can further browse down to those internal list to obtain information about those services. The browsing framework is created in such a way as to be hierarchical (sort like a tree list in a GUI, ie. XML parent/child style). A service can be browsed until no further services are contained.

Notes on Implementation: Under most circumstances, the JID contained in the Browse message should be exactly the same as the To field in the IQ message. There is an exception. If the result message is from a chat conference room, then any messages received from the chat is under the conference room's JID for the IQ From Field. The JID inside the message will then be the user's JID.

There are a lot of complications with using the Browse message, it is suggested that you read the Jabber Browsing draft available at http://www.jabber.org for more information. Otherwise, you can simply use the provided convenience methods offered by the Jabber Service classes.

Current Implementation: JEP-0011 Version 1.0

See Also:
ServiceInfoIQMessage, 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
BrowseIQMessage()
          defaults to iq type get and jidtype of "service/jabber"
BrowseIQMessage(java.lang.String type, java.lang.String jtype)
          this constructor is for messages with type.
 
Method Summary
 java.lang.String encode()
          overrides the encode so that we can transform all the data in this class into XML before sending it off
 JIDType getJIDType()
           
 int getMessageType()
          the default message type is unknown.
 JabberMessage parse(JabberMessageParser parser, Element msgTree)
          parses the incoming message for the data
 void setJIDType(JIDType jidtype)
           
 
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

BrowseIQMessage

public BrowseIQMessage(java.lang.String type,
                       java.lang.String jtype)
                throws ParseException
this constructor is for messages with type.

Throws:
ParseException - if the jid category/subtype is not in the proper format

BrowseIQMessage

public BrowseIQMessage()
defaults to iq type get and jidtype of "service/jabber"

Method Detail

getJIDType

public JIDType getJIDType()

setJIDType

public void setJIDType(JIDType jidtype)

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:
a message code that is unique to the message
See Also:
JabberCode

parse

public JabberMessage parse(JabberMessageParser parser,
                           Element msgTree)
                    throws ParseException
parses the incoming message for the data

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

encode

public java.lang.String encode()
                        throws ParseException
overrides the encode so that we can transform all the data in this class into XML before sending it off

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


Copyright © 2001-2005 Echomine. All Rights Reserved.