public interface ISession
Modifier and Type | Method and Description |
---|---|
void |
addDroppedMessages(int amount) |
void |
addReadBytes(long amount) |
void |
addWrittenBytes(long amount) |
void |
close() |
void |
freeze() |
java.lang.String |
getAddress()
Get the session IP address
|
int |
getClientPort()
Get the client side TCP port number
|
java.nio.channels.SocketChannel |
getConnection() |
long |
getCreationTime()
The timestamp at which the connection was done (milliseconds Unix Time)
|
java.lang.Object |
getCryptoKey() |
java.nio.channels.DatagramChannel |
getDatagramChannel() |
int |
getDroppedMessages()
The number of messages that were dropped since the connection
|
long |
getFreezeTime() |
java.lang.String |
getFullIpAddress()
Get the IPAddress and Port of the user as a String in the format "1.2.3.4:1234"
|
java.lang.String |
getFullServerIpAddress()
Get the full server address and port to which the user connected to, in the form "1.2.3.4:1234"
|
java.lang.String |
getHashId()
A unique string token used as an alternative session ID
|
int |
getId()
Get the unique session Id
|
long |
getLastActivityTime()
The last time that the session has sent a packet (milliseconds Unix Time)
|
long |
getLastLoggedInActivityTime()
The last time that the session has sent a request (milliseconds Unix Time)
|
long |
getLastReadTime() |
long |
getLastWriteTime() |
int |
getMaxIdleTime()
Get the maximum time of socket inactivity after which the system will consider the User "idle" and disconnect it.
|
int |
getMaxLoggedInIdleTime()
Get the maximum time of User inactivity after which the system will consider the session "idle" and disconnect it.
|
java.lang.String |
getNodeId()
Return the node Id in a cluster
|
com.smartfoxserver.bitswarm.sessions.IPacketQueue |
getPacketQueue() |
java.lang.Object |
getProperty(java.lang.String key) |
long |
getReadBytes()
The amount of data in bytes that the client has sent so far
|
int |
getReconnectionSeconds()
Get the interval of time allowed for a Session to attempt a reconnection after and abrupt loss of connection.
|
java.lang.String |
getServerAddress()
Get the server address to which the user connected to
|
int |
getServerPort()
Get the server port to which the user connected to
|
com.smartfoxserver.bitswarm.sessions.ISessionManager |
getSessionManager() |
java.lang.Object |
getSystemProperty(java.lang.String key) |
SessionType |
getType()
Get the Session type
|
long |
getWrittenBytes()
The amount of data that was sent to the client so far
|
boolean |
isConnected()
Check if the session is connected.
|
boolean |
isEncrypted() |
boolean |
isFrozen() |
boolean |
isIdle() |
boolean |
isLocal()
See if the Session is local or hosted in another cluster node.
|
boolean |
isLoggedIn()
Check if the the Session is logged in.
|
boolean |
isMarkedForEviction() |
boolean |
isReconnectionTimeExpired() |
boolean |
isUdpEnabled() |
void |
removeProperty(java.lang.String key) |
void |
removeSystemProperty(java.lang.String key) |
void |
setConnected(boolean value) |
void |
setConnection(java.nio.channels.SocketChannel connection) |
void |
setCreationTime(long timestamp) |
void |
setCryptoKey(java.lang.Object key) |
void |
setDatagramChannel(java.nio.channels.DatagramChannel channel) |
void |
setHashId(java.lang.String hash) |
void |
setId(int id) |
void |
setLastActivityTime(long timestamp) |
void |
setLastLoggedInActivityTime(long timestamp) |
void |
setLastReadTime(long timestamp) |
void |
setLastWriteTime(long timestamp) |
void |
setLoggedIn(boolean value) |
void |
setMarkedForEviction() |
void |
setMaxIdleTime(int idleTime) |
void |
setMaxLoggedInIdleTime(int idleTime) |
void |
setNodeId(java.lang.String nodeId) |
void |
setPacketQueue(com.smartfoxserver.bitswarm.sessions.IPacketQueue queue) |
void |
setProperty(java.lang.String key,
java.lang.Object property) |
void |
setReconnectionSeconds(int value) |
void |
setSessionManager(com.smartfoxserver.bitswarm.sessions.ISessionManager manager) |
void |
setSystemProperty(java.lang.String key,
java.lang.Object property) |
void |
setType(SessionType type) |
void |
unfreeze() |
int getId()
void setId(int id)
java.lang.String getHashId()
void setHashId(java.lang.String hash)
SessionType getType()
SessionType
void setType(SessionType type)
java.lang.String getNodeId()
void setNodeId(java.lang.String nodeId)
boolean isLocal()
boolean isLoggedIn()
void setLoggedIn(boolean value)
com.smartfoxserver.bitswarm.sessions.IPacketQueue getPacketQueue()
void setPacketQueue(com.smartfoxserver.bitswarm.sessions.IPacketQueue queue)
java.nio.channels.SocketChannel getConnection()
void setConnection(java.nio.channels.SocketChannel connection)
java.nio.channels.DatagramChannel getDatagramChannel()
void setDatagramChannel(java.nio.channels.DatagramChannel channel)
long getCreationTime()
void setCreationTime(long timestamp)
boolean isConnected()
void setConnected(boolean value)
long getLastActivityTime()
void setLastActivityTime(long timestamp)
long getLastLoggedInActivityTime()
void setLastLoggedInActivityTime(long timestamp)
long getLastReadTime()
void setLastReadTime(long timestamp)
long getLastWriteTime()
void setLastWriteTime(long timestamp)
long getReadBytes()
void addReadBytes(long amount)
long getWrittenBytes()
void addWrittenBytes(long amount)
int getDroppedMessages()
void addDroppedMessages(int amount)
int getMaxIdleTime()
NOTE: This is valid until the client is not logged in, then the maxLoggedInIdleTime will be used.
void setMaxIdleTime(int idleTime)
int getMaxLoggedInIdleTime()
NOTE: This applies only if the client is logged in.
void setMaxLoggedInIdleTime(int idleTime)
boolean isMarkedForEviction()
void setMarkedForEviction()
boolean isIdle()
boolean isFrozen()
void freeze()
void unfreeze()
long getFreezeTime()
boolean isReconnectionTimeExpired()
java.lang.Object getSystemProperty(java.lang.String key)
void setSystemProperty(java.lang.String key, java.lang.Object property)
void removeSystemProperty(java.lang.String key)
java.lang.Object getProperty(java.lang.String key)
void setProperty(java.lang.String key, java.lang.Object property)
void removeProperty(java.lang.String key)
java.lang.String getFullIpAddress()
java.lang.String getAddress()
int getClientPort()
java.lang.String getServerAddress()
int getServerPort()
java.lang.String getFullServerIpAddress()
com.smartfoxserver.bitswarm.sessions.ISessionManager getSessionManager()
void setSessionManager(com.smartfoxserver.bitswarm.sessions.ISessionManager manager)
void close() throws java.io.IOException
java.io.IOException
int getReconnectionSeconds()
void setReconnectionSeconds(int value)
boolean isEncrypted()
java.lang.Object getCryptoKey()
void setCryptoKey(java.lang.Object key)
boolean isUdpEnabled()