Class StatelessFedora4Client

  • All Implemented Interfaces:
    Fedora4Client

    public class StatelessFedora4Client
    extends Object
    implements Fedora4Client
    A Fedora4Client implementation that uses the code from the fcrepo-camel project when possible. This client is meant to be minimal in that it makes as few requests as possible to implement the interface.
    Author:
    mdurbin
    • Constructor Detail

      • StatelessFedora4Client

        public StatelessFedora4Client​(String fcrepoBaseURL)
        Constructor for repositories for which Authentication is disabled; requires the base URL for the Fedora 4 repository.
        Parameters:
        fcrepoBaseURL - the base URL for a Fedora 4 repository.
      • StatelessFedora4Client

        public StatelessFedora4Client​(String username,
                                      String password,
                                      String fcrepoBaseURL)
        Constructor for repositories for which Authentication is not disabled; requires the base URL for the Fedora 4 repository.
        Parameters:
        username - the username to authenticate with.
        password - the password to authenticate with.
        fcrepoBaseURL - the base URL for a Fedora 4 repository.
    • Method Detail

      • exists

        public boolean exists​(String path)
        Description copied from interface: Fedora4Client
        Determines if a resource exists.
        Specified by:
        exists in interface Fedora4Client
        Parameters:
        path - the path to the resource
        Returns:
        true if it exists, false otherwise
      • createPlaceholder

        public String createPlaceholder​(String path)
        Description copied from interface: Fedora4Client
        Creates a placeholder resource at the given path (or at a server-assigned path, if no path is given) if no resource exists at that path. If a resource already exists, this method returns the path to that resource which may or may not be a placeholder. If none exists, this method creates a new resource that should should be distinguishable from resources that have already been migrated as well as resources created using another process.
        Specified by:
        createPlaceholder in interface Fedora4Client
        Parameters:
        path - a path at which to create a placeholder resource (or null to create a placeholder resource at a server-assigned path).
        Returns:
        the path of the placeholder resource that was created
      • createNonRDFPlaceholder

        public String createNonRDFPlaceholder​(String path)
        Description copied from interface: Fedora4Client
        Creates a placeholder non-RDF resource at the given path (or at a server-assigned path, if no path is given) if no resource exists at that path. If a resource already exists, this method returns the path to that resource which may or may not be a placeholder. If none exists, this method creates a new resource that should should be distinguishable from resources that have already been migrated as well as resources created using another process.
        Specified by:
        createNonRDFPlaceholder in interface Fedora4Client
        Parameters:
        path - a path at which to create a placeholder resource (or null to create a placeholder resource at a server-assigned path).
        Returns:
        the path of the placeholder resource that was created
      • isPlaceholder

        public boolean isPlaceholder​(String path)
        Description copied from interface: Fedora4Client
        Determines whether the resource at the given path is a placeholder or not.
        Specified by:
        isPlaceholder in interface Fedora4Client
        Parameters:
        path - a path of a resource (expected to exist)
        Returns:
        true if it's a placeholder, false otherwise