Package org.openwms.core.uaa
Interface RoleService
- All Known Implementing Classes:
RoleServiceImpl
public interface RoleService
A RoleService provides business functionality regarding the handling with
Roles. 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 RoleVOassignUser(@NotBlank String pKey, @NotBlank String userPKey) Assign anUserto aRole.@NotNull RoleVOcreate(@NotNull(groups=Create.class) @Valid RoleVO role) Create a Role that does not exist so far.voidDelete aRole.findAll()Find and return all existing Roles.findByNames(@NotNull List<String> roleNames) Find and return all existingRoles.@NotNull RoleVOfindByPKey(@NotBlank String pKey) Find and return aRole.@NotNull RoleVOsave(@NotBlank String pKey, @NotNull(groups=Modify.class) @Valid RoleVO role) Update an existing Role.@NotNull RoleVOunassignUser(@NotBlank String pKey, @NotBlank String userPKey) Unassign an assignedUserfrom 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 existingRoles.- 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 therolealready 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 theroledoes 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 anUserto 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 assignedUserfrom aRole.- Parameters:
pKey- The persistent key of the existing RoleuserPKey- The persistent key of the existing User- Returns:
- The updated Role instance
-