dk.netarkivet.viewerproxy
Class DelegatingController

java.lang.Object
  extended by dk.netarkivet.viewerproxy.DelegatingController
All Implemented Interfaces:
Controller

public class DelegatingController
extends java.lang.Object
implements Controller

Control of viewer proxy. Delegates URL-methods to a missing URL recorder, and cdx control to a CDXCache instance combined with an ARCArchiveAccess instance.


Constructor Summary
DelegatingController(MissingURIRecorder mur, JobIndexCache cc, ARCArchiveAccess aaa)
          Initialise a controller with the relevant instances to control.
 
Method Summary
 void changeIndex(java.util.Set<java.lang.Long> jobSet, java.lang.String label)
          Change index to use an index based on a list of jobs.
 void clearRecordedURIs()
          Clear list of missing URLs.
 java.util.Set<java.net.URI> getRecordedURIs()
          Get list of missing URLs.
 java.lang.String getStatus(java.util.Locale locale)
          Get a human readable status of the viewer proxy.
 void startRecordingURIs()
          Start collecting missing URLs.
 void stopRecordingURIs()
          Stop collecting missing URLs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 CDX cache 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 java.util.Set<java.net.URI> getRecordedURIs()
Get list of missing URLs.

Specified by:
getRecordedURIs in interface Controller
Returns:
The list of missing URLs.

changeIndex

public void changeIndex(java.util.Set<java.lang.Long> jobSet,
                        java.lang.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 CDXCache.

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 java.lang.String getStatus(java.util.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.