Interface IUserService

All Superinterfaces:
IComponent, IInitializable, IMetaComponent

public interface IUserService extends IMetaComponent
Allows manipulation of the local user/group/role list in the DB
  • Field Details

    • ADMIN_DBID

      static final int ADMIN_DBID
      The DB ID of the admin user is 1
      See Also:
    • EVERYONE_DBID

      static final int EVERYONE_DBID
      the db ID of the everyone group is 4
      See Also:
  • Method Details

    • getAdminUserID

      IThingID getAdminUserID()
      Get the ID of the admin user
    • getAdminUser

      IUser getAdminUser()
      get the admin user
    • getEveryoneGroupID

      IThingID getEveryoneGroupID()
      Get the ID of the everyone group
    • getEveryoneGroup

      IGroup getEveryoneGroup()
      get the everyone group
    • initializeUser

      IThingID initializeUser(IInitializableUser dsuser) throws MetaException
      Whenever you need to translate user data from LDAP into a IUser, you must call this function. It will load the user's group information and other metadata into the database for access control.
      Parameters:
      dsuser - User info from LDAP server
      Returns:
      thingID of user.
      Throws:
      MetaException - on DB or LDAP error
    • initializeGroup

      IThingID initializeGroup(IInitializableGroup group) throws MetaException
      Enters group metadata into the DB.
      Parameters:
      group - from LDAP
      Returns:
      thingID of group
      Throws:
      MetaException - on DB or LDAP error
    • initializeRole

      IThingID initializeRole(IInitializableRole role) throws MetaException
      Enters group metadata into the DB.
      Parameters:
      role - from LDAP
      Returns:
      thingID of group
      Throws:
      MetaException - on DB or LDAP error
    • getUsers

      IThingIDList getUsers(String dnPrefix, int startIndex, int endIndex) throws MetaException
      Generates a list of groups for specified DN prefix
      Parameters:
      dnPrefix - if null, returns all users
      startIndex - index of first item
      endIndex - index of last, -1 for all
      Returns:
      list of ID's that represent IUser
      Throws:
      MetaException - if invalid directory name or DB error
    • getUsers

      IThingIDList getUsers(IThingID directoryID, int startIndex, int endIndex) throws MetaException
      Generates a list of users for specified directory
      Parameters:
      directoryID - if 0, returns all users
      startIndex - index of first item
      endIndex - index of last, -1 for all
      Returns:
      list of ID's that represent IUser
      Throws:
      MetaException - if invalid directory name or DB error
    • getUsersCount

      default int getUsersCount(IThingID directoryID) throws MetaException
      Returns the number of all initialized users in MWS or for a particular directoryService
      Parameters:
      directoryID - - if null returns ALL users count, otherwise count for particular dirService only
      Throws:
      MetaException - if invalid directory name or DB error
    • getUsersCount

      default int getUsersCount(boolean includeInvalid) throws MetaException
      Returns the number of all initialized users in MWS or for a particular directoryService
      Parameters:
      includeInvalid - - if true, the service will include users which are not valid anymore(due to various reasons)
      Throws:
      MetaException - if invalid directory name or DB error
    • getGroups

      IThingIDList getGroups(String dnPrefix, int startIndex, int endIndex) throws MetaException
      Generates a list of groups for specified DN prefix
      Parameters:
      dnPrefix - if null, returns all users
      startIndex - index of first item
      endIndex - index of last, -1 for all
      Returns:
      list of ID's that represent IUser
      Throws:
      MetaException - if invalid directory name or DB error
    • getUserIDByURI

      IThingID getUserIDByURI(IURI uri) throws MetaException
      Looks up a user by a given URI. May throw exception if user never initialized
      Parameters:
      uri - URI of user
      Returns:
      thingID of user or null if not found
      Throws:
      MetaException - if DB error
    • getGroupIDByURI

      IThingID getGroupIDByURI(IURI uri) throws MetaException
      Looks up a group by a given URI. May throw exception if user never initialized
      Parameters:
      uri - URI of group
      Returns:
      thingID of group of null if not found
      Throws:
      MetaException - if DB error
    • getRoleIDByURI

      IThingID getRoleIDByURI(IURI uri) throws MetaException
      Looks up a role by a given URI. May throw exception if user never initialized
      Parameters:
      uri - URI of role
      Returns:
      thingID of role or null if not found
      Throws:
      MetaException - DB error
    • checkUser

      IThingID checkUser(IThingID userID) throws MetaException
      if this user is from another service, return the corresponding user from this service throws exception if not found
      Parameters:
      userID - of user to check
      Returns:
      new ID
      Throws:
      MetaException
    • setAdminUserURI

      void setAdminUserURI(IURI uri) throws MetaException
      Set the stored URI for the admin user.
      Parameters:
      uri -
      Throws:
      MetaException
    • setEveryoneGroupURI

      void setEveryoneGroupURI(IURI uri) throws MetaException
      Set the stored URI for the everyone group.
      Parameters:
      uri -
      Throws:
      MetaException
    • updateDirectoryName

      void updateDirectoryName(String oldDir, String newDir) throws MetaException
      Updates the directory name part of user/group/role dn's to a new name ex: updateDirectoryName("/directory/bellevue/", "/directory/usa/");
      Parameters:
      oldDir -
      newDir -
      Throws:
      MetaException
    • updateDistinguishedName

      void updateDistinguishedName(String oldDN, String newDN, int type) throws MetaException
      Updates the Distinguished name of user/group
      Parameters:
      oldDN -
      newDN -
      type -
      Throws:
      MetaException
    • updateUUID

      void updateUUID(String UUID, String DN, int type) throws MetaException
      Updates the UUID attribute for a DN
      Parameters:
      uuid -
      DN -
      type -
      Throws:
      MetaException
    • getUserUUIDFromDN

      String getUserUUIDFromDN(IURI uri) throws MetaException
      Get User UUID for a given URI
      Parameters:
      uri -
      Throws:
      MetaException
    • getUserDNFromUserUUID

      String getUserDNFromUserUUID(String uuid) throws MetaException
      Get DN details for a given UUID
      Parameters:
      uuid -
      Throws:
      MetaException
    • updateUserMemberships

      default void updateUserMemberships(IInitializableUser dsuser, BigDecimal updateTime) throws PortalException
      Throws:
      PortalException