dk.netarkivet.archive.checksum.distribute
Class ChecksumFileServer

java.lang.Object
  extended by dk.netarkivet.archive.distribute.ArchiveMessageHandler
      extended by dk.netarkivet.archive.checksum.distribute.ChecksumArchiveServer
          extended by dk.netarkivet.archive.checksum.distribute.ChecksumFileServer
All Implemented Interfaces:
ArchiveMessageVisitor, CleanupIF, javax.jms.MessageListener

public class ChecksumFileServer
extends ChecksumArchiveServer

The server for the ChecksumFileApplication. Used for communication between the ArcRepository and the checksum archive.


Field Summary
protected  ChecksumArchive cs
          The archive which contain the actual data.
protected static ChecksumFileServer instance
          The instance of this server.
 
Fields inherited from class dk.netarkivet.archive.checksum.distribute.ChecksumArchiveServer
checksumAppId, jmsCon, theCR
 
Method Summary
 void cleanup()
          Method for cleaning up, when closing this instance down.
 void close()
          Method for closing the instance.
protected  java.lang.String createAppId()
          Method for creating the identification for this application.
 java.lang.String getAppId()
          Method for retrieving the identification of this application.
static ChecksumFileServer getInstance()
          Returns the unique instance of this class.
 void visit(CorrectMessage msg)
          Method for correcting an entry in the archive.
 void visit(GetAllChecksumsMessage msg)
          Method for retrieving a map containing all the checksums and their corresponding filenames within the archive.
 void visit(GetAllFilenamesMessage msg)
          Method for retrieving all the filenames within the archive.
 void visit(GetChecksumMessage msg)
          Method for retrieving the checksum of a record.
 void visit(UploadMessage msg)
          The method for uploading arc files.
 
Methods inherited from class dk.netarkivet.archive.distribute.ArchiveMessageHandler
onMessage, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static ChecksumFileServer instance
The instance of this server.


cs

protected ChecksumArchive cs
The archive which contain the actual data.

Method Detail

getInstance

public static ChecksumFileServer getInstance()
Returns the unique instance of this class. The server creates an instance of the checksum it creates access to and starts to listen to a JMS messages on the incoming JMS queue.

Should this do the heart beats to a monitor? This would be quite odd, since Checksum does not use a monitor.

Returns:
This instance.

close

public void close()
Method for closing the instance.

Specified by:
close in class ChecksumArchiveServer

cleanup

public void cleanup()
Method for cleaning up, when closing this instance down.

Specified by:
cleanup in interface CleanupIF
Specified by:
cleanup in class ChecksumArchiveServer

getAppId

public java.lang.String getAppId()
Method for retrieving the identification of this application.

Specified by:
getAppId in class ChecksumArchiveServer
Returns:
The id of this application.

createAppId

protected java.lang.String createAppId()
Method for creating the identification for this application.

Returns:
The id of this application.

visit

public void visit(UploadMessage msg)
The method for uploading arc files.

Specified by:
visit in interface ArchiveMessageVisitor
Specified by:
visit in class ChecksumArchiveServer
Parameters:
msg - The upload message, containing the file to upload.

visit

public void visit(CorrectMessage msg)
Method for correcting an entry in the archive. This method starts by removing the record, and then uploading it again to the checksum archive.

Specified by:
visit in interface ArchiveMessageVisitor
Specified by:
visit in class ChecksumArchiveServer
Parameters:
msg - The message containing the correct instance of the file to correct.

visit

public void visit(GetChecksumMessage msg)
Method for retrieving the checksum of a record.

Specified by:
visit in interface ArchiveMessageVisitor
Specified by:
visit in class ChecksumArchiveServer
Parameters:
msg - The GetChecksumMessage which contains the name of the record to have its checksum retrieved.

visit

public void visit(GetAllFilenamesMessage msg)
Method for retrieving all the filenames within the archive.

Specified by:
visit in interface ArchiveMessageVisitor
Specified by:
visit in class ChecksumArchiveServer
Parameters:
msg - The GetAllFilenamesMessage.

visit

public void visit(GetAllChecksumsMessage msg)
Method for retrieving a map containing all the checksums and their corresponding filenames within the archive.

Specified by:
visit in interface ArchiveMessageVisitor
Specified by:
visit in class ChecksumArchiveServer
Parameters:
msg - The GetAllChecksumMessage.