Class RoleDataWebServiceImpl

    • Constructor Detail

      • RoleDataWebServiceImpl

        @Autowired
        public RoleDataWebServiceImpl​(RoleQueue queue)
    • Method Detail

      • saveRole

        public Response saveRole​(Role role)
        Description copied from interface: RoleDataWebService
        This method creates a new role or update existed one. For example:
        Specified by:
        saveRole in interface RoleDataWebService
        Parameters:
        role - - the Role object, which should be created or updated
        Returns:
        - a Response Object. If operation succeed then Response object contains the primary key of saved role otherwise it contains error code.
      • removeRole

        public Response removeRole​(String roleId)
        Description copied from interface: RoleDataWebService
        This method removes role from openIAM database for a particular roleID.
        Specified by:
        removeRole in interface RoleDataWebService
        Parameters:
        roleId - - The Role ID to be removed.
        Returns:
        - a Response Object which contains operation status.
      • getRole

        public Role getRole​(String roleId)
        Description copied from interface: RoleDataWebService
        Returns a paged List of Role objects that are linked to a Group.
        Specified by:
        getRole in interface RoleDataWebService
        Parameters:
        roleId - - the Group ID
        Returns:
        a paged List of Role objects that are linked to a Group. if no roles are found returns null
      • suggestById

        public Role suggestById​(String id)
        Description copied from interface: RoleDataWebService
        Find a resource in Elasticsearch. Significantly faster than going to the database. Use this method when performance is important and/or data integrity is not 100% required, as the database and ES may be out of sync for a period of time
        Specified by:
        suggestById in interface RoleDataWebService
        Parameters:
        id - the role id
        Returns:
        resource
      • addGroupToRole

        public Response addGroupToRole​(String roleId,
                                       String groupId,
                                       Set<String> rightIds,
                                       Date startDate,
                                       Date endDate)
        Description copied from interface: RoleDataWebService
        This method adds particular roleId to a particular group.
        Specified by:
        addGroupToRole in interface RoleDataWebService
        Parameters:
        roleId - The roleId which is to be added to the group.
        groupId - The group for which the roleId is to be added .
        Returns:
        a Response Object, containing the status of this operation.
      • removeGroupFromRole

        public Response removeGroupFromRole​(String roleId,
                                            String groupId)
        Description copied from interface: RoleDataWebService
        Removes the association between a single group and role.
        Specified by:
        removeGroupFromRole in interface RoleDataWebService
        Parameters:
        roleId - The roleId which is to be deleted from the group.
        groupId - The group from which the roleId is to be deleted
        Returns:
        a Response Object, containing the status of this operation.
      • findBeans

        public RoleListResponse findBeans​(RoleSearchBean searchBean,
                                          EntitlementsCollection[] dependants,
                                          int from,
                                          int size)
        Description copied from interface: RoleDataWebService
        Return a paged List of Roles based on parameters, which are specified in RoleSearchBean object
        Specified by:
        findBeans in interface RoleDataWebService
        Parameters:
        searchBean - - RoleSearchBean object
        dependants - - collection instead of deep copy flag
        from - - where to start in the list
        size - - how many to return
        Returns:
        List of Roles objects. Returns null if no roles are found.
      • countBeans

        public int countBeans​(RoleSearchBean searchBean)
        Description copied from interface: RoleDataWebService
        Returns total number of Roles based on parameters, which are specified in RoleSearchBean object
        Specified by:
        countBeans in interface RoleDataWebService
        Parameters:
        searchBean - - RoleSearchBean object
        Returns:
        - Integer, total number of roles based on parameters, which are specified in RoleSearchBean object
      • addChildRole

        public Response addChildRole​(String roleId,
                                     String childRoleId,
                                     Set<String> rights,
                                     Date startDate,
                                     Date endDate)
        Description copied from interface: RoleDataWebService
        Makes Role specified by childRoleId a child of Role specified by roleId
        Specified by:
        addChildRole in interface RoleDataWebService
        Parameters:
        roleId - - the Role ID to which another group specified by childRoleId will be added
        childRoleId - - - the Role ID which will be added to the group specified by roleId
        Returns:
        a Response Object, containing the status of this operation.
      • removeChildRole

        public Response removeChildRole​(String roleId,
                                        String childRoleId)
        Description copied from interface: RoleDataWebService
        Remove Role specified by childRoleId from the membership list of Group specified by roleId
        Specified by:
        removeChildRole in interface RoleDataWebService
        Parameters:
        roleId - - the Role ID from which another group specified by childRoleId will be deleted
        childRoleId - - the Role ID which will be deleted from the group specified by roleId
        Returns:
        a Response Object, containing the status of this operation.
      • canAddUserToRole

        public Response canAddUserToRole​(String userId,
                                         String roleId)
        Description copied from interface: RoleDataWebService
        Checks if User specified by userId can be added to the Role specified by roleId as a member
        Specified by:
        canAddUserToRole in interface RoleDataWebService
        Parameters:
        userId - - the User ID
        roleId - - the Role ID
        Returns:
        a Response Object, containing the status of this operation. if status is SUCCESS then the User can be added to this Role
      • canRemoveUserFromRole

        public Response canRemoveUserFromRole​(String userId,
                                              String roleId)
        Description copied from interface: RoleDataWebService
        Checks if User specified by userId can be removed from the Role specified by roleId as a member
        Specified by:
        canRemoveUserFromRole in interface RoleDataWebService
        Parameters:
        userId - - the User ID
        roleId - - the Role ID
        Returns:
        a Response Object, containing the status of this operation. if status is SUCCESS then the User can be removed from this Role
      • getDetachedForUser

        public RoleListResponse getDetachedForUser​(String userId,
                                                   String name,
                                                   int from,
                                                   int size)
        Description copied from interface: RoleDataWebService
        method is used to detect all user's role that are not linked with any resources.
        Specified by:
        getDetachedForUser in interface RoleDataWebService
        Parameters:
        userId - - id of User to check detached roles
        name - - name for case INSENSITIVE CONTAINS match search.
        from - - zero based very first result
        Returns:
        - RoleListResponse
      • getWithResources

        public RoleListResponse getWithResources​(String userId,
                                                 RoleSearchBean searchBean,
                                                 Set<String> resourceTypeIds,
                                                 int from,
                                                 int size)
        Description copied from interface: RoleDataWebService
        method is used to get user's roles with entitled resources, filtered by #resourceTypeIds. Resources are returned in Role#getResources() container (only ids).
        Specified by:
        getWithResources in interface RoleDataWebService
        Parameters:
        userId - - user id
        searchBean - - searchBean for objects
        resourceTypeIds - - types of resources to fetch
        from - - zero based very first result
        size - - total size of page.
        Returns:
        GroupListResponse with requested objects