public class EzyZoneUserManagerImpl extends EzyAbstractUserManager implements EzyZoneUserManager, com.tvd12.ezyfox.util.EzyStartable
| Modifier and Type | Class and Description |
|---|---|
static class |
EzyZoneUserManagerImpl.Builder |
| Modifier and Type | Field and Description |
|---|---|
protected long |
idleValidationDelay |
protected long |
idleValidationInterval |
protected ScheduledExecutorService |
idleValidationService |
protected int |
idleValidationThreadPoolSize |
protected EzyUserDelegate |
userDelegate |
protected ConcurrentHashMap<EzySession,EzyUser> |
usersBySession |
protected String |
zoneName |
locks, maxUsers, usersById, usersByName| Modifier | Constructor and Description |
|---|---|
protected |
EzyZoneUserManagerImpl(EzyZoneUserManagerImpl.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addUser(EzySession session,
EzyUser user)
Add user
|
void |
bind(EzySession session,
EzyUser user)
Add user
|
static EzyZoneUserManagerImpl.Builder |
builder() |
boolean |
containsUser(EzySession session)
Check whether contains user or not
|
protected void |
delegateUserRemove(EzyUser user,
com.tvd12.ezyfox.constant.EzyConstant reason) |
void |
destroy() |
protected String |
getMessagePrefix() |
EzyUser |
getUser(EzySession session)
Get user by id
|
protected boolean |
isIdleUser(EzyUser user) |
protected ScheduledExecutorService |
newIdleValidationService(long maxIdleTime) |
void |
removeUser(EzyUser user,
com.tvd12.ezyfox.constant.EzyConstant reason)
Remove user
|
protected boolean |
shouldRemoveUserNow(EzyUser user) |
void |
start() |
protected void |
startIdleValidationService() |
void |
unmapSessionUser(EzySession session,
com.tvd12.ezyfox.constant.EzyConstant reason)
Unmap session has mapped to user
|
protected void |
validateIdleUsers() |
addUser, addUser0, available, checkMaxUsers, clear, containsUser, containsUser, getLock, getMaxUsers, getUser, getUser, getUserCount, getUserList, newLocksMap, newUsersByIdMap, newUsersByName, removeLock, removeUser, removeUser0clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddUser, available, clear, containsUser, containsUser, containsUser, getLock, getMaxUsers, getUser, getUser, getUserCount, getUserList, removeLock, removeUser, removeUser, removeUserprotected final String zoneName
protected final EzyUserDelegate userDelegate
protected final long idleValidationDelay
protected final long idleValidationInterval
protected final int idleValidationThreadPoolSize
protected final ScheduledExecutorService idleValidationService
protected final ConcurrentHashMap<EzySession,EzyUser> usersBySession
protected EzyZoneUserManagerImpl(EzyZoneUserManagerImpl.Builder builder)
protected ScheduledExecutorService newIdleValidationService(long maxIdleTime)
public void addUser(EzySession session, EzyUser user)
EzyZoneUserManageraddUser in interface EzyZoneUserManagersession - the sessionuser - the userpublic void bind(EzySession session, EzyUser user)
EzyZoneUserManagerbind in interface EzyZoneUserManagersession - the sessionuser - the userpublic EzyUser getUser(EzySession session)
EzyZoneUserManagergetUser in interface EzyZoneUserManagersession - the user sessionpublic boolean containsUser(EzySession session)
EzyZoneUserManagercontainsUser in interface EzyZoneUserManagersession - the user sessionpublic void unmapSessionUser(EzySession session, com.tvd12.ezyfox.constant.EzyConstant reason)
EzyZoneUserManagerunmapSessionUser in interface EzyZoneUserManagersession - the sessionprotected boolean shouldRemoveUserNow(EzyUser user)
public void removeUser(EzyUser user, com.tvd12.ezyfox.constant.EzyConstant reason)
EzyZoneUserManagerremoveUser in interface EzyZoneUserManageruser - the userreason - the reasonpublic void start()
throws Exception
start in interface com.tvd12.ezyfox.util.EzyStartableExceptionprotected void startIdleValidationService()
protected void validateIdleUsers()
protected boolean isIdleUser(EzyUser user)
protected void delegateUserRemove(EzyUser user, com.tvd12.ezyfox.constant.EzyConstant reason)
public void destroy()
destroy in interface com.tvd12.ezyfox.util.EzyDestroyabledestroy in class EzyAbstractUserManagerprotected String getMessagePrefix()
getMessagePrefix in class EzyAbstractUserManagerpublic static EzyZoneUserManagerImpl.Builder builder()
Copyright © 2021 Young Monkeys. All rights reserved.