public final class UserCache extends AbstractClientObject implements CloseableComponent, GroupMembershipResolver
Groups and UserIds which are configured in the server.
The cache is kept dynamically up to date, such that no further requests must be made, if user
or group data is required.| Constructor and Description |
|---|
UserCache(ClientContext clientCtx) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
java.util.List<Group> |
getAllGroups()
Returns the
Group objects of all groups defined on the server. |
java.util.List<UserId> |
getAllUserIds()
Returns the
UserIds of all users defined on the server. |
java.util.List<Group> |
getGroupsOfUser(UserId userId)
Returns all groups the given user is member of.
|
java.util.List<UserId> |
getOnlineUserIds()
Returns the
UserIds of all users which are currently logged in on the server
This list is dynamically kept up to date. |
UserId |
getUserIdFor(int uid) |
UserId |
getUserIdFor(java.lang.String userName) |
java.lang.String |
getUserNameFor(int uid) |
java.util.List<UserId> |
getUsersOfGroup(Group group) |
void |
init(PowerList<Group> groupList,
PowerList<UserId> userList,
PowerList<UserId> onlineUserList) |
DumpString |
toDumpString(DumpString s)
This method allows subclasses to add values to the existing DumpString of the superclass.
|
ToString |
toString(ToString s)
This method allows subclasses to add values to the existing ToString of the superclass.
|
getClientConfig, getClientContextgetApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannelconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toStringpublic UserCache(ClientContext clientCtx)
public java.util.List<Group> getGroupsOfUser(UserId userId)
GroupMembershipResolvergetGroupsOfUser in interface GroupMembershipResolverpublic void init(PowerList<Group> groupList, PowerList<UserId> userList, PowerList<UserId> onlineUserList)
public java.util.List<Group> getAllGroups()
Group objects of all groups defined on the server.public java.util.List<UserId> getAllUserIds()
UserIds of all users defined on the server.public java.util.List<UserId> getOnlineUserIds()
UserIds of all users which are currently logged in on the server
This list is dynamically kept up to date.public UserId getUserIdFor(int uid)
public UserId getUserIdFor(java.lang.String userName)
public java.lang.String getUserNameFor(int uid)
public void close()
close in interface java.lang.AutoCloseablepublic ToString toString(ToString s)
DumpabletoString in interface DumpabletoString in class DumpableObjectpublic DumpString toDumpString(DumpString s)
DumpabletoDumpString in interface DumpabletoDumpString in class DumpableObjectCopyright © 2014 EsprIT-Systems. All Rights Reserved.