Package org.openwms.core.uaa.impl
Class RoleServiceImpl
java.lang.Object
org.openwms.core.uaa.impl.RoleServiceImpl
- All Implemented Interfaces:
RoleService
A RoleServiceImpl is a Spring managed transactional service that deals with
Roles.- Author:
- Heiko Scherrer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationEventPublisherprivate static final org.slf4j.Loggerprivate final RoleMapperprivate final RoleRepositoryprivate final org.ameba.i18n.Translatorprivate final UserService -
Constructor Summary
ConstructorsConstructorDescriptionRoleServiceImpl(RoleRepository repository, UserService userService, RoleMapper mapper, org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher) -
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.private RolefindByPKeyInternal(String pKey) @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.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
repository
-
userService
-
mapper
-
translator
private final org.ameba.i18n.Translator translator -
eventPublisher
private final org.springframework.context.ApplicationEventPublisher eventPublisher
-
-
Constructor Details
-
RoleServiceImpl
RoleServiceImpl(RoleRepository repository, UserService userService, RoleMapper mapper, org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher)
-
-
Method Details
-
findAll
Find and return all existing Roles.- Specified by:
findAllin interfaceRoleService- Returns:
- All Roles or an empty collection type, never null
-
findByPKey
Find and return aRole.- Specified by:
findByPKeyin interfaceRoleService- Parameters:
pKey- The persistent key of the existing Role- Returns:
- The instance
-
findByNames
Find and return all existingRoles.- Specified by:
findByNamesin interfaceRoleService- Parameters:
roleNames- A list with all the names- Returns:
- A list with Roles, never null
-
create
@Measured @Validated(Create.class) @NotNull public @NotNull RoleVO create(@NotNull(groups=Create.class) @Valid @NotNull(groups=Create.class) @Valid RoleVO role) Create a Role that does not exist so far.- Specified by:
createin interfaceRoleService- Parameters:
role- The Role to be created- Returns:
- The created Role instance
-
save
@Measured @Validated(Modify.class) @NotNull public @NotNull RoleVO save(@NotBlank @NotBlank String pKey, @NotNull(groups=Modify.class) @Valid @NotNull(groups=Modify.class) @Valid RoleVO role) Update an existing Role.- Specified by:
savein interfaceRoleService- Parameters:
pKey- The persistent key of the existing Rolerole- The Role to update- Returns:
- The updated instance
-
findByPKeyInternal
-
delete
Delete aRole.- Specified by:
deletein interfaceRoleService- Parameters:
pKey- The identifiable persistent key
-
assignUser
@Measured @NotNull public @NotNull RoleVO assignUser(@NotBlank @NotBlank String pKey, @NotBlank @NotBlank String userPKey) Assign anUserto aRole.- Specified by:
assignUserin interfaceRoleService- Parameters:
pKey- The persistent key of the existing RoleuserPKey- The persistent key of the existing User- Returns:
- The updated Role instance
-
unassignUser
@Measured @NotNull public @NotNull RoleVO unassignUser(@NotBlank @NotBlank String pKey, @NotBlank @NotBlank String userPKey) Unassign an assignedUserfrom aRole.- Specified by:
unassignUserin interfaceRoleService- Parameters:
pKey- The persistent key of the existing RoleuserPKey- The persistent key of the existing User- Returns:
- The updated Role instance
-