Class RestoreService
- java.lang.Object
-
- org.imixs.archive.service.restore.RestoreService
-
public class RestoreService extends Object
The RestoreService restores the workflow data stored in the cassandra cluster into a Imixs-Workflow instance. The service class runs in the background as a TimerService.The scheduler configuration is stored in the Metadata object of the cassandra keyspace. The following attributes are defining the restore procedure:
restore.from: the earliest snapshot syncpoint to be restored (can be 0)
restore.to: the latest snapshot syncpoint to be restored
restore.point: the current snapshot syncpoint. This date is used to select snapshots by date in a cassandra partion.
restore.count: count of restored snapshots
restore.size: bytes of restored snapshot data
The timer is stopped after all snapshots in the restore time range (restore.from - restore.to) are restored.
- Version:
- 1.0
- Author:
- rsoika
-
-
Field Summary
Fields Modifier and Type Field Description static StringITEM_RESTORE_FROMstatic StringITEM_RESTORE_OPTIONSstatic StringITEM_RESTORE_SYNCCOUNTstatic StringITEM_RESTORE_SYNCERRORSstatic StringITEM_RESTORE_SYNCPOINTstatic StringITEM_RESTORE_SYNCSIZEstatic StringITEM_RESTORE_TOstatic StringMESSAGE_TOPICstatic StringTIMER_ID_RESTORESERVICEstatic longTIMER_INTERVAL_DURATION
-
Constructor Summary
Constructors Constructor Description RestoreService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Stops the current restore processjavax.ejb.TimerfindTimer()This method returns a timer for a corresponding id if such a timer object exists.List<org.imixs.workflow.ItemCollection>getOptions(org.imixs.workflow.ItemCollection metaData)returns the optional embedded Map List of the options, stored in the metadata object.voidsetOptions(List<org.imixs.workflow.ItemCollection> options, org.imixs.workflow.ItemCollection metaData)Convert a List of ItemCollections back into a List of Map elementsvoidstart(long restoreFrom, long restoreTo, List<Map> options)Starts a new restore process with a EJB TimerService
-
-
-
Field Detail
-
TIMER_ID_RESTORESERVICE
public static final String TIMER_ID_RESTORESERVICE
- See Also:
- Constant Field Values
-
TIMER_INTERVAL_DURATION
public static final long TIMER_INTERVAL_DURATION
- See Also:
- Constant Field Values
-
ITEM_RESTORE_FROM
public static final String ITEM_RESTORE_FROM
- See Also:
- Constant Field Values
-
ITEM_RESTORE_TO
public static final String ITEM_RESTORE_TO
- See Also:
- Constant Field Values
-
ITEM_RESTORE_SYNCPOINT
public static final String ITEM_RESTORE_SYNCPOINT
- See Also:
- Constant Field Values
-
ITEM_RESTORE_SYNCCOUNT
public static final String ITEM_RESTORE_SYNCCOUNT
- See Also:
- Constant Field Values
-
ITEM_RESTORE_SYNCERRORS
public static final String ITEM_RESTORE_SYNCERRORS
- See Also:
- Constant Field Values
-
ITEM_RESTORE_SYNCSIZE
public static final String ITEM_RESTORE_SYNCSIZE
- See Also:
- Constant Field Values
-
ITEM_RESTORE_OPTIONS
public static final String ITEM_RESTORE_OPTIONS
- See Also:
- Constant Field Values
-
MESSAGE_TOPIC
public static final String MESSAGE_TOPIC
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start(long restoreFrom, long restoreTo, List<Map> options) throws ArchiveExceptionStarts a new restore process with a EJB TimerServiceThe Timer will be started imediatly with a intervall duration defined by the constante TIMER_INTERVAL_DURATION
The meta data for the restore process is stored in the metadata object.
The restore process selects snapshot data by date (SNAPSHOTS_BY_MODIFIED). The current date is stored in the meta data. The meta data is updated after each iteration.
- Parameters:
datFrom- - syncpoint fromdatTo- - syncpoint tooptions- - optional list of item map.- Throws:
ArchiveException
-
cancel
public void cancel() throws ArchiveExceptionStops the current restore process- Throws:
ArchiveException
-
findTimer
public javax.ejb.Timer findTimer()
This method returns a timer for a corresponding id if such a timer object exists.- Parameters:
id-- Returns:
- Timer
- Throws:
Exception
-
getOptions
public List<org.imixs.workflow.ItemCollection> getOptions(org.imixs.workflow.ItemCollection metaData)
returns the optional embedded Map List of the options, stored in the metadata object.
-
setOptions
public void setOptions(List<org.imixs.workflow.ItemCollection> options, org.imixs.workflow.ItemCollection metaData)
Convert a List of ItemCollections back into a List of Map elements- Parameters:
options- - list of optionsmetaData- - metaData object
-
-