com.xebialabs.deployit.mapper
Class StepGeneratingMapper<S extends java.io.Serializable,M extends Mapping,T extends java.io.Serializable>

java.lang.Object
  extended by com.xebialabs.deployit.mapper.Mapper<S,M,T>
      extended by com.xebialabs.deployit.mapper.StepGeneratingMapper<S,M,T>
Type Parameters:
S - the type of the source artifact/resource.
M - the type of the mapping.
T - the type of the target middleware.
Direct Known Subclasses:
ConfigurationFilesToHostMapper, LibrariesToHostMapper, MappingAgnosticStepGeneratingMapper, ModificationSupportingStepGeneratingMapper, SqlScriptToDatabaseMapper

public abstract class StepGeneratingMapper<S extends java.io.Serializable,M extends Mapping,T extends java.io.Serializable>
extends Mapper<S,M,T>

A mapper that can generate steps for added, modified and deleted steps.


Field Summary
 
Fields inherited from class com.xebialabs.deployit.mapper.Mapper
addedMappings, change, deletedMappings, modifiedMappings, newMappings, oldMappings
 
Constructor Summary
StepGeneratingMapper(Change<Deployment> change)
          Creates a StepGeneratingMapper for the specified deployment change that will apply default mappings.
StepGeneratingMapper(Change<Deployment> change, boolean applyDefaultMappings)
          Creates a StepGeneratingMapper for the specified deployment change.
 
Method Summary
 void generateAdditionSteps(java.util.List<Step> steps)
          Generates all the steps that will add artifacts/resources to the middleware.
protected abstract  void generateAdditionStepsForAddedMapping(S newMappingSource, M newMapping, T newMappingTarget, java.util.List<Step> steps)
          Must be implemented by a subclass to generate steps that add an artifact/a resource to the middleware when a mapping is added.
protected  void generateAdditionStepsForModifiedMapping(S newMappingSource, M newVersionOfModifiedMapping, T newMappingTarget, java.util.List<Step> steps)
          Can be overridden by a subclass to generate steps that add an artifact/a resource to the middleware when a mapping is modified.
 void generateDeletionSteps(java.util.List<Step> steps)
          Generates all the steps that will delete artifacts/resources from the middleware.
protected abstract  void generateDeletionStepsForDeletedMapping(S oldMappingSource, M oldVersionOfModifiedMapping, T oldMappingTarget, java.util.List<Step> steps)
          Must be implemented by a subclass to generate steps that delete an artifact/a resource from the middleware when a mapping is deleted.
protected  void generateDeletionStepsForModifiedMapping(S oldMappingSource, M oldVersionOfModifiedMapping, T oldMappingTarget, java.util.List<Step> steps)
          Can be overridden by a subclass to generate steps that delete an artifact/a resource from the middleware when a mapping is modified.
 
Methods inherited from class com.xebialabs.deployit.mapper.Mapper
getAddedMappings, getAffectedTargets, getAllTargets, getDeletedMappings, getModifiedMappings, getNewMappings, getNewTargets, getOldMappings, getOldTargets, init, setDefaults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StepGeneratingMapper

public StepGeneratingMapper(Change<Deployment> change,
                            boolean applyDefaultMappings)
Creates a StepGeneratingMapper for the specified deployment change.

Parameters:
change - the deployment change for which to calculate mappings.
applyDefaultMappings - default mappings will be applied iff true

StepGeneratingMapper

public StepGeneratingMapper(Change<Deployment> change)
Creates a StepGeneratingMapper for the specified deployment change that will apply default mappings.

Parameters:
change - the deployment change for which to calculate mappings.
Method Detail

generateAdditionSteps

public final void generateAdditionSteps(java.util.List<Step> steps)
Generates all the steps that will add artifacts/resources to the middleware.

Parameters:
steps - the list of steps to which the generated steps are to be added

generateDeletionSteps

public final void generateDeletionSteps(java.util.List<Step> steps)
Generates all the steps that will delete artifacts/resources from the middleware.

Parameters:
steps - the list of steps to which the generated steps are to be added

generateAdditionStepsForAddedMapping

protected abstract void generateAdditionStepsForAddedMapping(S newMappingSource,
                                                             M newMapping,
                                                             T newMappingTarget,
                                                             java.util.List<Step> steps)
Must be implemented by a subclass to generate steps that add an artifact/a resource to the middleware when a mapping is added.

Parameters:
newMappingSource - the source of the new mapping. The value is identical to newMapping.getSource() but it is provided separately so that the implementor of this method does not have to cast it.
newMapping - the new mapping
newMappingTarget - the target of the new mapping. The value is identical to newMapping.getTarget() but it is provided separately so that the implementor of this method does not have to cast it.
steps - the list of steps to which the generated steps are to be added

generateAdditionStepsForModifiedMapping

protected void generateAdditionStepsForModifiedMapping(S newMappingSource,
                                                       M newVersionOfModifiedMapping,
                                                       T newMappingTarget,
                                                       java.util.List<Step> steps)
Can be overridden by a subclass to generate steps that add an artifact/a resource to the middleware when a mapping is modified. The default implementation invokes generateAdditionStepsForAddedMapping(Serializable, Mapping, Serializable, List).

Parameters:
newMappingSource - the new source of the mapping. The value is identical to newVersionOfModifiedMapping.getSource() but it is provided separately so that the implementor of this method does not have to cast it.
newVersionOfModifiedMapping - the new mapping
newMappingTarget - the new target of the mapping. The value is identical to newVersionOfModifiedMapping.getTarget() but it is provided separately so that the implementor of this method does not have to cast it.
steps - the list of steps to which the generated steps are to be added

generateDeletionStepsForModifiedMapping

protected void generateDeletionStepsForModifiedMapping(S oldMappingSource,
                                                       M oldVersionOfModifiedMapping,
                                                       T oldMappingTarget,
                                                       java.util.List<Step> steps)
Can be overridden by a subclass to generate steps that delete an artifact/a resource from the middleware when a mapping is modified. The default implementation invokes generateDeletionStepsForModifiedMapping(Serializable, Mapping, Serializable, List).

Parameters:
oldMappingSource - the old source of the modified mapping. The value is identical to oldVersionOfModifiedMapping.getSource() but it is provided separately so that the implementor of this method does not have to cast it.
oldVersionOfModifiedMapping - the old mapping
oldMappingTarget - the old target of the modified mapping. The value is identical to oldVersionOfModifiedMapping.getTarget() but it is provided separately so that the implementor of this method does not have to cast it.
steps - the list of steps to which the generated steps are to be added

generateDeletionStepsForDeletedMapping

protected abstract void generateDeletionStepsForDeletedMapping(S oldMappingSource,
                                                               M oldVersionOfModifiedMapping,
                                                               T oldMappingTarget,
                                                               java.util.List<Step> steps)
Must be implemented by a subclass to generate steps that delete an artifact/a resource from the middleware when a mapping is deleted.

Parameters:
oldMappingSource - the source of the old mapping. The value is identical to oldMapping.getSource() but it is provided separately so that the implementor of this method does not have to cast it.
oldVersionOfModifiedMapping - the old mapping
oldMappingTarget - the target of the old mapping. The value is identical to oldMapping.getTarget() but it is provided separately so that the implementor of this method does not have to cast it.
steps - the list of steps to which the generated steps are to be added


Copyright © 2010. All Rights Reserved.