info.magnolia.module.delta
Class DeltaBuilder

java.lang.Object
  extended by info.magnolia.module.delta.DeltaBuilder
All Implemented Interfaces:
Delta

public class DeltaBuilder
extends Object
implements Delta

Helper class to build Delta instances.


Method Summary
 DeltaBuilder addCondition(Condition c)
           
 DeltaBuilder addConditions(List<Condition> conditions)
           
 DeltaBuilder addTask(Task t)
           
 DeltaBuilder addTasks(List<Task> tasks)
           
static DeltaBuilder checkPrecondition(String minimalVersion, String newVersion)
           
 List<Condition> getConditions()
          Returns the list of Conditions which have to be checked before this Delta's Tasks can be executed.
 String getDescription()
           
 List<Task> getTasks()
          Should not return a read-only List, as the version handler might add tasks as appropriate.
 DeltaType getType()
           
 Version getVersion()
          Returns the version number for which this Delta is needed.
static DeltaBuilder install(Version version, String description)
           
static DeltaBuilder startup(ModuleDefinition moduleDef, List<Task> tasks)
           
static DeltaBuilder startup(Version version, String description)
          TODO : it seems irrelevant to have a Version in startup tasks.
static DeltaBuilder update(String toVersionString, String description)
           
static DeltaBuilder update(Version toVersion, String description)
           
static DeltaBuilder update(Version toVersion, String description, Task task)
          Convenience factory method for an Update Delta with a single task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

update

public static DeltaBuilder update(Version toVersion,
                                  String description,
                                  Task task)
Convenience factory method for an Update Delta with a single task.


update

public static DeltaBuilder update(String toVersionString,
                                  String description)

update

public static DeltaBuilder update(Version toVersion,
                                  String description)

install

public static DeltaBuilder install(Version version,
                                   String description)

startup

public static DeltaBuilder startup(ModuleDefinition moduleDef,
                                   List<Task> tasks)

checkPrecondition

public static DeltaBuilder checkPrecondition(String minimalVersion,
                                             String newVersion)

startup

public static DeltaBuilder startup(Version version,
                                   String description)
TODO : it seems irrelevant to have a Version in startup tasks. These should probably be moved to ModuleLifecycle.


addTask

public DeltaBuilder addTask(Task t)

addTasks

public DeltaBuilder addTasks(List<Task> tasks)

addCondition

public DeltaBuilder addCondition(Condition c)

addConditions

public DeltaBuilder addConditions(List<Condition> conditions)

getVersion

public Version getVersion()
Description copied from interface: Delta
Returns the version number for which this Delta is needed.

Specified by:
getVersion in interface Delta

getDescription

public String getDescription()
Specified by:
getDescription in interface Delta

getConditions

public List<Condition> getConditions()
Description copied from interface: Delta
Returns the list of Conditions which have to be checked before this Delta's Tasks can be executed.

Specified by:
getConditions in interface Delta

getTasks

public List<Task> getTasks()
Description copied from interface: Delta
Should not return a read-only List, as the version handler might add tasks as appropriate.

Specified by:
getTasks in interface Delta

getType

public DeltaType getType()
Specified by:
getType in interface Delta


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.