Interface ResourceCollectionManager
-
@ProviderType public interface ResourceCollectionManager
TheResourceCollectionManager
defines the API to get, create and delete resource collectionsResourceCollection
. The ResourceCollectionManager service can be retrieved by looking it up from the service registry or by adapting aResourceResolver
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceCollection
createCollection(Resource parentResource, java.lang.String name)
This method creates a resource collection with a given name under theparentResource
.ResourceCollection
createCollection(Resource parentResource, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> properties)
This method creates a resource collection with a given name under theparentResource
.boolean
deleteCollection(Resource resource)
Removes theResourceCollection
corresponding to the collection represented byresource
.ResourceCollection
getCollection(Resource resource)
This method returns a resource collection for the givenresource
that represents aResourceCollection
.
-
-
-
Method Detail
-
getCollection
ResourceCollection getCollection(Resource resource)
This method returns a resource collection for the givenresource
that represents aResourceCollection
. It returns null if given resource is not a collection- Parameters:
resource
- resource that represents a collection- Returns:
- The
ResourceCollection
representing the collection.
-
createCollection
ResourceCollection createCollection(Resource parentResource, java.lang.String name) throws PersistenceException
This method creates a resource collection with a given name under theparentResource
. The changes are transient and have to be saved by resourceResolver.commit()- Parameters:
parentResource
- parent resource where collection needs to be created.name
- The name for collection.- Returns:
- The
ResourceCollection
representing the created collection. - Throws:
PersistenceException
- if the operation fails
-
createCollection
ResourceCollection createCollection(Resource parentResource, java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> properties) throws PersistenceException
This method creates a resource collection with a given name under theparentResource
. The changes are transient and have to be saved by resourceResolver.commit()- Parameters:
parentResource
- parent resource where collection needs to be created.name
- The name for collection.properties
- The additional data for resource collection- Returns:
- The
ResourceCollection
representing the created collection. - Throws:
PersistenceException
- if the operation fails
-
deleteCollection
boolean deleteCollection(Resource resource) throws PersistenceException
Removes theResourceCollection
corresponding to the collection represented byresource
. The changes are transient and have to be saved by resourceResolver.commit()- Parameters:
resource
- resource representing a collection to be deleted.- Returns:
true
if the collection was successfully removed.- Throws:
PersistenceException
- if the operation fails
-
-