eu.xtreemos.xosd.localallocmgr.migrations
Class TimeMachine

java.lang.Object
  extended by eu.xtreemos.xosd.localallocmgr.migrations.TimeMachine

public class TimeMachine
extends java.lang.Object

usage: remember how much migrations are present in the time machine, do the changes, and if not all well, restore all of them till the last ok migration. This can be done on multiple timetables (from different resources).

Author:
urosjovanovic

Field Summary
static int MAX_ELEMENTS
           
static java.util.LinkedList<TimeMachineItem> ttMigrations
           
 
Constructor Summary
TimeMachine()
           
 
Method Summary
static void addMigration4TimeTable(TimeMachineItem state)
           
static void clear()
          removes all stored objects
static java.lang.Long getLastMigrationNumber()
          returns the last migration counter.
static int numMigrations()
           
static void restore()
           
static void restore(int nOperations)
          restores last n operations
static void restoreTo(int version)
          restores to the n-th operation over timetable, the oprations start at version 0, and each successful manipulation with the timetable increases the migrations size by 1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ELEMENTS

public static final int MAX_ELEMENTS
See Also:
Constant Field Values

ttMigrations

public static java.util.LinkedList<TimeMachineItem> ttMigrations
Constructor Detail

TimeMachine

public TimeMachine()
Method Detail

getLastMigrationNumber

public static java.lang.Long getLastMigrationNumber()
returns the last migration counter. TODO: should separate the migration counter and the buffer size, since there is difference ...

Returns:

addMigration4TimeTable

public static void addMigration4TimeTable(TimeMachineItem state)

restore

public static void restore()
                    throws AttributeConformanceException
Throws:
AttributeConformanceException

restore

public static void restore(int nOperations)
                    throws AttributeConformanceException
restores last n operations

Parameters:
nOperations -
tt -
Throws:
AttributeConformanceException

restoreTo

public static void restoreTo(int version)
                      throws AttributeConformanceException
restores to the n-th operation over timetable, the oprations start at version 0, and each successful manipulation with the timetable increases the migrations size by 1.

Parameters:
version -
tt -
Throws:
AttributeConformanceException

clear

public static void clear()
removes all stored objects


numMigrations

public static int numMigrations()