|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
dk.netarkivet.archive.bitarchive.BitarchiveMonitor
public class BitarchiveMonitor
Class representing the monitor for bitarchives. The monitor is used for sending out and combining the results of executing batch jobs. Registers outgoing batchjobs to bitarchives, and handles replies from bitarchives, finally notifying observers when all bitarchives have replied, or when the batch times out, after a time specified in settings. We wait for replies from bitarchives that are considered live when the batch begins. A bitarchive is considered live if we have heard any activity from it within a time specified in settings.
Nested Class Summary | |
---|---|
class |
BitarchiveMonitor.BatchJobStatus
Class handling state and updates in batch job status. |
Field Summary | |
---|---|
protected java.util.Timer |
batchTimer
The timer for keeping track of running batchjobs. |
Method Summary | |
---|---|
void |
bitarchiveReply(java.lang.String bitarchiveBatchID,
java.lang.String bitarchiveID,
int noOfFilesProcessed,
java.util.Collection<java.io.File> filesFailed,
RemoteFile remoteFile,
java.lang.String errMsg,
java.util.List<FileBatchJob.ExceptionOccurrence> exceptions)
Handle a reply received from a bitarchive. |
void |
cleanup()
Closes this BitarchiveMonitor cleanly. |
static BitarchiveMonitor |
getInstance()
Method for retrieving the current instance. |
void |
registerBatch(java.lang.String requestID,
ChannelID requestReplyTo,
java.lang.String bitarchiveBatchID,
long timeout)
Register a new batch sent to the bitarchives. |
void |
signOfLife(java.lang.String appID)
Registers a sign of life from a bitarchive. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Timer batchTimer
Method Detail |
---|
public static BitarchiveMonitor getInstance()
public void signOfLife(java.lang.String appID)
appID
- the ID of the bitarchive that generated the life signpublic void registerBatch(java.lang.String requestID, ChannelID requestReplyTo, java.lang.String bitarchiveBatchID, long timeout) throws ArgumentNotValid
requestID
- The ID of the batch request.requestReplyTo
- The replyTo channel of the batch request.bitarchiveBatchID
- The ID of the batch job sent on to the bit
archives.timeout
- Timeout of specific batch job.
ArgumentNotValid
- If any argument is null, or either string is
empty.public void bitarchiveReply(java.lang.String bitarchiveBatchID, java.lang.String bitarchiveID, int noOfFilesProcessed, java.util.Collection<java.io.File> filesFailed, RemoteFile remoteFile, java.lang.String errMsg, java.util.List<FileBatchJob.ExceptionOccurrence> exceptions) throws ArgumentNotValid
bitarchiveBatchID
- The ID of the batch job sent on to the bit
archives.bitarchiveID
- The ID of the replying bitarchive.noOfFilesProcessed
- The number of files the bitarchive has
processed.filesFailed
- A collection of filenames of failed files in
that bitarchive. Might be null if no files failed.remoteFile
- A remote pointer to a file with results from that
bitarchive. Might be null if job was not OK.errMsg
- An error message, if the job was not successful on the
bitarchive, or null for none.exceptions
- A list of exceptions caught during batch processing.
ArgumentNotValid
- If either ID is null.public void cleanup()
cleanup
in interface CleanupIF
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |