Interface ResourceFactory


public interface ResourceFactory
Interface to a factory to instantiate FedoraResources
Since:
2019-09-23
Author:
whikloj
  • Method Details

    • getResource

      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 null
      fedoraID - 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 transaction
      resourceId - The internal identifier
      Returns:
      The containing resource or null if none.
    • getChildren

      Get immediate children of the resource
      Parameters:
      transaction - The transaction
      resourceId - Identifier of the resource
      Returns:
      Stream of child resources