public final class UserCache extends AbstractClientObject implements CloseableComponent, GroupMembershipResolver
Group
s and UserId
s 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
UserId s 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
UserId s 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, getClientContext
getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString
public UserCache(ClientContext clientCtx)
public java.util.List<Group> getGroupsOfUser(UserId userId)
GroupMembershipResolver
getGroupsOfUser
in interface GroupMembershipResolver
public 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()
UserId
s of all users defined on the server.public java.util.List<UserId> getOnlineUserIds()
UserId
s 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.AutoCloseable
public ToString toString(ToString s)
Dumpable
toString
in interface Dumpable
toString
in class DumpableObject
public DumpString toDumpString(DumpString s)
Dumpable
toDumpString
in interface Dumpable
toDumpString
in class DumpableObject
Copyright © 2014 EsprIT-Systems. All Rights Reserved.