dk.netarkivet.viewerproxy
Class MissingURIRecorder

java.lang.Object
  extended by dk.netarkivet.viewerproxy.URIObserver
      extended by dk.netarkivet.viewerproxy.MissingURIRecorder
All Implemented Interfaces:
java.util.Observer

public class MissingURIRecorder
extends URIObserver

This class handles recordings of URIs not found during URI lookup.


Nested Class Summary
 
Nested classes/interfaces inherited from class dk.netarkivet.viewerproxy.URIObserver
URIObserver.URIResponseCodePair
 
Constructor Summary
MissingURIRecorder()
           
 
Method Summary
 void clearRecordedURIs()
          Clear list of missing URIs.
 java.util.Set<java.net.URI> getRecordedURIs()
          Getter for the recorded missing URIs.
 boolean isRecordingURIs()
          Returns whether we are currently collecting URIs.
 void notify(java.net.URI uri, int responseCode)
          If we are recording URIs, and the response code is NOT_FOUND, then add URI to the list of missing URIs.
 void startRecordingURIs()
          Start recording missing URIs.
 void stopRecordingURIs()
          Stop recording missing URIs.
 
Methods inherited from class dk.netarkivet.viewerproxy.URIObserver
update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MissingURIRecorder

public MissingURIRecorder()
Method Detail

startRecordingURIs

public void startRecordingURIs()
Start recording missing URIs.


stopRecordingURIs

public void stopRecordingURIs()
Stop recording missing URIs.


clearRecordedURIs

public void clearRecordedURIs()
Clear list of missing URIs.


getRecordedURIs

public java.util.Set<java.net.URI> getRecordedURIs()
Getter for the recorded missing URIs.

Returns:
the recorded URIs, as a sorted set. Note that this is the primary copy, so don't modify it!

notify

public void notify(java.net.URI uri,
                   int responseCode)
If we are recording URIs, and the response code is NOT_FOUND, then add URI to the list of missing URIs.

Specified by:
notify in class URIObserver
Parameters:
uri - The URI observed.
responseCode - The responsecode of the uri.

isRecordingURIs

public boolean isRecordingURIs()
Returns whether we are currently collecting URIs.

Returns:
True if we are currently collecting URIs.