USER - the generic type for the users object.ID - the generic type for the id the references to the user object.public class OnlineUsers<USER,ID> extends Object implements Serializable
| Constructor and Description |
|---|
OnlineUsers() |
| Modifier and Type | Method and Description |
|---|---|
ID |
addOnline(USER user,
ID sessionId)
Adds the user online.
|
ID |
getSessionId(USER user)
Gets the session id.
|
int |
getSize()
Gets the size of the online users.
|
USER |
getUser(ID sessionId)
Gets the user over the sessionId.
|
boolean |
isOnline(USER user)
Checks if the given user is online.
|
USER |
remove(ID sessionId)
Removes the user from the map with the session id.
|
ID |
removeOnline(USER user)
Removes the user from the map.
|
ID |
replaceSessionId(USER user,
ID oldSessionId,
ID newSessionId)
Replace the given old session id with the new one.
|
public ID addOnline(USER user, ID sessionId)
user - the usersessionId - the session idpublic ID getSessionId(USER user)
user - the userpublic int getSize()
public USER getUser(ID sessionId)
sessionId - the session idpublic boolean isOnline(USER user)
user - the userpublic USER remove(ID sessionId)
sessionId - the session idpublic ID removeOnline(USER user)
WebApplication#sessionUnbound(String).user - the userpublic ID replaceSessionId(USER user, ID oldSessionId, ID newSessionId)
user - the useroldSessionId - the old session idnewSessionId - the new session idCopyright © 2010–2016 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.