Interface UserDirectory


@Deprecated public interface UserDirectory
Deprecated.
This class is deprecated and will be removed in a future release. Please use AuthenticationContext.getUserDirectory() to retrieve a UserDirectory instance instead.
This interface provides functionality to list and modify users and groups.
Since:
3.0
  • Field Details

    • OPERATION_READ_USERS

      static final int OPERATION_READ_USERS
      Deprecated.
      Constant specifying the operation of reading users.
      Since:
      3.0
      See Also:
    • OPERATION_WRITE_USERS

      static final int OPERATION_WRITE_USERS
      Deprecated.
      Constant specifying the operation of writing users.
      Since:
      3.0
      See Also:
    • OPERATION_READ_GROUPS

      static final int OPERATION_READ_GROUPS
      Deprecated.
      Constant specifying the operation of reading groups.
      Since:
      3.0
      See Also:
    • OPERATION_WRITE_GROUPS

      static final int OPERATION_WRITE_GROUPS
      Deprecated.
      Constant specifying the operation of writing groups.
      Since:
      3.0
      See Also:
    • SERVICE_PROVIDER_INTERNAL

      static final int SERVICE_PROVIDER_INTERNAL
      Deprecated.
      Constant specifying the internal service provider.
      Since:
      3.0
      See Also:
    • SERVICE_PROVIDER_EXTERNAL

      static final int SERVICE_PROVIDER_EXTERNAL
      Deprecated.
      Constant specifying the external service provider.
      Since:
      3.0
      See Also:
    • SERVICE_PROVIDER_ALL

      static final int SERVICE_PROVIDER_ALL
      Deprecated.
      Constant specifying the internal and external service providers.
      Since:
      3.0
      See Also:
  • Method Details

    • getUserPrincipal

      UserPrincipal getUserPrincipal(String name)
      Deprecated.
      Returns the user principal with the specified name in the internal SPOTFIRE domain from the directory.
      Parameters:
      name - the name of the user
      Returns:
      a UserPrincipal if the directory contains a user with the given name, or null if such a user does not exist
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getUserPrincipal

      UserPrincipal getUserPrincipal(String name, String domainName)
      Deprecated.
      Returns the user principal with the specified name and domain from the directory.
      Parameters:
      name - the name of the user
      domainName - the name of the user's domain
      Returns:
      a UserPrincipal if the directory contains a user with the given name, or null if such a user does not exist
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      5.0
    • getGroupPrincipal

      GroupPrincipal getGroupPrincipal(String name)
      Deprecated.
      Returns the group principal with the specified name in the internal SPOTFIRE domain from the directory.
      Parameters:
      name - the name of the group
      Returns:
      a GroupPrincipal if the directory contains a group with the given name, or null if such a group does not exist
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getGroupPrincipal

      GroupPrincipal getGroupPrincipal(String name, String domainName)
      Deprecated.
      Returns the group principal with the specified name and domain from the directory.
      Parameters:
      name - the name of the group
      domainName - the name of the group domain
      Returns:
      a GroupPrincipal if the directory contains a group with the given name, or null if such a group does not exist
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      5.0
    • getPrincipal

      SpotfirePrincipal getPrincipal(Guid guid)
      Deprecated.
      Returns the principal with the specified GUID from the directory.
      Parameters:
      guid - the GUID of the principal
      Returns:
      a UserPrincipal or a GroupPrincipal if the directory contains a principal with the given GUID, or null if such a principal does not exist
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getUserPrincipals

      UserPrincipal[] getUserPrincipals()
      Deprecated.
      Returns an array containing all user principals in the directory.
      Returns:
      an array containing all user principals
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getUserPrincipals

      UserPrincipal[] getUserPrincipals(String regExp)
      Deprecated.
      Returns an array containing all user principals with names that matches the given regular expression.
      Parameters:
      regExp - a regular expression following the syntax of the Pattern Java API
      Returns:
      an array containing all user principals with matching names
      Throws:
      IllegalArgumentException - if the given regular expression is invalid
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getGroupPrincipals

      GroupPrincipal[] getGroupPrincipals()
      Deprecated.
      Returns an array containing all group principals in the directory.
      Returns:
      an array containing all group principals
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getGroupPrincipals

      GroupPrincipal[] getGroupPrincipals(String regExp)
      Deprecated.
      Returns an array containing all group principals with names that matches the given regular expression.
      Parameters:
      regExp - a regular expression following the syntax of the Pattern Java API
      Returns:
      an array containing all group principals with matching names
      Throws:
      IllegalArgumentException - if the given regular expression is invalid
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getMembers

      SpotfirePrincipal[] getMembers(GroupPrincipal group)
      Deprecated.
      Returns an array containing all immediate members (both users and other groups) of a group in the directory. The method is not recursive and does not expand subgroups.
      Parameters:
      group - a group principal
      Returns:
      a SpotfirePrincipal array containing all immediate group members, where each member is either a UserPrincipal or a GroupPrincipal object.
      Throws:
      NoSuchPrincipalException - if the given group cannot be found in the directory
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • isMember

      boolean isMember(GroupPrincipal group, SpotfirePrincipal principal)
      Deprecated.
      Check if a principal is member of a group. This method is recursive and will check inherited groups.
      Parameters:
      group - a group principal
      principal - the principal to check membership for
      Returns:
      true if the given principal is a member of the group, otherwise false
      Throws:
      NoSuchPrincipalException - if the given group or principal cannot be found in the directory
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getGroups

      GroupPrincipal[] getGroups(SpotfirePrincipal principal)
      Deprecated.
      Returns an array containing all groups of which the specified principal is an immediate member. The method is not recursive and does not return inherited groups.
      Parameters:
      principal - the principal to retrieve groups for
      Returns:
      an array containing all group principals of which the given principal is an immediate member
      Throws:
      NoSuchPrincipalException - if the given principal cannot be found in the directory
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getDefaultGroups

      GroupPrincipal[] getDefaultGroups()
      Deprecated.
      Returns an array containing the default groups on the server. The default groups are automatically created during installation and must always exist.
      Returns:
      an array containing the default group principals
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getImmutableGroups

      GroupPrincipal[] getImmutableGroups()
      Deprecated.
      Returns an array containing all immutable groups on the server. The immutable groups cannot be modified.
      Returns:
      an array containing the immutable group principals
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • isImmutableGroup

      boolean isImmutableGroup(GroupPrincipal group)
      Deprecated.
      Returns true if the given group is immutable.
      Parameters:
      group - a group
      Returns:
      true if the given group is immutable, false otherwise
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • isDefaultGroup

      boolean isDefaultGroup(GroupPrincipal group)
      Deprecated.
      Returns true if the given group is a default group.
      Parameters:
      group - a group
      Returns:
      true if the given group is a default group, false otherwise
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • isAdministrator

      boolean isAdministrator(UserPrincipal user)
      Deprecated.
      Queries whether or not the given user is an administrator of the server, i.e. is a member of the Administrator group.
      Parameters:
      user - a user
      Returns:
      true if the given user is an administrator, false otherwise
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • getAdministratorGroup

      GroupPrincipal getAdministratorGroup()
      Deprecated.
      Returns the Administrator group principal.
      Returns:
      the Administrator group principal
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • createUserPrincipal

      UserPrincipal createUserPrincipal(String name, String password)
      Deprecated.
      Creates a new user principal in the directory.
      Parameters:
      name - the name of the user principal to be created
      password - the password for the user principal to be created
      Returns:
      the created user principal
      Throws:
      PrincipalAlreadyExistsException - if a principal with the specified name already exists in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support creating user principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • createUserPrincipal

      UserPrincipal createUserPrincipal(String name, String domainName, String password)
      Deprecated.
      Creates a new user principal in the directory.
      Parameters:
      name - the name of the user principal to be created
      domainName - the name of the user's domain
      password - the password for the user principal to be created
      Returns:
      the created user principal
      Throws:
      PrincipalAlreadyExistsException - if a principal with the specified name already exists in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support creating user principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      5.0
    • setPassword

      void setPassword(UserPrincipal user, String password)
      Deprecated.
      Changes the password for a user.
      Parameters:
      user - the user whose password to change
      password - the new password
      Throws:
      NoSuchPrincipalException - if the given user principal cannot be found in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support modifying passwords
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • createGroupPrincipal

      GroupPrincipal createGroupPrincipal(String name)
      Deprecated.
      Creates a new group principal in the directory.
      Parameters:
      name - the name of the group principal to be created
      Returns:
      the created group principal
      Throws:
      PrincipalAlreadyExistsException - if a principal with the specified name already exists in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support creating group principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • removePrincipal

      void removePrincipal(SpotfirePrincipal principal)
      Deprecated.
      Removes a principal from the directory.
      Parameters:
      principal - the principal to be removed
      Throws:
      NoSuchPrincipalException - if the given principal cannot be found in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support removing principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • renamePrincipal

      void renamePrincipal(SpotfirePrincipal principal, String name)
      Deprecated.
      Changes the name of a principal in the directory.
      Parameters:
      principal - the principal to change the name for
      name - the new name
      Throws:
      NoSuchPrincipalException - if the given principal cannot be found in the directory
      PrincipalAlreadyExistsException - if a principal with the specified name already exists in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support renaming principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • addMember

      void addMember(GroupPrincipal group, SpotfirePrincipal principal)
      Deprecated.
      Adds a member to a group principal in the directory.
      Parameters:
      group - the group principal to add a member to
      principal - the principal to be added as a member
      Throws:
      NoSuchPrincipalException - if the group or the principal cannot be found in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support modifying group principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • removeMember

      void removeMember(GroupPrincipal group, SpotfirePrincipal principal)
      Deprecated.
      Removes a member from a group in the directory. Does nothing if the principal is not a member of the group.
      Parameters:
      group - the group principal to remove a member from
      principal - the principal to be removed as a member
      Throws:
      NoSuchPrincipalException - if any of the given principals cannot be found in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support modifying group principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • setMembers

      void setMembers(GroupPrincipal group, SpotfirePrincipal[] principals)
      Deprecated.
      Sets all members of a group. All previous members of the group will be removed before the new members are added.
      Parameters:
      group - the group principal to set members for
      principals - the new group members
      Throws:
      NoSuchPrincipalException - if any of the given principals cannot be found in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support modifying group principals
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • setGroups

      void setGroups(SpotfirePrincipal principal, GroupPrincipal[] groups)
      Deprecated.
      Set all groups that a principal belongs to. This method will remove all previous groups of the principal.
      Parameters:
      principal - the principal to set group membership for
      groups - the groups which the principal should be a member of
      Throws:
      NoSuchPrincipalException - if the principal or any of the group principals cannot be found in the directory
      ReadOnlyDirectoryException - if the directory is configured with a service provider that does not support modifying group principals
      UserDirectoryException - if an error occurred in the underlying system
      Since:
      3.0
    • getPrimaryGroup

      GroupPrincipal getPrimaryGroup(SpotfirePrincipal principal)
      Deprecated.
      Returns the specified principal's primary group.
      Parameters:
      principal - the principal whose primary group should be return
      Returns:
      the principal's primary group
      Throws:
      UserDirectoryException - if an error occurred in the service provider
      Since:
      3.0
    • setPrimaryGroup

      void setPrimaryGroup(SpotfirePrincipal principal, GroupPrincipal primaryGroup)
      Deprecated.
      Sets the primary group for the specified principal. The principal must already be a direct member of the primary group. This method will overwrite any previous primary group. To delete a primary group association, call this method with the primaryGroup argument set to null.
      Parameters:
      principal - the principal to set the primary group for
      primaryGroup - the principal's primary group
      Throws:
      UserDirectoryException - if the specified primary group is invalid
      Since:
      3.0
    • isOperationSupported

      boolean isOperationSupported(int operation, int serviceProvider)
      Deprecated.
      Check if an operation is supported by the user directory or not.
      Parameters:
      operation - OPERATION_READ_USERS, OPERATION_WRITE_USERS, OPERATION_READ_GROUPS or OPERATION_WRITE_GROUPS.
      serviceProvider - SERVICE_PROVIDER_INTERNAL, SERVICE_PROVIDER_EXTERNAL or SERVICE_PROVIDER_ALL.
      Returns:
      true if the operation is supported, false otherwise.
      Since:
      3.0
    • getGroupsRecursive

      GroupPrincipal[] getGroupsRecursive(SpotfirePrincipal principal)
      Deprecated.
      Returns an array containing all groups of which the specified principal is a member. The method is recursive and will return inherited groups.
      Parameters:
      principal - the principal to retrieve groups for
      Returns:
      an array containing all group principals of which the given principal is a member
      Throws:
      NoSuchPrincipalException - if the given principal cannot be found in the directory
      UserDirectoryException - if an error occurred in the underlying system
      Since:
      3.0