dk.netarkivet.archive.arcrepository.bitpreservation
Class AdminDataMessage

java.lang.Object
  extended by dk.netarkivet.common.distribute.NetarkivetMessage
      extended by dk.netarkivet.archive.distribute.ArchiveMessage
          extended by dk.netarkivet.archive.arcrepository.bitpreservation.AdminDataMessage
All Implemented Interfaces:
java.io.Serializable

public class AdminDataMessage
extends ArchiveMessage

Class encapsulating a request to update AdminData. The message has two different types: changestorestate-type, and changechecksum-type. There is a constructor for each type.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
replyOfId
 
Constructor Summary
AdminDataMessage(java.lang.String theFileName, java.lang.String theChecksum)
          Constructor used when you want to change the checksum for the given filename.
AdminDataMessage(java.lang.String theFileName, java.lang.String theReplicaId, ReplicaStoreState newval)
          Constructor used when you change the BitarchiveStoreState.
 
Method Summary
 void accept(ArchiveMessageVisitor v)
          Should be implemented as a part of the visitor pattern.
 java.lang.String getChecksum()
           
 java.lang.String getFileName()
          Method for retrieving the name of the file which are refered to in this message.
 ReplicaStoreState getNewvalue()
           
 java.lang.String getReplicaId()
          Method for retrieving the replica id from this message.
 boolean isChangeChecksum()
          Return the state of the changechecksum - flag.
 boolean isChangeStoreState()
          Return the state of the changestorestate - flag.
 
Methods inherited from class dk.netarkivet.common.distribute.NetarkivetMessage
getErrMsg, getID, getReplyOfId, getReplyTo, getTo, hasBeenSent, isOk, setNotOk, setNotOk, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdminDataMessage

public AdminDataMessage(java.lang.String theFileName,
                        java.lang.String theReplicaId,
                        ReplicaStoreState newval)
Constructor used when you change the BitarchiveStoreState.

Parameters:
theFileName - The filename you want to give a new BitarchiveStoreState.
theReplicaId - The ID for the bitarchive where the file resides
newval - The new BitarchiveStoreState

AdminDataMessage

public AdminDataMessage(java.lang.String theFileName,
                        java.lang.String theChecksum)
Constructor used when you want to change the checksum for the given filename.

Parameters:
theFileName - the given filename
theChecksum - the new checksum for the filename
Method Detail

accept

public void accept(ArchiveMessageVisitor v)
Should be implemented as a part of the visitor pattern. fx.: public void accept(ArchiveMessageVisitor v) { v.visit(this); }

Specified by:
accept in class ArchiveMessage
Parameters:
v - A message visitor
See Also:
ArchiveMessageVisitor

getReplicaId

public java.lang.String getReplicaId()
Method for retrieving the replica id from this message.

Returns:
Returns the replicaId.

getFileName

public java.lang.String getFileName()
Method for retrieving the name of the file which are refered to in this message.

Returns:
Returns the fileName.

getChecksum

public java.lang.String getChecksum()
Returns:
Returns the fileName.

isChangeStoreState

public boolean isChangeStoreState()
Return the state of the changestorestate - flag.

Returns:
true, if this message is a changestorestate message

isChangeChecksum

public boolean isChangeChecksum()
Return the state of the changechecksum - flag.

Returns:
true, if this message is a changechecksum message

getNewvalue

public ReplicaStoreState getNewvalue()
Returns:
Returns the newvalue.