@FunctionalInterface public interface ResourceUpdater
Resource
instances.
For more details, see updateResource(Resource, String, Set)
.Modifier and Type | Method and Description |
---|---|
default void |
cleanupResourceUpdate()
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 |
commitResourceUpdate(Collection<Resource> updatedResources)
Update committing callback hook that gets called once at the end of very successful updating process, after all
authorization instances are updated.
|
default void |
prepareResourceUpdate(Collection<Resource> existingResources)
Updating preparation callback hook that gets called once on the beginning of very updating process, before any
authorization instances are updated.
|
default void |
rollbackResourceUpdate(Collection<Resource> updatedResources,
Exception cause)
Updating exception handling callback hook that gets called once if any
Exception is encountered during
the updating process. |
void |
updateResource(Resource resource,
String resourceName,
Set<Resource> children)
Updates the passed
Resource instance for the given resource name and collection of child resources,
where updating can mean anything from just validating to actually changing the passed resource's state with
the passed content. |
void updateResource(Resource resource, String resourceName, Set<Resource> children)
Resource
instance for the given resource name and collection of child resources,
where updating can mean anything from just validating to actually changing the passed resource's state with
the passed content.default void prepareResourceUpdate(Collection<Resource> existingResources)
existingResources
- the resources already existing before the updating process.default void commitResourceUpdate(Collection<Resource> updatedResources)
updatedResources
- the updated and potentially newly created resources.default void rollbackResourceUpdate(Collection<Resource> updatedResources, 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 Resource
instances that have
already existed before the updating process.updatedResources
- the updated and potentially newly created, empty or inconsistent resources.default void cleanupResourceUpdate()