@FunctionalInterface public interface RoleUpdater
Role
instance for a given role name and collections of parent roles
and explicit permissions.
For more details, see updateRole(Role, String, Set, Set)
.Modifier and Type | Method and Description |
---|---|
default void |
cleanupRoleUpdate()
Updating preparation callback hook that gets called once at the end of the updating process in any case
(both success and encountered exception).
|
default void |
commitRoleUpdate(Collection<Role> updatedRoles)
Update committing callback hook that gets called once at the end of very successful updating process, after all
authorization instances are updated.
|
default void |
prepareRoleUpdate(Collection<Role> existingRoles)
Updating preparation callback hook that gets called once on the beginning of very updating process, before any
authorization instances are updated.
|
default void |
rollbackRoleUpdate(Collection<Role> updatedRoles,
Exception cause)
Updating exception handling callback hook that gets called once if any
Exception is encountered during
the updating process. |
void |
updateRole(Role role,
String name,
Set<Role> parentRoles,
Set<Permission> permissions)
Updates the passed
Role instance for the given role name and collections of parent roles
and explicit permissions, where updating can mean anything from just validating to actually changing the passed
subject's state with the passed content. |
void updateRole(Role role, String name, Set<Role> parentRoles, Set<Permission> permissions)
Role
instance for the given role name and collections of parent roles
and explicit permissions, where updating can mean anything from just validating to actually changing the passed
subject's state with the passed content.default void prepareRoleUpdate(Collection<Role> existingRoles)
existingRoles
- the roles already existing before the updating process.default void commitRoleUpdate(Collection<Role> updatedRoles)
updatedRoles
- the updated and potentially newly created roles.default void rollbackRoleUpdate(Collection<Role> updatedRoles, Exception cause)
Exception
is encountered during
the updating process.
The default implementation of this method is empty.
An example usage for this method is to rollback (revert) all mutated Role
instances that have
already existed before the updating process.updatedRoles
- the updated and potentially newly created, empty or inconsistent roles.default void cleanupRoleUpdate()