info.magnolia.module.delta
Class DeltaBuilder

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

public class DeltaBuilder
extends java.lang.Object
implements Delta

Helper class to build Delta instances.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Method Summary
 DeltaBuilder addCondition(Condition c)
           
 DeltaBuilder addConditions(java.util.List<Condition> conditions)
           
 DeltaBuilder addTask(Task t)
           
 DeltaBuilder addTasks(java.util.List<Task> tasks)
           
 java.util.List<Condition> getConditions()
          Returns the list of Conditions which have to be checked before this Delta's Tasks can be executed.
 java.lang.String getDescription()
           
 java.util.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, java.lang.String description)
           
static DeltaBuilder startup(ModuleDefinition moduleDef, java.util.List<Task> tasks)
           
static DeltaBuilder startup(Version version, java.lang.String description)
          TODO : it seems irrelevant to have a Version in startup tasks.
static DeltaBuilder update(java.lang.String versionStr, java.lang.String description)
           
static DeltaBuilder update(Version version, java.lang.String description)
           
static DeltaBuilder update(Version v, java.lang.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 v,
                                  java.lang.String description,
                                  Task task)
Convenience factory method for an Update Delta with a single task.


update

public static DeltaBuilder update(java.lang.String versionStr,
                                  java.lang.String description)

update

public static DeltaBuilder update(Version version,
                                  java.lang.String description)

install

public static DeltaBuilder install(Version version,
                                   java.lang.String description)

startup

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

startup

public static DeltaBuilder startup(Version version,
                                   java.lang.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(java.util.List<Task> tasks)

addCondition

public DeltaBuilder addCondition(Condition c)

addConditions

public DeltaBuilder addConditions(java.util.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 java.lang.String getDescription()
Specified by:
getDescription in interface Delta

getConditions

public java.util.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 java.util.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-2011 Magnolia International Ltd.. All Rights Reserved.