|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.realtime.xmpp.dom.DomXmppTool
Helper methods for DOM Jabber components.
| Nested Class Summary | |
protected class |
DomXmppTool.RosterUpdater
Callback object to update rosters. |
| Field Summary | |
protected DomComponent |
m_component
The component to use to communicate with Jabber. |
| Constructor Summary | |
DomXmppTool(DomComponent component)
Create a set of tools to work with the named component. |
|
| Method Summary | |
void |
conveyPresence(JID principal,
JID contact)
Convey the presence information of the principal JID by sending info to the contact. |
XmppError |
createAccount(JID account,
java.lang.String sPassword)
Create a new account with the given account name and password. |
void |
forceSubscribed(JID principal,
JID contact)
Convey the presence information of the principal JID by sending info to the contact. |
protected boolean |
hasContact(org.dom4j.Element roster,
JID contact,
java.lang.String sGroupTail,
java.lang.String sSubscription)
Check to see if a roster contains a contact in a group. |
protected static XmppError |
interpretResult(org.dom4j.Element response)
Figure out the result from an XMPP packet. |
XmppError |
rosterAdd(JID account,
JID contact,
java.lang.String sContactNick,
java.lang.String sSubscription,
java.lang.String sGroup,
java.lang.String sGroupTail)
Insert a new contact into a roster. |
XmppError |
rosterRemove(JID principal,
JID contact,
java.lang.String sGroup,
boolean bTail)
Remove a contact from an accounts roster. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected DomComponent m_component
| Constructor Detail |
public DomXmppTool(DomComponent component)
Create a set of tools to work with the named component.
component - The component to use to communicate with
the jabber server.| Method Detail |
public void conveyPresence(JID principal,
JID contact)
throws java.io.IOException
Convey the presence information of the principal JID by sending info to the contact.
conveyPresence in interface PresenceToolprincipal - The user with presence info to send.contact - The recipient of the presence info.
java.io.IOException
public void forceSubscribed(JID principal,
JID contact)
throws java.io.IOException
Convey the presence information of the principal JID by sending info to the contact.
principal - The user with presence info to send.contact - The recipient of the presence info.
java.io.IOException
public XmppError rosterAdd(JID account,
JID contact,
java.lang.String sContactNick,
java.lang.String sSubscription,
java.lang.String sGroup,
java.lang.String sGroupTail)
throws java.io.IOException
Insert a new contact into a roster.
rosterAdd in interface RosterToolaccount - The account to add the roster item to.
* @param contact The Jabber id of the new contact.
* @param sContactNick The contacts nick name.sSubscription - The type of subscription. If this is 'none', then
no subscription has been agreed to. If this is 'both', then both parties
are assumed to have agreed to a subscription.sGroup - If this is not null, then the contact will be assigned to a
group. NOTE that if a group tail is provided, it will be added to
the finished group name.sGroupTail - If this is not null, then it will be used to locate
the matching group.
* @return An XmppError, or null for success.contact - The Jabber id of the new contact.sContactNick - The contacts nick name.
java.io.IOException - Generated when the session fails.
protected boolean hasContact(org.dom4j.Element roster,
JID contact,
java.lang.String sGroupTail,
java.lang.String sSubscription)
Check to see if a roster contains a contact in a group.
roster - The roster to evaluate.
* @param contact The contact to look for.
* @param sGroupTail The ending of the group name.sSubscription - The subscription type that must be there.
* @return True if the contact is already in the list, false
otherwise.
public XmppError rosterRemove(JID principal,
JID contact,
java.lang.String sGroup,
boolean bTail)
throws java.io.IOException
Remove a contact from an accounts roster.
* @param principal The account to remove the contact from. * @param contact The contact to remove. * @param sGroup The full, or tail portion of the group name.
rosterRemove in interface RosterToolbTail - If true, the group name is just the tail.
* @return An XmppError, or null for success.principal - The account to remove the contact from.contact - The contact to remove.sGroup - The full, or tail portion of the group name.
java.io.IOException - Generated when the session fails.
public XmppError createAccount(JID account,
java.lang.String sPassword)
throws java.io.IOException
Create a new account with the given account name and password.
* @param comp The component to create the account with. * @param account The full account name, including the name of this host. * @param sPassword the new password. * @return An XmppError code, or null for success. * @throws IOException Generated by problems communicating with the Jabber server.
createAccount in interface AccountToolaccount - The full account name, including the name of this host.sPassword - the new password.
java.io.IOException - Generated by problems communicating with the Jabber server.protected static XmppError interpretResult(org.dom4j.Element response)
Figure out the result from an XMPP packet. Was there an error code?
* @param response The packet to interpret. * @return An XMPP error code, or null for no error.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||