Package org.openwms.core.uaa.impl
Class GrantServiceImpl
java.lang.Object
org.openwms.core.uaa.impl.GrantServiceImpl
- All Implemented Interfaces:
GrantService
A GrantServiceImpl is a transactional Spring Service implementation.
- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationEventPublisher
private final GrantRepository
private final org.ameba.i18n.Translator
private final UserRepository
-
Constructor Summary
ConstructorDescriptionGrantServiceImpl
(GrantRepository grantRepository, UserRepository userRepository, org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescription@NotNull Grant
create
(@NotNull(groups=Create.class) @Valid Grant grant) Create a newGrant
.findAllFor
(@NotBlank String username) Find and return allGrant
s assigned to anUser
.Find and return all existingGrant
s.@NotNull Grant
findByPKey
(@NotBlank String pKey) Find and return aGrant
.
-
Field Details
-
grantRepository
-
userRepository
-
translator
private final org.ameba.i18n.Translator translator -
eventPublisher
private final org.springframework.context.ApplicationEventPublisher eventPublisher
-
-
Constructor Details
-
GrantServiceImpl
GrantServiceImpl(GrantRepository grantRepository, UserRepository userRepository, org.ameba.i18n.Translator translator, org.springframework.context.ApplicationEventPublisher eventPublisher)
-
-
Method Details
-
findByPKey
Find and return aGrant
.- Specified by:
findByPKey
in interfaceGrantService
- Parameters:
pKey
- The persistent key of the existing Grant- Returns:
- The instance
-
findAllGrants
Find and return all existingGrant
s.- Specified by:
findAllGrants
in interfaceGrantService
- Returns:
- All existing
Grant
s
-
findAllFor
Find and return allGrant
s assigned to anUser
.- Specified by:
findAllFor
in interfaceGrantService
- Parameters:
username
- The User's name- Returns:
- All Grants assigned to the User
-
create
@Measured @Validated(Create.class) @NotNull public @NotNull Grant create(@NotNull(groups=Create.class) @Valid @NotNull(groups=Create.class) @Valid Grant grant) Create a newGrant
.- Specified by:
create
in interfaceGrantService
- Parameters:
grant
- The mandatory Grant- Returns:
- The created Grant instance
-