Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.net.util.XMPPUtils Class Reference

List of all members.

Static Public Member Functions

static void setDefaultConnectionService (XMPPConnectionService connectionService)
static String getNickname (XMPPConnectionService connectionService, JID jid)
static String getDisplayableName (RosterEntry entry)
static Registration createAccount (String server, String username, String password) throws XMPPException
static void removeFromRoster (Connection connection, RosterEntry rosterEntry) throws XMPPException
static boolean isJIDonServer (Connection connection, JID jid, String resourceHint) throws XMPPException
static synchronized Registration getRegistrationInfo (Connection connection, String toRegister) throws XMPPException
static String getUserDirectoryService (Connection connection, String service)
static String getMultiUserChatService (Connection connection, String service)

Detailed Description

Utility class for classic XMPP operations


Member Function Documentation

static Registration de.fu_berlin.inf.dpp.net.util.XMPPUtils.createAccount ( String  server,
String  username,
String  password 
) throws XMPPException [static]

Creates the given account on the given XMPP server.

Parameters:
serverthe server on which to create the account
usernamefor the new account
passwordfor the new account
Returns:
null if the account was registered, otherwise a description is returned which may containing additional information on how to register an account on the given XMPP server or an error code
See also:
Registration.getError()
Exceptions:
XMPPExceptionexception that occurs while registering
static String de.fu_berlin.inf.dpp.net.util.XMPPUtils.getDisplayableName ( RosterEntry  entry) [static]
static String de.fu_berlin.inf.dpp.net.util.XMPPUtils.getMultiUserChatService ( Connection  connection,
String  service 
) [static]

Returns the service for multiuser chat.

Parameters:
connectionthe current XMPP connection
servicea service, normally the domain of a XMPP server
Returns:
the service for the multiuser chat or null if it could not be determined
static String de.fu_berlin.inf.dpp.net.util.XMPPUtils.getNickname ( XMPPConnectionService  connectionService,
JID  jid 
) [static]
Parameters:
connectionServicenetwork component that should be used to resolve the nickname or null to use the default one
jidthe JID to resolve the nickname for
Returns:
The nickname associated with the given JID in the current roster or null if the current roster is not available or the nickname has not been set.
static synchronized Registration de.fu_berlin.inf.dpp.net.util.XMPPUtils.getRegistrationInfo ( Connection  connection,
String  toRegister 
) throws XMPPException [static]

Retrieve XMPP Registration information from a server.

This implementation reuses code from Smack but also sets the from element of the IQ-Packet so that the server could reply with information that the account already exists as given by XEP-0077.

To see what additional information can be queried from the registration object, refer to the XEP directly:

http://xmpp.org/extensions/xep-0077.html

static String de.fu_berlin.inf.dpp.net.util.XMPPUtils.getUserDirectoryService ( Connection  connection,
String  service 
) [static]

Returns the service for a user directory. The user directory can be used to perform search queries.

Parameters:
connectionthe current XMPP connection
servicea service, normally the domain of a XMPP server
Returns:
the service for the user directory or null if it could not be determined

UserSearch#getSearchForm(Connection, String)

static boolean de.fu_berlin.inf.dpp.net.util.XMPPUtils.isJIDonServer ( Connection  connection,
JID  jid,
String  resourceHint 
) throws XMPPException [static]

Returns whether the given JID can be found on the server.

Parameters:
connection
Exceptions:
XMPPExceptionif the service discovery failed
static void de.fu_berlin.inf.dpp.net.util.XMPPUtils.removeFromRoster ( Connection  connection,
RosterEntry  rosterEntry 
) throws XMPPException [static]

Removes given contact from the Roster.

Parameters:
rosterEntrythe contact that is to be removed
Exceptions:
XMPPExceptionis thrown if no connection is established.
static void de.fu_berlin.inf.dpp.net.util.XMPPUtils.setDefaultConnectionService ( XMPPConnectionService  connectionService) [static]

Sets the default connection service that should be used when no connection is used for various utility methods offered by this class.

Parameters:
connectionService
 All Classes Namespaces Files Functions Variables Enumerations