@ConsumerType public interface ModifyingResourceProvider extends ResourceProvider
ResourceProviderFactory
.
A modifying resource provider allows to create, update, and delete
resources. Update is handled through ModifiableValueMap
.
All changes should be kept in a transient store until commit(ResourceResolver)
is called. revert(ResourceResolver)
discards all transient changes.
If the modifying resource provider needs to clean up resources when it
is discarded like removing objects from the transient state which are
not committed etc., it should also implement the DynamicResourceProvider
interface.OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME, USE_RESOURCE_ACCESS_SECURITY
Modifier and Type | Method and Description |
---|---|
void |
commit(ResourceResolver resolver)
Commit all transient changes: create, delete and updates
|
Resource |
create(ResourceResolver resolver,
String path,
Map<String,Object> properties)
Create a new resource at the given path.
|
void |
delete(ResourceResolver resolver,
String path)
Delete the resource at the given path.
|
boolean |
hasChanges(ResourceResolver resolver)
Are there any transient changes?
|
void |
revert(ResourceResolver resolver)
Revert all transient changes: create, delete and updates.
|
getResource, getResource, listChildren
Resource create(ResourceResolver resolver, String path, Map<String,Object> properties) throws PersistenceException
commit(ResourceResolver)
is called.
A resource provider should value ResourceResolver.PROPERTY_RESOURCE_TYPE
to set the resource type of a resource.resolver
- The current resource resolver.path
- The resource path.properties
- Optional propertiesPersistenceException
- If anything failsvoid delete(ResourceResolver resolver, String path) throws PersistenceException
commit(ResourceResolver)
is called.resolver
- The current resource resolver.path
- The resource path.PersistenceException
- If anything failsvoid revert(ResourceResolver resolver)
resolver
- The current resource resolver.void commit(ResourceResolver resolver) throws PersistenceException
resolver
- The current resource resolver.PersistenceException
- If anything failsboolean hasChanges(ResourceResolver resolver)
resolver
- The current resource resolver.Copyright © 2014 The Apache Software Foundation. All rights reserved.