dk.netarkivet.archive.arcrepositoryadmin
Class ArchiveStoreState

java.lang.Object
  extended by dk.netarkivet.archive.arcrepositoryadmin.ArchiveStoreState

public class ArchiveStoreState
extends java.lang.Object

This class contains a storestate, and the time, when it was last set.


Constructor Summary
ArchiveStoreState(ReplicaStoreState storestate)
          Constructor for this class.
ArchiveStoreState(ReplicaStoreState storestate, java.util.Date lastchanged)
          Constructor for this class.
 
Method Summary
 java.util.Date getLastChanged()
          Get the Date for when the state was lastchanged.
 ReplicaStoreState getState()
          Return the current BitArchiveStoreState.
 void setState(ReplicaStoreState state)
          Sets the current ReplicaStoreState.
 void setState(ReplicaStoreState state, java.util.Date lastDate)
          Sets the current ReplicaStoreState.
 java.lang.String toString()
          Creates an string representation of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArchiveStoreState

public ArchiveStoreState(ReplicaStoreState storestate)
Constructor for this class. This sets the lastchanged value to Now.

Parameters:
storestate - A BitArchiveStoreState

ArchiveStoreState

public ArchiveStoreState(ReplicaStoreState storestate,
                         java.util.Date lastchanged)
Constructor for this class.

Parameters:
storestate - A BitArchiveStoreState
lastchanged - Time for when this state was set
Method Detail

getState

public ReplicaStoreState getState()
Return the current BitArchiveStoreState.

Returns:
the current BitArchiveStoreState

setState

public void setState(ReplicaStoreState state,
                     java.util.Date lastDate)
              throws ArgumentNotValid
Sets the current ReplicaStoreState.

Parameters:
state - The ReplicaStoreState.
lastDate - The lastchanged date.
Throws:
ArgumentNotValid - If the state or the lastDate is null.

setState

public void setState(ReplicaStoreState state)
              throws ArgumentNotValid
Sets the current ReplicaStoreState. As a sideeffect lastchanged is set to NOW.

Parameters:
state - the ReplicaStoreState.
Throws:
ArgumentNotValid - If the state is null.

getLastChanged

public java.util.Date getLastChanged()
Get the Date for when the state was lastchanged.

Returns:
the Date for when the state was lastchanged

toString

public java.lang.String toString()
Creates an string representation of this instance.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this instance.