Interface SecurityService

    • Method Detail

      • setPassword

        User setPassword​(PrincipalKey key,
                         java.lang.String password)
      • createUser

        User createUser​(CreateUserParams createUserParams)
        Creates a user on the specified id provider.
        Parameters:
        createUserParams - details of the user to be created
        Returns:
        the user created
        Throws:
        PrincipalAlreadyExistsException - if a user with the same key already exists
      • updateUser

        User updateUser​(UpdateUserParams updateUserParams)
        Updates an existing user.
        Parameters:
        updateUserParams - details of the user to be updated
        Returns:
        the user updated
        Throws:
        PrincipalNotFoundException - if the specified user does not exist
      • getUser

        java.util.Optional<User> getUser​(PrincipalKey userKey)
        Looks up a user by key and returns an Optional with the user instance.
        Parameters:
        userKey - principal key of the user to retrieve
        Returns:
        an Optional with the user
      • getMemberships

        PrincipalKeys getMemberships​(PrincipalKey principalKey)
        Retrieve the list of principals (groups or roles) that have the specified principal as a member. The list returned will contain only direct memberships, i.e. not including transitive dependencies (group of a group).
        Parameters:
        principalKey - principal key to obtain memberships of
        Returns:
        a list of PrincipalKeys containing the list of groups and roles that the principal is a member of
      • getAllMemberships

        PrincipalKeys getAllMemberships​(PrincipalKey principalKey)
        Retrieve the list of principals (groups or roles) that have the specified principal as a member, directly or indirectly. The list returned will contain all memberships, including transitive dependencies (group of a group).
        Parameters:
        principalKey - principal key to obtain memberships of
        Returns:
        a list of PrincipalKeys containing the list of groups and roles that the principal is a member of
      • createGroup

        Group createGroup​(CreateGroupParams createGroupParams)
        Creates a group on the specified id provider.
        Parameters:
        createGroupParams - details of the group to be created
        Returns:
        the group created
        Throws:
        PrincipalAlreadyExistsException - if a group with the same key already exists
      • updateGroup

        Group updateGroup​(UpdateGroupParams updateGroupParams)
        Updates an existing group.
        Parameters:
        updateGroupParams - details of the group to be updated
        Returns:
        the group updated
        Throws:
        PrincipalNotFoundException - if the specified group does not exist
      • getGroup

        java.util.Optional<Group> getGroup​(PrincipalKey groupKey)
        Looks up a group by key and returns an Optional with the group instance.
        Parameters:
        groupKey - principal key of the group to retrieve
        Returns:
        an Optional with the group
      • createRole

        Role createRole​(CreateRoleParams createRoleParams)
        Creates a role on the specified id provider.
        Parameters:
        createRoleParams - details of the role to be created
        Returns:
        the role created
        Throws:
        PrincipalAlreadyExistsException - if a role with the same key already exists
      • updateRole

        Role updateRole​(UpdateRoleParams updateRoleParams)
        Updates an existing role.
        Parameters:
        updateRoleParams - details of the role to be updated
        Returns:
        the role updated
        Throws:
        PrincipalNotFoundException - if the specified role does not exist
      • getRole

        java.util.Optional<Role> getRole​(PrincipalKey roleKey)
        Looks up a role by key and returns an Optional with the role instance.
        Parameters:
        roleKey - principal key of the role to retrieve
        Returns:
        an Optional with the role
      • getPrincipal

        java.util.Optional<? extends Principal> getPrincipal​(PrincipalKey principalKey)
        Looks up a principal by key and returns an Optional with the principal instance.
        Parameters:
        principalKey - key of the principal to retrieve
        Returns:
        an Optional with the principal
      • getPrincipals

        Principals getPrincipals​(PrincipalKeys principalKeys)
        Looks up a set of principals by key and returns a list of with the Principals found. If one or more principal keys cannot be found, they will be omitted from the result.
        Parameters:
        principalKeys - keys of the principals to retrieve
        Returns:
        a Principals object containing the list of principals found
      • deletePrincipal

        void deletePrincipal​(PrincipalKey principalKey)
        Deletes an existing principal.
        Parameters:
        principalKey - key of the principal to be deleted
        Throws:
        PrincipalNotFoundException - if the specified principal does not exist
      • deleteIdProvider

        void deleteIdProvider​(IdProviderKey idProviderKey)
        Deletes an existing idProvider.
        Parameters:
        idProviderKey - key of the idProvider to be deleted
        Throws:
        IdProviderNotFoundException - if the specified idProvider does not exist
      • removeRelationships

        void removeRelationships​(PrincipalKey from)