Package org.fcrepo.kernel.impl.models
Class ResourceFactoryImpl
- java.lang.Object
-
- org.fcrepo.kernel.impl.models.ResourceFactoryImpl
-
- All Implemented Interfaces:
ResourceFactory
@Component public class ResourceFactoryImpl extends Object implements ResourceFactory
Implementation of ResourceFactory interface.- Since:
- 2019-09-23
- Author:
- whikloj
-
-
Constructor Summary
Constructors Constructor Description ResourceFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream<FedoraResource>getChildren(Transaction transaction, FedoraId resourceId)Get immediate children of the resourceFedoraResourcegetContainer(Transaction transaction, FedoraId resourceId)Get the containing resource (if exists).FedoraResourcegetResource(Transaction transaction, FedoraId fedoraID)Get a FedoraResource for existing resource<T extends FedoraResource>
TgetResource(Transaction transaction, FedoraId identifier, Class<T> clazz)Get a resource as a particular type
-
-
-
Constructor Detail
-
ResourceFactoryImpl
public ResourceFactoryImpl()
-
-
Method Detail
-
getResource
public FedoraResource getResource(Transaction transaction, FedoraId fedoraID) throws PathNotFoundException
Description copied from interface:ResourceFactoryGet a FedoraResource for existing resource- Specified by:
getResourcein interfaceResourceFactory- 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
public <T extends FedoraResource> T getResource(Transaction transaction, FedoraId identifier, Class<T> clazz) throws PathNotFoundException
Description copied from interface:ResourceFactoryGet a resource as a particular type- Specified by:
getResourcein interfaceResourceFactory- Type Parameters:
T- type for the resource- Parameters:
transaction- The transaction associated with this request or nullidentifier- 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
public FedoraResource getContainer(Transaction transaction, FedoraId resourceId)
Description copied from interface:ResourceFactoryGet the containing resource (if exists).- Specified by:
getContainerin interfaceResourceFactory- Parameters:
transaction- The current transactionresourceId- The internal identifier- Returns:
- The containing resource or null if none.
-
getChildren
public Stream<FedoraResource> getChildren(Transaction transaction, FedoraId resourceId)
Description copied from interface:ResourceFactoryGet immediate children of the resource- Specified by:
getChildrenin interfaceResourceFactory- Parameters:
transaction- The transactionresourceId- Identifier of the resource- Returns:
- Stream of child resources
-
-