public class JabberContext
extends java.lang.Object
The session context. It contains information such as login, password, and other session specific information.
Because the context contains session information, it also stores the session ID. The session ID is the ID sent by the server after connection is established.
If you set the username and password both to null, Jabber User Service will create an anonymous resource if the server supports it. If you don't know what it is, don't worry about it.
Also, this is the place to set whether to use SSL to connect to the jabber server for better security
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
static java.lang.String |
DEFAULT_SERVER |
static int |
DEFAULT_SSL_PORT |
| Constructor and Description |
|---|
JabberContext(java.lang.String username,
java.lang.String password,
java.lang.String serverName)
the default required parameters used by Jabber.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getPassword() |
java.lang.String |
getResource() |
java.lang.String |
getServerName()
normally, this information can be obtained from the connection model.
|
JID |
getServerNameJID() |
java.lang.String |
getSessionID() |
java.lang.String |
getUsername() |
boolean |
isSSL()
replies true if this is a SSL connection
|
void |
setPassword(java.lang.String password) |
void |
setResource(java.lang.String resource)
sets the resource name associated with this session.
|
void |
setServerName(java.lang.String serverName)
sets the server name that this session will connect to.
|
void |
setSessionID(java.lang.String sessionID)
sets the session ID (normally used only during handshake) and should not be changed
|
void |
setSSL(boolean secure)
switches the connection between secure and in-secure (default) connection
|
void |
setUsername(java.lang.String username) |
public static final java.lang.String DEFAULT_SERVER
public static final int DEFAULT_PORT
public static final int DEFAULT_SSL_PORT
public JabberContext(java.lang.String username,
java.lang.String password,
java.lang.String serverName)
username - the usernamepassword - the password for the userserverName - the canonical name of the server name as specificied by the Jabber server itself.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
public void setSSL(boolean secure)
public boolean isSSL()
public JID getServerNameJID()
public java.lang.String getServerName()
public void setServerName(java.lang.String serverName)
throws ParseException
ParseExceptionpublic java.lang.String getSessionID()
public void setSessionID(java.lang.String sessionID)
public java.lang.String getResource()
public void setResource(java.lang.String resource)
Copyright © 2001-2005 Echomine. All Rights Reserved.