Package org.apache.sling.api.resource
Interface ModifyingResourceProvider
-
- All Superinterfaces:
ResourceProvider
@Deprecated @ConsumerType public interface ModifyingResourceProvider extends ResourceProvider
Deprecated.Use theResourceProvider
A modifying resource provider is an extension of a resource provider which is only supported if the resource provider has been created through aResourceProviderFactory
. A modifying resource provider allows to create, update, and delete resources. Update is handled throughModifiableValueMap
. All changes should be kept in a transient store untilcommit(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 theDynamicResourceProvider
interface.- Since:
- 2.2 (Sling API Bundle 2.2.0)
- See Also:
ResourceProviderFactory.getResourceProvider(java.util.Map)
,ResourceProviderFactory.getAdministrativeResourceProvider(java.util.Map)
-
-
Field Summary
-
Fields inherited from interface org.apache.sling.api.resource.ResourceProvider
OWNS_ROOTS, RESOURCE_TYPE_SYNTHETIC, ROOTS, SERVICE_NAME, USE_RESOURCE_ACCESS_SECURITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
commit(ResourceResolver resolver)
Deprecated.Commit all transient changes: create, delete and updatesResource
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.-
Methods inherited from interface org.apache.sling.api.resource.ResourceProvider
getResource, getResource, listChildren
-
-
-
-
Method Detail
-
create
Resource create(ResourceResolver resolver, java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> properties) throws PersistenceException
Deprecated.Create a new resource at the given path. The new resource is put into the transient space of this provider untilcommit(ResourceResolver)
is called. A resource provider should valueResourceResolver.PROPERTY_RESOURCE_TYPE
to set the resource type of a resource.- Parameters:
resolver
- The current resource resolver.path
- The resource path.properties
- Optional properties- Returns:
- The new resource.
- Throws:
PersistenceException
- If anything fails
-
delete
void delete(ResourceResolver resolver, java.lang.String path) throws PersistenceException
Deprecated.Delete the resource at the given path. This change is kept in the transient space of this provider untilcommit(ResourceResolver)
is called.- Parameters:
resolver
- The current resource resolver.path
- The resource path.- Throws:
PersistenceException
- If anything fails
-
revert
void revert(ResourceResolver resolver)
Deprecated.Revert all transient changes: create, delete and updates.- Parameters:
resolver
- The current resource resolver.
-
commit
void commit(ResourceResolver resolver) throws PersistenceException
Deprecated.Commit all transient changes: create, delete and updates- Parameters:
resolver
- The current resource resolver.- Throws:
PersistenceException
- If anything fails
-
hasChanges
boolean hasChanges(ResourceResolver resolver)
Deprecated.Are there any transient changes?- Parameters:
resolver
- The current resource resolver.- Returns:
true
if there are pending changes.
-
-