Class DelegatingController

  • All Implemented Interfaces:
    Controller

    public class DelegatingController
    extends Object
    implements Controller
    Control of viewer proxy. Delegates URL-methods to a missing URL recorder, and cdx control to a JobIndexCache instance combined with an ARCArchiveAccess instance.
    • Constructor Detail

      • DelegatingController

        public DelegatingController​(MissingURIRecorder mur,
                                    JobIndexCache cc,
                                    ARCArchiveAccess aaa)
        Initialise a controller with the relevant instances to control.
        Parameters:
        mur - The missing URL recorder which handles missing URL collection.
        cc - The JobIndexCache which generates an index from a list of jobs on changeIndex command.
        aaa - The ARCArchiveAccess instance to receive new cdx on changeIndex command.
        Throws:
        ArgumentNotValid - if any argument is null.
    • Method Detail

      • startRecordingURIs

        public void startRecordingURIs()
        Start collecting missing URLs.
        Specified by:
        startRecordingURIs in interface Controller
      • stopRecordingURIs

        public void stopRecordingURIs()
        Stop collecting missing URLs.
        Specified by:
        stopRecordingURIs in interface Controller
      • clearRecordedURIs

        public void clearRecordedURIs()
        Clear list of missing URLs.
        Specified by:
        clearRecordedURIs in interface Controller
      • getRecordedURIs

        public Set<URI> getRecordedURIs()
        Get list of missing URLs.
        Specified by:
        getRecordedURIs in interface Controller
        Returns:
        The list of missing URLs.
      • changeIndex

        public void changeIndex​(Set<Long> jobSet,
                                String label)
        Change index to use an index based on a list of jobs. Note: Does not check arguments. This is a task for the mediated classes, ArcArchiveAccess and JobIndexCache.
        Specified by:
        changeIndex in interface Controller
        Parameters:
        jobSet - List of jobs to get an index for.
        label - The label this index should be known as
      • getStatus

        public String getStatus​(Locale locale)
        Get a human readable status of the viewer proxy.
        Specified by:
        getStatus in interface Controller
        Parameters:
        locale - The locale used to generate the string
        Returns:
        A human readable status string.