public final class SessionManager extends AbstractServerObject<ServerContext> implements PermissionControlled
| Modifier and Type | Field and Description |
|---|---|
static PermissionDefinition |
permissionDef |
| Constructor and Description |
|---|
SessionManager(ServerContext serverCtx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSession(Session session) |
void |
closeAllSessions()
Closes all sessions without notification to the clients
|
void |
closeSession(SessionId sessionId) |
ServerNetworkAdapter |
fetchNetworkAdapterFor(SessionId sessionId) |
Session |
fetchSessionBySessionId(SessionId sessId) |
Session |
findSessionBySessionId(SessionId sessId) |
SessionId |
findSessionIdBySID(int sid) |
java.util.List<SessionId> |
findSessionIdsByUserName(java.lang.String userName) |
java.util.List<SessionId> |
findSessionsIdsByUserId(UserId userId) |
java.util.List<CoSessionId> |
getCoClientSessionIds()
Returns the session contexts of co-clients only
|
int |
getLoginCount()
Counts the number of users currently logged in
|
int |
getLoginCount(UserId userId)
Counts how often the given user is logged in
|
ServerMessageDispatcher |
getMessageDispatcher() |
java.util.List<UserId> |
getOnlineUserIds()
Returns the
UserIds of all logged in users. |
PermissionDefinition |
getPermissionDefinition()
Returns an object that identifies a
PermissionControlled object with a unique name
and provides a list of supported assignable permissions. |
Session |
getSession(int i) |
int |
getSessionCount() |
java.util.List<SessionId> |
getSessionIds()
Returns the SessionIds of all sessions including co-clients
|
java.util.List<SessionId> |
getSessionIds(boolean isIncludeCoClients)
Returns the session contexts of normal clients (no co-clients)
|
static boolean |
isMessageDeliverable(Session session,
NetMessage msg) |
boolean |
isUserLoggedIn(java.lang.String userName) |
boolean |
isUserLoggedIn(User user) |
void |
loginUser(SessionId sessionId,
User user) |
void |
logoutAllUsers() |
void |
logoutUser(SessionId sessId) |
void |
sendNetMessage(NetMessage msg) |
void |
setMessageDispatcher(ServerMessageDispatcher dispatcher) |
SessionId |
setUserIdForSession(SessionId sessId,
UserId userId) |
void |
updateUserSessions(UserId userId) |
checkPermission, getServerConfig, getServerContext, getStatisticManager, toStringgetApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannelconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toStringpublic static final PermissionDefinition permissionDef
public SessionManager(ServerContext serverCtx)
public final PermissionDefinition getPermissionDefinition()
PermissionControlledPermissionControlled object with a unique name
and provides a list of supported assignable permissions.getPermissionDefinition in interface PermissionControlledpublic void setMessageDispatcher(ServerMessageDispatcher dispatcher)
public ServerMessageDispatcher getMessageDispatcher()
public void addSession(Session session)
public void loginUser(SessionId sessionId, User user) throws java.lang.Exception
java.lang.Exceptionpublic void logoutUser(SessionId sessId) throws SessionNotFoundException
SessionNotFoundExceptionpublic java.util.List<UserId> getOnlineUserIds()
UserIds of all logged in users.
Even if a users is logged in multiple times it will appear only once in the list.public void closeSession(SessionId sessionId)
public Session getSession(int i)
public SessionId setUserIdForSession(SessionId sessId, UserId userId) throws java.lang.Exception
java.lang.Exceptionpublic Session fetchSessionBySessionId(SessionId sessId) throws SessionNotFoundException
SessionNotFoundExceptionpublic ServerNetworkAdapter fetchNetworkAdapterFor(SessionId sessionId) throws SessionNotFoundException
SessionNotFoundExceptionpublic SessionId findSessionIdBySID(int sid)
public java.util.List<SessionId> findSessionIdsByUserName(java.lang.String userName)
public final boolean isUserLoggedIn(User user)
public final boolean isUserLoggedIn(java.lang.String userName)
public final java.util.List<SessionId> getSessionIds()
public final java.util.List<SessionId> getSessionIds(boolean isIncludeCoClients)
public final java.util.List<CoSessionId> getCoClientSessionIds()
public final void sendNetMessage(NetMessage msg)
public static boolean isMessageDeliverable(Session session, NetMessage msg)
public int getSessionCount()
public void updateUserSessions(UserId userId)
public int getLoginCount()
public int getLoginCount(UserId userId)
public void logoutAllUsers()
public void closeAllSessions()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.