Package org.openwms.core.uaa
Interface RoleService
- All Known Implementing Classes:
RoleServiceImpl
public interface RoleService
A RoleService provides business functionality regarding the handling with
Role
s. The service deals directly with business
objects, even those are currently acting as entities as well. But this may change in future and should not influence the interface.- Author:
- Heiko Scherrer
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NotNull RoleVO
assignUser
(@NotBlank String pKey, @NotBlank String userPKey) Assign anUser
to aRole
.@NotNull RoleVO
create
(@NotNull(groups=Create.class) @Valid RoleVO role) Create a Role that does not exist so far.void
Delete aRole
.findAll()
Find and return all existing Roles.findByNames
(@NotNull List<String> roleNames) Find and return all existingRole
s.@NotNull RoleVO
findByPKey
(@NotBlank String pKey) Find and return aRole
.@NotNull RoleVO
save
(@NotBlank String pKey, @NotNull(groups=Modify.class) @Valid RoleVO role) Update an existing Role.@NotNull RoleVO
unassignUser
(@NotBlank String pKey, @NotBlank String userPKey) Unassign an assignedUser
from aRole
.
-
Method Details
-
findAll
Find and return all existing Roles.- Returns:
- All Roles or an empty collection type, never null
-
findByPKey
Find and return aRole
.- Parameters:
pKey
- The persistent key of the existing Role- Returns:
- The instance
- Throws:
org.ameba.exception.NotFoundException
- If the Role does not exist
-
findByNames
Find and return all existingRole
s.- Parameters:
roleNames
- A list with all the names- Returns:
- A list with Roles, never null
-
create
@NotNull @NotNull RoleVO create(@NotNull(groups=Create.class) @Valid @NotNull(groups=Create.class) @Valid RoleVO role) Create a Role that does not exist so far.- Parameters:
role
- The Role to be created- Returns:
- The created Role instance
- Throws:
org.ameba.exception.ResourceExistsException
- If therole
already exists
-
save
@NotNull @NotNull RoleVO save(@NotBlank @NotBlank String pKey, @NotNull(groups=Modify.class) @Valid @NotNull(groups=Modify.class) @Valid RoleVO role) Update an existing Role.- Parameters:
pKey
- The persistent key of the existing Rolerole
- The Role to update- Returns:
- The updated instance
- Throws:
org.ameba.exception.NotFoundException
- If therole
does not exist
-
delete
Delete aRole
.- Parameters:
pKey
- The identifiable persistent key
-
assignUser
@NotNull @NotNull RoleVO assignUser(@NotBlank @NotBlank String pKey, @NotBlank @NotBlank String userPKey) Assign anUser
to aRole
.- Parameters:
pKey
- The persistent key of the existing RoleuserPKey
- The persistent key of the existing User- Returns:
- The updated Role instance
-
unassignUser
@NotNull @NotNull RoleVO unassignUser(@NotBlank @NotBlank String pKey, @NotBlank @NotBlank String userPKey) Unassign an assignedUser
from aRole
.- Parameters:
pKey
- The persistent key of the existing RoleuserPKey
- The persistent key of the existing User- Returns:
- The updated Role instance
-