public class ChecksumFileServer extends ChecksumArchiveServer
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_ID_SEPARATOR
The character to separate the applicationInstanceId and the IP address.
|
protected ChecksumArchive |
cs
The archive which contain the actual data.
|
protected static ChecksumFileServer |
instance
The instance of this server.
|
checksumAppId, jmsCon, theCR
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Method for cleaning up, when closing this instance down.
|
void |
close()
Method for closing the instance.
|
protected String |
createAppId()
Method for creating the identification for this application.
|
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.
|
protected static ChecksumFileServer instance
protected ChecksumArchive cs
public static final String APPLICATION_ID_SEPARATOR
public static ChecksumFileServer getInstance()
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.
public void close()
public void cleanup()
cleanup
in interface CleanupIF
cleanup
in class ChecksumArchiveServer
public String getAppId()
getAppId
in class ChecksumArchiveServer
protected String createAppId()
public void visit(UploadMessage msg) throws ArgumentNotValid
ChecksumArchive.upload(RemoteFile, String)
visit
in interface ArchiveMessageVisitor
visit
in class ChecksumArchiveServer
msg
- The upload message, containing the file to upload.ArgumentNotValid
- If the UploadMessage is null.public void visit(CorrectMessage msg) throws ArgumentNotValid
If it fails in any of the above, then the method fails (throws an exception which is caught and use for replying NotOk to the message).
visit
in interface ArchiveMessageVisitor
visit
in class ChecksumArchiveServer
msg
- The message containing the correct instance of the file to correct.ArgumentNotValid
- If the correct message is null.public void visit(GetChecksumMessage msg) throws ArgumentNotValid
visit
in interface ArchiveMessageVisitor
visit
in class ChecksumArchiveServer
msg
- The GetChecksumMessage which contains the name of the record to have its checksum retrieved.ArgumentNotValid
- If the message is null.public void visit(GetAllFilenamesMessage msg) throws ArgumentNotValid
visit
in interface ArchiveMessageVisitor
visit
in class ChecksumArchiveServer
msg
- The GetAllFilenamesMessage.ArgumentNotValid
- If the GetAllFilenamesMessages is null.public void visit(GetAllChecksumsMessage msg) throws ArgumentNotValid
visit
in interface ArchiveMessageVisitor
visit
in class ChecksumArchiveServer
msg
- The GetAllChecksumMessage.ArgumentNotValid
- If the GetAllChecksumMessage is null.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.