de.esprit.netsuite.client

## Class UserCache

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.netsuite.client.AbstractClientObject
      - - de.esprit.netsuite.client.UserCache

- All Implemented Interfaces:
    ApplicationObject, CloseableComponent, SimpleLogSupport, Dumpable, ClientObject, GroupMembershipResolver, java.lang.AutoCloseable

      public final class UserCache
      extends AbstractClientObject
      implements CloseableComponent, GroupMembershipResolver

  This class caches the `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.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserCache(ClientContext clientCtx)`

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class de.esprit.netsuite.client.AbstractClientObject

      `getClientConfig, getClientContext`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UserCache

          public UserCache(ClientContext clientCtx)

  - ### Method Detail

    - #### getGroupsOfUser

          public java.util.List<Group> getGroupsOfUser(UserId userId)

      Description copied from interface: `GroupMembershipResolver`
      Returns all groups the given user is member of.
      Specified by:
        `getGroupsOfUser` in interface `GroupMembershipResolver`

    - #### init

          public void init(PowerList<Group> groupList,
                  PowerList<UserId> userList,
                  PowerList<UserId> onlineUserList)

    - #### getAllGroups

          public java.util.List<Group> getAllGroups()

      Returns the `Group` objects of all groups defined on the server.

    - #### getAllUserIds

          public java.util.List<UserId> getAllUserIds()

      Returns the `UserId`s of all users defined on the server.

    - #### getOnlineUserIds

          public 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.

    - #### getUsersOfGroup

          public java.util.List<UserId> getUsersOfGroup(Group group)

    - #### getUserIdFor

          public UserId getUserIdFor(int uid)

    - #### getUserIdFor

          public UserId getUserIdFor(java.lang.String userName)

    - #### getUserNameFor

          public java.lang.String getUserNameFor(int uid)

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.lang.AutoCloseable`

    - #### toString

          public ToString toString(ToString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing ToString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toString` in interface `Dumpable`
      Overrides:
        `toString` in class `DumpableObject`

    - #### toDumpString

          public DumpString toDumpString(DumpString s)

      Description copied from interface: `Dumpable`
      This method allows subclasses to add values to the existing DumpString of the superclass. Usually subclasses only need to override this method.
      Specified by:
        `toDumpString` in interface `Dumpable`
      Overrides:
        `toDumpString` in class `DumpableObject`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.