ResourceProvider
@Deprecated @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.ResourceProviderFactory.getResourceProvider(java.util.Map)
,
ResourceProviderFactory.getAdministrativeResourceProvider(java.util.Map)
OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME, USE_RESOURCE_ACCESS_SECURITY
Modifier and Type | Method and Description |
---|---|
void |
commit(ResourceResolver resolver)
Deprecated.
Commit all transient changes: create, delete and updates
|
Resource |
create(ResourceResolver resolver,
java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> properties)
Deprecated.
Create a new resource at the given path.
|
void |
delete(ResourceResolver resolver,
java.lang.String path)
Deprecated.
Delete the resource at the given path.
|
boolean |
hasChanges(ResourceResolver resolver)
Deprecated.
Are there any transient changes?
|
void |
revert(ResourceResolver resolver)
Deprecated.
Revert all transient changes: create, delete and updates.
|
getResource, getResource, listChildren
Resource create(ResourceResolver resolver, java.lang.String path, java.util.Map<java.lang.String,java.lang.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, java.lang.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.true
if there are pending changes.Copyright © 2018 The Apache Software Foundation. All rights reserved.