Package dk.netarkivet.viewerproxy
Class DelegatingController
- java.lang.Object
-
- dk.netarkivet.viewerproxy.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 Summary
Constructors Constructor Description DelegatingController(MissingURIRecorder mur, JobIndexCache cc, ARCArchiveAccess aaa)
Initialise a controller with the relevant instances to control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeIndex(Set<Long> jobSet, String label)
Change index to use an index based on a list of jobs.void
clearRecordedURIs()
Clear list of missing URLs.Set<URI>
getRecordedURIs()
Get list of missing URLs.String
getStatus(Locale locale)
Get a human readable status of the viewer proxy.void
startRecordingURIs()
Start collecting missing URLs.void
stopRecordingURIs()
Stop collecting missing URLs.
-
-
-
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 interfaceController
-
stopRecordingURIs
public void stopRecordingURIs()
Stop collecting missing URLs.- Specified by:
stopRecordingURIs
in interfaceController
-
clearRecordedURIs
public void clearRecordedURIs()
Clear list of missing URLs.- Specified by:
clearRecordedURIs
in interfaceController
-
getRecordedURIs
public Set<URI> getRecordedURIs()
Get list of missing URLs.- Specified by:
getRecordedURIs
in interfaceController
- 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 interfaceController
- 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 interfaceController
- Parameters:
locale
- The locale used to generate the string- Returns:
- A human readable status string.
-
-