com.xebialabs.deployit.plugin.generic.deployed
Class ExecutedFolder<D extends Folder>

java.lang.Object
  extended by com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
      extended by com.xebialabs.deployit.plugin.api.udm.base.BaseDeployed<D,com.xebialabs.deployit.plugin.overthere.HostContainer>
          extended by com.xebialabs.deployit.plugin.generic.deployed.AbstractDeployed<D>
              extended by com.xebialabs.deployit.plugin.generic.deployed.ExecutedFolder<D>
All Implemented Interfaces:
com.xebialabs.deployit.plugin.api.udm.artifact.Artifact, com.xebialabs.deployit.plugin.api.udm.artifact.DerivedArtifact<D>, com.xebialabs.deployit.plugin.api.udm.ConfigurationItem, com.xebialabs.deployit.plugin.api.udm.Deployed<D,com.xebialabs.deployit.plugin.overthere.HostContainer>, java.io.Serializable, java.lang.Comparable<com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem>

@Metadata(virtual=true,
          description="Scripts in the folder are executed against a Container based on a naming convention")
public class ExecutedFolder<D extends Folder>
extends AbstractDeployed<D>
implements com.xebialabs.deployit.plugin.api.udm.artifact.DerivedArtifact<D>

See Also:
Serialized Form

Nested Class Summary
static class ExecutedFolder.FilenameComparator
           
static class ExecutedFolder.FileNameEqualityWrapper
           
 
Field Summary
protected  org.slf4j.Logger logger
           
 
Fields inherited from class com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
id, syntheticProperties, type
 
Fields inherited from interface com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
SYNTHETIC_PROPERTIES_FIELD, TYPE_FIELD
 
Fields inherited from interface com.xebialabs.deployit.plugin.api.udm.Deployed
CONTAINER_FIELD, DEPLOYABLE_FIELD
 
Constructor Summary
ExecutedFolder()
           
 
Method Summary
protected  com.xebialabs.deployit.plugin.api.flow.Step addSteps(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx, ExecutedFolder<D> deployed, java.util.List<java.io.File> scriptsToRun, java.lang.String scriptNameRegex)
           
protected  java.util.List<java.io.File> compareAndIdentifyOrderedRollbackScriptsToRunForDowngrade(java.io.File previousFolder, java.io.File currentFolder)
           
protected  java.util.List<java.io.File> compareAndIdentifyOrderedScriptsToRunForUpgrade(java.io.File previousFolder, java.io.File currentFolder)
           
protected  java.util.Collection<java.io.File> difference(java.util.List<java.io.File> previousFiles, java.util.List<java.io.File> currentFiles)
           
 void executeCreate(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx, com.xebialabs.deployit.plugin.api.deployment.specification.Delta delta)
           
 void executeDestroy(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx, com.xebialabs.deployit.plugin.api.deployment.specification.Delta delta)
           
 void executeModify(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx, com.xebialabs.deployit.plugin.api.deployment.specification.Delta delta)
           
protected  java.lang.String extractScriptPrefix(java.util.regex.Pattern pattern, java.lang.String scriptName)
           
protected  java.util.List<java.io.File> findScriptsToRun(java.io.File folder, java.lang.String pattern)
           
 java.util.Set<java.lang.String> getClasspathResources()
           
 java.lang.String getCommonScriptFolderName()
           
protected  java.io.File getDerivedArtifactAsFile()
           
 java.lang.String getDescription(java.lang.String script, java.lang.String verb)
           
 java.lang.String getExecutorScript()
           
 com.xebialabs.overthere.OverthereFile getFile()
           
 java.util.Map<java.lang.String,java.lang.String> getPlaceholders()
           
 java.lang.String getRollbackScriptPostfix()
           
 java.lang.String getRollbackScriptRecognitionRegex()
           
 java.lang.String getScriptRecognitionRegex()
           
 D getSourceArtifact()
           
 java.util.Set<java.lang.String> getTemplateClasspathResources()
           
protected  java.util.List<java.io.File> identifyAndOrderCreateScriptsInFolder(java.io.File folder)
           
protected  java.util.List<java.io.File> identifyAndOrderRollbackScriptsInFolder(java.io.File folder)
           
protected static ScriptExecutionStep newScriptExecutionStep(java.lang.String script, ExecutedFolder<?> deployed)
           
 java.lang.String resolveExpression(java.lang.String expression)
           
 void setClasspathResources(java.util.Set<java.lang.String> classpathResources)
           
 void setCommonScriptFolderName(java.lang.String commonScriptFolderName)
           
 void setExecutorScript(java.lang.String executorScript)
           
 void setFile(com.xebialabs.overthere.OverthereFile file)
           
 void setPlaceholders(java.util.Map<java.lang.String,java.lang.String> placeholders)
           
 void setRollbackScriptPostfix(java.lang.String rollbackScriptPostfix)
           
 void setRollbackScriptRecognitionRegex(java.lang.String rollbackScriptRecognitionRegex)
           
 void setScriptRecognitionRegex(java.lang.String scriptRecognitionRegex)
           
 void setTemplateClasspathResources(java.util.Set<java.lang.String> templateClasspathResources)
           
protected  java.util.Set<ExecutedFolder.FileNameEqualityWrapper> transform(java.util.List<java.io.File> files)
           
 
Methods inherited from class com.xebialabs.deployit.plugin.generic.deployed.AbstractDeployed
controlTaskDispatch, getCreateOrder, getCreateVerb, getDeployedApplication, getDeployedAsFreeMarkerContext, getDescription, getDestroyOrder, getDestroyVerb, getInspectClasspathResources, getInspectScript, getInspectTemplateClasspathResources, getModifyOrder, getModifyVerb, getNoopOrder, getNoopVerb, getPlanOperation, getPropertyOrContainerDefault, inspectContainer, isRestartRequired, isRestartRequiredForNoop, resolveExpression, resolveExpression, resolveExpression, setCreateOrder, setCreateVerb, setDeployedApplication, setDestroyOrder, setDestroyVerb, setInspectClasspathResources, setInspectScript, setInspectTemplateClasspathResources, setModifyOrder, setModifyVerb, setNoopOrder, setNoopVerb, setPlanOperation, setRestartRequired, setRestartRequiredForNoop
 
Methods inherited from class com.xebialabs.deployit.plugin.api.udm.base.BaseDeployed
getContainer, getDeployable, setContainer, setDeployable
 
Methods inherited from class com.xebialabs.deployit.plugin.api.udm.base.BaseConfigurationItem
compareTo, equals, get$token, getId, getName, getProperty, getPropertyDescriptor, getSyntheticProperties, getSyntheticProperty, getType, hashCode, hasProperty, hasSyntheticProperty, putSyntheticProperties, putSyntheticProperty, set$token, setId, setProperty, setSyntheticProperties, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.xebialabs.deployit.plugin.api.udm.ConfigurationItem
getId, getName, getProperty, getSyntheticProperties, getSyntheticProperty, getType, hasProperty, putSyntheticProperty, setId, setProperty
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

ExecutedFolder

public ExecutedFolder()
Method Detail

resolveExpression

public java.lang.String resolveExpression(java.lang.String expression)
Overrides:
resolveExpression in class AbstractDeployed<D extends Folder>

getDescription

public java.lang.String getDescription(java.lang.String script,
                                       java.lang.String verb)

executeCreate

public void executeCreate(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx,
                          com.xebialabs.deployit.plugin.api.deployment.specification.Delta delta)

addSteps

protected com.xebialabs.deployit.plugin.api.flow.Step addSteps(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx,
                                                               ExecutedFolder<D> deployed,
                                                               java.util.List<java.io.File> scriptsToRun,
                                                               java.lang.String scriptNameRegex)

newScriptExecutionStep

protected static ScriptExecutionStep newScriptExecutionStep(java.lang.String script,
                                                            ExecutedFolder<?> deployed)

extractScriptPrefix

protected java.lang.String extractScriptPrefix(java.util.regex.Pattern pattern,
                                               java.lang.String scriptName)

executeModify

public void executeModify(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx,
                          com.xebialabs.deployit.plugin.api.deployment.specification.Delta delta)

executeDestroy

public void executeDestroy(com.xebialabs.deployit.plugin.api.deployment.planning.DeploymentPlanningContext ctx,
                           com.xebialabs.deployit.plugin.api.deployment.specification.Delta delta)

getDerivedArtifactAsFile

protected java.io.File getDerivedArtifactAsFile()

identifyAndOrderCreateScriptsInFolder

protected java.util.List<java.io.File> identifyAndOrderCreateScriptsInFolder(java.io.File folder)

findScriptsToRun

protected java.util.List<java.io.File> findScriptsToRun(java.io.File folder,
                                                        java.lang.String pattern)

identifyAndOrderRollbackScriptsInFolder

protected java.util.List<java.io.File> identifyAndOrderRollbackScriptsInFolder(java.io.File folder)

compareAndIdentifyOrderedScriptsToRunForUpgrade

protected java.util.List<java.io.File> compareAndIdentifyOrderedScriptsToRunForUpgrade(java.io.File previousFolder,
                                                                                       java.io.File currentFolder)

compareAndIdentifyOrderedRollbackScriptsToRunForDowngrade

protected java.util.List<java.io.File> compareAndIdentifyOrderedRollbackScriptsToRunForDowngrade(java.io.File previousFolder,
                                                                                                 java.io.File currentFolder)

difference

protected java.util.Collection<java.io.File> difference(java.util.List<java.io.File> previousFiles,
                                                        java.util.List<java.io.File> currentFiles)

transform

protected java.util.Set<ExecutedFolder.FileNameEqualityWrapper> transform(java.util.List<java.io.File> files)

getScriptRecognitionRegex

public java.lang.String getScriptRecognitionRegex()

setScriptRecognitionRegex

public void setScriptRecognitionRegex(java.lang.String scriptRecognitionRegex)

getRollbackScriptRecognitionRegex

public java.lang.String getRollbackScriptRecognitionRegex()

setRollbackScriptRecognitionRegex

public void setRollbackScriptRecognitionRegex(java.lang.String rollbackScriptRecognitionRegex)

getCommonScriptFolderName

public java.lang.String getCommonScriptFolderName()

setCommonScriptFolderName

public void setCommonScriptFolderName(java.lang.String commonScriptFolderName)

getExecutorScript

public java.lang.String getExecutorScript()

setExecutorScript

public void setExecutorScript(java.lang.String executorScript)

getRollbackScriptPostfix

public java.lang.String getRollbackScriptPostfix()

setRollbackScriptPostfix

public void setRollbackScriptPostfix(java.lang.String rollbackScriptPostfix)

getClasspathResources

public java.util.Set<java.lang.String> getClasspathResources()

setClasspathResources

public void setClasspathResources(java.util.Set<java.lang.String> classpathResources)

getTemplateClasspathResources

public java.util.Set<java.lang.String> getTemplateClasspathResources()

setTemplateClasspathResources

public void setTemplateClasspathResources(java.util.Set<java.lang.String> templateClasspathResources)

getSourceArtifact

public D getSourceArtifact()
Specified by:
getSourceArtifact in interface com.xebialabs.deployit.plugin.api.udm.artifact.DerivedArtifact<D extends Folder>

getPlaceholders

public java.util.Map<java.lang.String,java.lang.String> getPlaceholders()
Specified by:
getPlaceholders in interface com.xebialabs.deployit.plugin.api.udm.artifact.DerivedArtifact<D extends Folder>

setPlaceholders

public void setPlaceholders(java.util.Map<java.lang.String,java.lang.String> placeholders)
Specified by:
setPlaceholders in interface com.xebialabs.deployit.plugin.api.udm.artifact.DerivedArtifact<D extends Folder>

getFile

public com.xebialabs.overthere.OverthereFile getFile()
Specified by:
getFile in interface com.xebialabs.deployit.plugin.api.udm.artifact.Artifact

setFile

public void setFile(com.xebialabs.overthere.OverthereFile file)
Specified by:
setFile in interface com.xebialabs.deployit.plugin.api.udm.artifact.Artifact