Brooklyn

brooklyn.entity.chef
[Java] Class KnifeConvergeTaskFactory

java.lang.Object
  brooklyn.util.task.system.ProcessTaskStub
      brooklyn.util.task.system.internal.AbstractProcessTaskFactory
          brooklyn.util.task.system.internal.SystemProcessTaskFactory
              brooklyn.entity.chef.KnifeTaskFactory
                  brooklyn.entity.chef.KnifeConvergeTaskFactory

public class KnifeConvergeTaskFactory
extends KnifeTaskFactory

Field Summary
protected java.util.List extraBootstrapParameters

protected java.util.Map knifeAttributes

protected java.lang.String nodeName

protected java.lang.Integer port

protected java.lang.Boolean portOmittedToUseKnifeDefault

null means nothing specified, use user supplied or machine default; false means use machine default (disallow user supplied); true means use knife default (omit the argument and disallow user supplied)

protected Function runList

protected java.lang.Boolean runTwice

protected java.lang.Boolean sudo

 
Fields inherited from class KnifeTaskFactory
knifeConfigFile, knifeExecutable, knifeParameters, knifeSetupCommands, taskName, throwOnCommonKnifeErrors
 
Fields inherited from class AbstractProcessTaskFactory
dirty
 
Fields inherited from class ProcessTaskStub
commands, completionListeners, config, extraErrorMessage, machine, requireExitCodeZero, returnResultTransformation, returnType, runAsRoot, runAsScript, shellEnvironment, summary
 
Constructor Summary
KnifeConvergeTaskFactory(java.lang.String taskName)

 
Method Summary
protected java.lang.String buildKnifeCommand(int knifeCommandIndex)

protected java.util.List initialKnifeParameters()

construct the knife command, based on the settings on other methods (called when instantiating the script, after all parameters sent)

KnifeConvergeTaskFactory knifeAddAttributes(java.util.Map attributes)

KnifeConvergeTaskFactory knifeAddExtraBootstrapParameters(java.lang.String extraBootstrapParameter1, java.lang.String... extraBootstrapParameters)

parameters to pass to knife after the bootstrap command

KnifeConvergeTaskFactory knifeAddParameters(java.lang.String word1, java.lang.String... words)

KnifeConvergeTaskFactory knifeNodeName(java.lang.String nodeName)

what node name to pass to knife; default = null, meaning chef-client will pick the node name

KnifeConvergeTaskFactory knifePort(int port)

tell knife to use an explicit port

KnifeConvergeTaskFactory knifePortUseKnifeDefault()

omit the port parameter altogether (let knife use its default)

KnifeConvergeTaskFactory knifePortUseMachineSshPort()

use the default port known to brooklyn for the target machine for ssh

KnifeConvergeTaskFactory knifeRunList(Function runList)

function supplying the run list to be passed to knife, evaluated at the last moment

KnifeConvergeTaskFactory knifeRunList(java.lang.String runList)

KnifeConvergeTaskFactory knifeRunTwice(boolean runTwice)

whether knife should attempt to run twice; see ChefConfig#CHEF_RUN_CONVERGE_TWICE#CHEF_RUN_CONVERGE_TWICE

KnifeConvergeTaskFactory knifeSudo(boolean sudo)

whether to pass --sudo to knife; default true

protected java.lang.Integer knifeWhichPort(HostAndPort hostAndPort)

KnifeConvergeTaskFactory requiringZeroAndReturningStdout()

KnifeConvergeTaskFactory returning(ScriptReturnType type)

KnifeConvergeTaskFactory returning(Function resultTransformation)

KnifeConvergeTaskFactory returningIsExitCodeZero()

protected KnifeConvergeTaskFactory self()

 
Methods inherited from class KnifeTaskFactory
addKnifeCommandToScript, buildKnifeCommand, entity, entityConfig, getCommands, getCompletionListeners, initialKnifeParameters, insertKnifeCompletionListenerIntoCompletionListenersList, knifeAddParameters, knifeConfigFile, knifeConfigFileOption, knifeExecutable, knifeExecutable, knifeParameters, knifeSetupCommands, knifeSetupCommands, newTask, notThrowingOnCommonKnifeErrors, requiringZeroAndReturningStdout, returning, returning, returningIsExitCodeZero
 
Methods inherited from class SystemProcessTaskFactory
machine, newExecWithLoggingHelpers, newTask
 
Methods inherited from class AbstractProcessTaskFactory
add, add, addCompletionListener, allowingNonZeroExitCode, configure, constructCustomizedTaskBuilder, environmentVariable, environmentVariables, finalize, machine, markDirty, requiringExitCodeZero, requiringExitCodeZero, requiringZeroAndReturningStdout, returning, returning, returningIsExitCodeZero, runAsCommand, runAsRoot, runAsScript, self, summary
 
Methods inherited from class ProcessTaskStub
getCommands, getCompletionListeners, getConfig, getMachine, getShellEnvironment, getSummary, toString
 

Field Detail

extraBootstrapParameters

protected java.util.List extraBootstrapParameters


knifeAttributes

protected java.util.Map knifeAttributes


nodeName

protected java.lang.String nodeName


port

protected java.lang.Integer port


portOmittedToUseKnifeDefault

protected java.lang.Boolean portOmittedToUseKnifeDefault
null means nothing specified, use user supplied or machine default; false means use machine default (disallow user supplied); true means use knife default (omit the argument and disallow user supplied)


runList

protected Function runList


runTwice

protected java.lang.Boolean runTwice


sudo

protected java.lang.Boolean sudo


 
Constructor Detail

KnifeConvergeTaskFactory

public KnifeConvergeTaskFactory(java.lang.String taskName)


 
Method Detail

buildKnifeCommand

protected java.lang.String buildKnifeCommand(int knifeCommandIndex)


initialKnifeParameters

protected java.util.List initialKnifeParameters()
construct the knife command, based on the settings on other methods (called when instantiating the script, after all parameters sent)


knifeAddAttributes

public KnifeConvergeTaskFactory knifeAddAttributes(java.util.Map attributes)


knifeAddExtraBootstrapParameters

public KnifeConvergeTaskFactory knifeAddExtraBootstrapParameters(java.lang.String extraBootstrapParameter1, java.lang.String... extraBootstrapParameters)
parameters to pass to knife after the bootstrap command


knifeAddParameters

public KnifeConvergeTaskFactory knifeAddParameters(java.lang.String word1, java.lang.String... words)


knifeNodeName

public KnifeConvergeTaskFactory knifeNodeName(java.lang.String nodeName)
what node name to pass to knife; default = null, meaning chef-client will pick the node name


knifePort

public KnifeConvergeTaskFactory knifePort(int port)
tell knife to use an explicit port


knifePortUseKnifeDefault

public KnifeConvergeTaskFactory knifePortUseKnifeDefault()
omit the port parameter altogether (let knife use its default)


knifePortUseMachineSshPort

public KnifeConvergeTaskFactory knifePortUseMachineSshPort()
use the default port known to brooklyn for the target machine for ssh


knifeRunList

public KnifeConvergeTaskFactory knifeRunList(Function runList)
function supplying the run list to be passed to knife, evaluated at the last moment


knifeRunList

public KnifeConvergeTaskFactory knifeRunList(java.lang.String runList)


knifeRunTwice

public KnifeConvergeTaskFactory knifeRunTwice(boolean runTwice)
whether knife should attempt to run twice; see ChefConfig#CHEF_RUN_CONVERGE_TWICE#CHEF_RUN_CONVERGE_TWICE


knifeSudo

public KnifeConvergeTaskFactory knifeSudo(boolean sudo)
whether to pass --sudo to knife; default true


knifeWhichPort

protected java.lang.Integer knifeWhichPort(HostAndPort hostAndPort)


requiringZeroAndReturningStdout

super.knifeAddParameters(word1, words);
public KnifeConvergeTaskFactory requiringZeroAndReturningStdout()


returning

public  KnifeConvergeTaskFactory returning(Function, RET2> resultTransformation) {
public KnifeConvergeTaskFactory returning(ScriptReturnType type)


returning

public KnifeConvergeTaskFactory returningIsExitCodeZero() {
public KnifeConvergeTaskFactory returning(Function resultTransformation)


returningIsExitCodeZero

public KnifeConvergeTaskFactory requiringZeroAndReturningStdout() {
public KnifeConvergeTaskFactory returningIsExitCodeZero()


self

@Override
protected KnifeConvergeTaskFactory self()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.