Interface ResourceFactory

  • All Known Implementing Classes:
    ResourceFactoryImpl

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

      • 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

        Stream<FedoraResourcegetChildren​(Transaction transaction,
                                           FedoraId resourceId)
        Get immediate children of the resource
        Parameters:
        transaction - The transaction
        resourceId - Identifier of the resource
        Returns:
        Stream of child resources