|
Openfire 3.3.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.openfire.session.Session
org.jivesoftware.openfire.session.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.openfire.session.Session |
---|
CHARSET, conn, MAJOR_VERSION, MINOR_VERSION, 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. |
boolean |
canProcess(Packet packet)
Returns true if the specified packet must not be blocked based on the active or default privacy list rules. |
static Session |
createSession(String serverName,
org.xmlpull.v1.XmlPullParser xpp,
Connection connection)
Returns a newly created session between the server and a client. |
PrivacyList |
getActiveList()
Returns the Privacy list that overrides the default privacy list. |
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. |
String |
getAvailableStreamFeatures()
Returns a text with the available stream features. |
static Connection.CompressionPolicy |
getCompressionPolicy()
Returns whether compression is optional or is disabled for clients. |
int |
getConflictCount()
Returns the number of conflicts detected on this session. |
PrivacyList |
getDefaultList()
Returns the default Privacy list used for the session's user. |
Presence |
getPresence()
Obtain the presence of this session. |
static Connection.TLSPolicy |
getTLSPolicy()
Returns whether TLS is mandatory, optional or is disabled for clients. |
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 |
setActiveList(PrivacyList activeList)
Sets the Privacy list that overrides the default privacy list. |
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)
Sets the new Authorization Token for this session. |
void |
setAuthToken(AuthToken auth,
String resource)
Initialize the session with a valid authentication token and resource name. |
static void |
setCompressionPolicy(Connection.CompressionPolicy policy)
Sets whether compression is optional or is disabled for clients. |
void |
setDefaultList(PrivacyList defaultList)
Sets the default Privacy list used for the session's user. |
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 |
static void |
setTLSPolicy(Connection.TLSPolicy policy)
Sets whether TLS is mandatory, optional or is disabled for clients. |
String |
toString()
|
boolean |
wasAvailable()
Returns true if the session was available ever. |
Methods inherited from class org.jivesoftware.openfire.session.Session |
---|
decodeVersion, getAddress, getConnection, getCreationDate, getLastActiveDate, getNumClientPackets, getNumServerPackets, getServerName, getSessionData, getStatus, getStreamID, incrementClientPacketCount, incrementServerPacketCount, process, removeSessionData, setAddress, setSessionData, 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)
serverName
- name of the server.connection
- The connection we are proxying.streamID
- unique identifier of this session.Method Detail |
---|
public static Map<String,String> getAllowedIPs()
public static Session createSession(String serverName, org.xmlpull.v1.XmlPullParser xpp, Connection connection) throws org.xmlpull.v1.XmlPullParserException
serverName
- the name of the server where the session is connecting to.xpp
- the parser that is reading the provided XML through the connection.connection
- the connection with the client.
org.xmlpull.v1.XmlPullParserException
- if an error occurs while parsing incoming data.public static void setAllowedIPs(Map<String,String> allowed)
allowed
- the list of IP address that are allowed to connect to the server.public static Connection.TLSPolicy getTLSPolicy()
public static void setTLSPolicy(Connection.TLSPolicy policy)
policy
- whether TLS is mandatory, optional or is disabled.public static Connection.CompressionPolicy getCompressionPolicy()
public static void setCompressionPolicy(Connection.CompressionPolicy policy)
policy
- whether compression is optional or is disabled.public PrivacyList getActiveList()
public void setActiveList(PrivacyList activeList)
activeList
- the Privacy list that overrides the default privacy list.public PrivacyList getDefaultList()
public void setDefaultList(PrivacyList defaultList)
defaultList
- the default Privacy list used for the session's user.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)
auth
- the authentication token obtained from SASL authentication.public void setAuthToken(AuthToken auth, String resource)
auth
- the authentication token obtained from the AuthFactory.resource
- the resource this session authenticated under.public void setAnonymousAuth()
public AuthToken getAuthToken()
public boolean isInitialized()
public void setInitialized(boolean isInit)
isInit
- True if the session has been initializedisInitialized()
public boolean wasAvailable()
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 String getAvailableStreamFeatures()
Session
getAvailableStreamFeatures
in class Session
public void incrementConflictCount()
public boolean canProcess(Packet packet)
packet
- the packet to analyze if it must be blocked.
public String toString()
toString
in class Session
|
Openfire 3.3.0 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |