Class 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
    • Constructor Detail

      • RestoreService

        public RestoreService()
    • Method Detail

      • start

        public void start​(long restoreFrom,
                          long restoreTo,
                          List<Map> options)
                   throws ArchiveException
        Starts a new restore process with a EJB TimerService

        The 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 from
        datTo - - syncpoint to
        options - - optional list of item map.
        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 options
        metaData - - metaData object