|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.messenger.Session
org.jivesoftware.messenger.ClientSession
public class ClientSession
Represents a session between the server and a client.
Field Summary | |
---|---|
protected AuthToken |
authToken
The authentication token for this session. |
Fields inherited from class org.jivesoftware.messenger.Session |
---|
CHARSET, conn, sessionManager, status, STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED, STATUS_STREAMING |
Constructor Summary | |
---|---|
ClientSession(String serverName,
Connection connection,
StreamID streamID)
Creates a session with an underlying connection and permission protection. |
Method Summary | |
---|---|
boolean |
canFloodOfflineMessages()
Returns true if the offline messages of the user should be sent to the user when the user becomes online. |
static Session |
createSession(String serverName,
org.dom4j.io.XPPPacketReader reader,
SocketConnection connection)
Returns a newly created session between the server and a client. |
static Map<String,String> |
getAllowedIPs()
Returns the list of IP address that are allowed to connect to the server. |
AuthToken |
getAuthToken()
Returns the authentication token associated with this session. |
int |
getConflictCount()
Returns the number of conflicts detected on this session. |
Presence |
getPresence()
Obtain the presence of this session. |
String |
getUsername()
Returns the username associated with this session. |
void |
incrementConflictCount()
Increments the conflict by one. |
boolean |
isInitialized()
Flag indicating if this session has been initialized once coming online. |
boolean |
isOfflineFloodStopped()
Returns true if the user requested to not receive offline messages when sending an available presence. |
void |
process(Packet packet)
Process an XMPP packet. |
static void |
setAllowedIPs(Map<String,String> allowed)
Sets the list of IP address that are allowed to connect to the server. |
void |
setAnonymousAuth()
Initialize the session as an anonymous login. |
void |
setAuthToken(AuthToken auth,
UserManager userManager,
String resource)
Initialize the session with a valid authentication token and resource name. |
void |
setInitialized(boolean isInit)
Sets the initialization state of the session. |
void |
setOfflineFloodStopped(boolean offlineFloodStopped)
Sets if the user requested to not receive offline messages when sending an available presence. |
Presence |
setPresence(Presence presence)
Set the presence of this session |
String |
toString()
|
Methods inherited from class org.jivesoftware.messenger.Session |
---|
getAddress, getConnection, getCreationDate, getLastActiveDate, getNumClientPackets, getNumServerPackets, getServerName, getStatus, getStreamID, incrementClientPacketCount, incrementServerPacketCount, setAddress, setStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AuthToken authToken
Constructor Detail |
---|
public ClientSession(String serverName, Connection connection, StreamID streamID)
connection
- The connection we are proxyingMethod Detail |
---|
public static Session createSession(String serverName, org.dom4j.io.XPPPacketReader reader, SocketConnection connection) throws org.xmlpull.v1.XmlPullParserException, UnauthorizedException, IOException
serverName
- the name of the server where the session is connecting to.reader
- the reader that is reading the provided XML through the connection.connection
- the connection with the client.
org.xmlpull.v1.XmlPullParserException
UnauthorizedException
IOException
public static Map<String,String> getAllowedIPs()
public static void setAllowedIPs(Map<String,String> allowed)
allowed
- the list of IP address that are allowed to connect to the server.public String getUsername() throws UserNotFoundException
UserNotFoundException
- if a user is not associated with a session
(the session has not authenticated yet)public void setAuthToken(AuthToken auth, UserManager userManager, String resource) throws UserNotFoundException
auth
- the authentication token obtained from the AuthFactory.resource
- the resource this session authenticated under.userManager
- the user manager this authentication occured under.
UserNotFoundException
public void setAnonymousAuth()
Initialize the session as an anonymous login.
This automatically upgrades the session's status to authenticated and enables many features that are not available until authenticated (obtaining managers for example).
public AuthToken getAuthToken()
public boolean isInitialized()
public void setInitialized(boolean isInit)
isInit
- True if the session has been initializedisInitialized()
public boolean canFloodOfflineMessages()
public boolean isOfflineFloodStopped()
public void setOfflineFloodStopped(boolean offlineFloodStopped)
offlineFloodStopped
- if the user requested to not receive offline messages when
sending an available presence.public Presence getPresence()
public Presence setPresence(Presence presence)
presence
- The presence for the session
public int getConflictCount()
public void incrementConflictCount()
public void process(Packet packet)
ChannelHandler
packet
- a packet to process.public String toString()
toString
in class Session
|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |