Package org.fcrepo.kernel.api.models
Interface ResourceFactory
-
- All Known Implementing Classes:
ResourceFactoryImpl
public interface ResourceFactory
Interface to a factory to instantiate FedoraResources- Since:
- 2019-09-23
- Author:
- whikloj
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stream<FedoraResource>
getChildren(Transaction transaction, FedoraId resourceId)
Get immediate children of the resourceFedoraResource
getContainer(Transaction transaction, FedoraId resourceId)
Get the containing resource (if exists).FedoraResource
getResource(Transaction transaction, FedoraId fedoraID)
Get a FedoraResource for existing resource<T extends FedoraResource>
TgetResource(Transaction transaction, FedoraId fedoraID, Class<T> clazz)
Get a resource as a particular type
-
-
-
Method Detail
-
getResource
FedoraResource getResource(Transaction transaction, FedoraId fedoraID) throws PathNotFoundException
Get a FedoraResource for existing resource- Parameters:
transaction
- The transaction associated with this request or null if not in a transaction.fedoraID
- The identifier for the resource.- Returns:
- The resource.
- Throws:
PathNotFoundException
- If the identifier cannot be found.
-
getResource
<T extends FedoraResource> T getResource(Transaction transaction, FedoraId fedoraID, Class<T> clazz) throws PathNotFoundException
Get a resource as a particular type- Type Parameters:
T
- type for the resource- Parameters:
transaction
- The transaction associated with this request or nullfedoraID
- The identifier for the resource.clazz
- class the resource will be cast to- Returns:
- The resource.
- Throws:
PathNotFoundException
- If the identifier cannot be found.
-
getContainer
FedoraResource getContainer(Transaction transaction, FedoraId resourceId)
Get the containing resource (if exists).- Parameters:
transaction
- The current transactionresourceId
- The internal identifier- Returns:
- The containing resource or null if none.
-
getChildren
Stream<FedoraResource> getChildren(Transaction transaction, FedoraId resourceId)
Get immediate children of the resource- Parameters:
transaction
- The transactionresourceId
- Identifier of the resource- Returns:
- Stream of child resources
-
-