com.xebialabs.deployit.plugin.generic.step
Class BaseStep<C extends com.xebialabs.deployit.plugin.api.execution.ExecutionContext>

java.lang.Object
  extended by com.xebialabs.deployit.plugin.generic.step.BaseStep<C>
All Implemented Interfaces:
com.xebialabs.deployit.plugin.api.execution.Step<C>, java.io.Serializable
Direct Known Subclasses:
BaseDeploymentStep, BaseExecutionStep, GenericBaseStep

public abstract class BaseStep<C extends com.xebialabs.deployit.plugin.api.execution.ExecutionContext>
extends java.lang.Object
implements com.xebialabs.deployit.plugin.api.execution.Step<C>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.xebialabs.deployit.plugin.api.execution.Step
com.xebialabs.deployit.plugin.api.execution.Step.Result
 
Field Summary
static java.lang.String FREEMARKER_FILE_EXT
           
protected  org.slf4j.Logger logger
           
 
Constructor Summary
protected BaseStep(com.xebialabs.deployit.plugin.overthere.HostContainer container)
           
protected BaseStep(java.lang.String description, com.xebialabs.deployit.plugin.overthere.HostContainer container)
           
 
Method Summary
 boolean classpathResourceExists(java.lang.String resource)
           
 void createOrReplaceHostFile(java.lang.String content, java.lang.String remoteFile)
           
protected  void disconnect()
           
protected abstract  com.xebialabs.deployit.plugin.api.execution.Step.Result doExecute()
           
protected  void evaluateTemplate(com.xebialabs.overthere.OverthereFile renderTo, java.lang.String templatePath, java.util.Map<java.lang.String,java.lang.Object> vars)
           
 java.lang.String evaluateTemplate(java.lang.String templatePath, java.util.Map<java.lang.String,java.lang.Object> vars)
           
protected  com.xebialabs.deployit.plugin.overthere.HostContainer getContainer()
           
protected  C getCtx()
           
 java.lang.String getDescription()
           
 java.lang.String getHostFileSeparator()
           
 java.lang.String getHostLineSeparator()
           
 com.xebialabs.overthere.OverthereConnection getLocalConnection()
           
 com.xebialabs.overthere.OverthereConnection getRemoteConnection()
           
 com.xebialabs.overthere.OverthereFile getRemoteWorkingDirectory()
           
 java.lang.String getRemoteWorkingDirPath()
           
 com.xebialabs.deployit.plugin.api.execution.Step.Result handleExecute(C ctx)
           
 boolean hostFileExists(java.lang.String remoteFile)
           
 boolean isRetainRemoteWorkingDirOnCompletion()
           
 java.lang.String readHostFile(java.lang.String remoteFile)
           
 java.lang.String[] readHostFileLines(java.lang.String remoteFile)
           
 freemarker.ext.dom.NodeModel readHostXmlFileAsModel(java.lang.String remoteXmlFile)
           
 java.lang.String resolveOsSpecificTemplate(java.lang.String template)
           
 void setRemoteWorkingDirPath(java.lang.String remoteWorkingDirPath)
           
 void setRetainRemoteWorkingDirOnCompletion(boolean deleteWorkingDirOnCompletion)
           
 java.lang.String substringAfterLast(java.lang.String str, char sub)
           
 java.lang.String substringAfterLast(java.lang.String str, char sub, java.lang.String defaultValue)
           
protected  com.xebialabs.overthere.OverthereFile uploadToWorkingDirectory(java.io.File content, java.lang.String fileName)
           
protected  com.xebialabs.overthere.OverthereFile uploadToWorkingDirectory(java.lang.String content, java.lang.String fileName)
           
protected  com.xebialabs.overthere.OverthereFile uploadToWorkingDirectory(java.net.URL content, java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.xebialabs.deployit.plugin.api.execution.Step
execute
 

Field Detail

FREEMARKER_FILE_EXT

public static final java.lang.String FREEMARKER_FILE_EXT
See Also:
Constant Field Values

logger

protected final org.slf4j.Logger logger
Constructor Detail

BaseStep

protected BaseStep(java.lang.String description,
                   com.xebialabs.deployit.plugin.overthere.HostContainer container)

BaseStep

protected BaseStep(com.xebialabs.deployit.plugin.overthere.HostContainer container)
Method Detail

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface com.xebialabs.deployit.plugin.api.execution.Step<C extends com.xebialabs.deployit.plugin.api.execution.ExecutionContext>

handleExecute

public com.xebialabs.deployit.plugin.api.execution.Step.Result handleExecute(C ctx)
                                                                      throws java.lang.Exception
Throws:
java.lang.Exception

doExecute

protected abstract com.xebialabs.deployit.plugin.api.execution.Step.Result doExecute()
                                                                              throws java.lang.Exception
Throws:
java.lang.Exception

getCtx

protected C getCtx()

getContainer

protected com.xebialabs.deployit.plugin.overthere.HostContainer getContainer()

getRemoteWorkingDirectory

public com.xebialabs.overthere.OverthereFile getRemoteWorkingDirectory()

getLocalConnection

public com.xebialabs.overthere.OverthereConnection getLocalConnection()

getRemoteConnection

public com.xebialabs.overthere.OverthereConnection getRemoteConnection()

disconnect

protected void disconnect()

getRemoteWorkingDirPath

public java.lang.String getRemoteWorkingDirPath()

setRemoteWorkingDirPath

public void setRemoteWorkingDirPath(java.lang.String remoteWorkingDirPath)

isRetainRemoteWorkingDirOnCompletion

public boolean isRetainRemoteWorkingDirOnCompletion()

setRetainRemoteWorkingDirOnCompletion

public void setRetainRemoteWorkingDirOnCompletion(boolean deleteWorkingDirOnCompletion)

uploadToWorkingDirectory

protected com.xebialabs.overthere.OverthereFile uploadToWorkingDirectory(java.lang.String content,
                                                                         java.lang.String fileName)

uploadToWorkingDirectory

protected com.xebialabs.overthere.OverthereFile uploadToWorkingDirectory(java.io.File content,
                                                                         java.lang.String fileName)

uploadToWorkingDirectory

protected com.xebialabs.overthere.OverthereFile uploadToWorkingDirectory(java.net.URL content,
                                                                         java.lang.String fileName)

hostFileExists

public boolean hostFileExists(java.lang.String remoteFile)

getHostLineSeparator

public java.lang.String getHostLineSeparator()

getHostFileSeparator

public java.lang.String getHostFileSeparator()

readHostFile

public java.lang.String readHostFile(java.lang.String remoteFile)

readHostFileLines

public java.lang.String[] readHostFileLines(java.lang.String remoteFile)

createOrReplaceHostFile

public void createOrReplaceHostFile(java.lang.String content,
                                    java.lang.String remoteFile)

readHostXmlFileAsModel

public freemarker.ext.dom.NodeModel readHostXmlFileAsModel(java.lang.String remoteXmlFile)

evaluateTemplate

public java.lang.String evaluateTemplate(java.lang.String templatePath,
                                         java.util.Map<java.lang.String,java.lang.Object> vars)

resolveOsSpecificTemplate

public java.lang.String resolveOsSpecificTemplate(java.lang.String template)

classpathResourceExists

public boolean classpathResourceExists(java.lang.String resource)

evaluateTemplate

protected void evaluateTemplate(com.xebialabs.overthere.OverthereFile renderTo,
                                java.lang.String templatePath,
                                java.util.Map<java.lang.String,java.lang.Object> vars)

substringAfterLast

public java.lang.String substringAfterLast(java.lang.String str,
                                           char sub,
                                           java.lang.String defaultValue)

substringAfterLast

public java.lang.String substringAfterLast(java.lang.String str,
                                           char sub)