Package com.nt.udc.util.state
Interface StateDirectorySaveable
public interface StateDirectorySaveable
This interface should be implemented by an Object that
needs to save/restore its state to a directory. It is recommended
that the implementor of this interface create and manage a
sub-directory of the given "stateDir" parameter.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
mergeStateData
(File[] stateDirs, File mergeDir) Merges all state data from the stateDirs to the mergeDir.void
restoreState
(File mergeDir) Restores the state from a directory that contains a "merged" state, as created by this Object's mergeStateData method.void
Save the Object's state to the given directory.
-
Method Details
-
saveState
Save the Object's state to the given directory.- Parameters:
stateDir
- Location to save the state data.- Throws:
StateException
-
restoreState
Restores the state from a directory that contains a "merged" state, as created by this Object's mergeStateData method.- Parameters:
mergeDir
- Location to obtain the merged state data.- Throws:
StateException
-
mergeStateData
Merges all state data from the stateDirs to the mergeDir. Once completed, the Object should not need any information from the stateDirs - the information should all be within the mergeDir.- Parameters:
stateDirs
- Current state directoriesmergeDir
- New state merge directory- Throws:
StateException
-