Groovy Documentation

org.linkedin.glu.agent.impl.script
[Groovy] Class ScriptManagerImpl

java.lang.Object
  org.linkedin.glu.agent.impl.script.ScriptManagerImpl

class ScriptManagerImpl

Manager for scripts

Authors:
ypujante@linkedin.com


Field Summary
static java.lang.String MODULE

static java.lang.Object log

 
Property Summary
java.util.Map _scripts

AgentContext agentContext

ScriptFactory rootScriptFactory

ScriptFactoryFactory scriptFactoryFactory

Timespan scriptGracePeriod1

Timespan scriptGracePeriod2

 
Method Summary
void addScriptNode(ScriptNode node)

void clearError(java.lang.Object mountPoint)

Clears the error of the script mounted at the provided mount point

FutureExecution executeAction(java.lang.Object args)

Executes the action on the software that was installed on the given mount point.

java.lang.Object executeCall(java.lang.Object args)

Executes the call on the software that was installed on the given mount point.

Logger findLog(java.lang.Object mountPoint)

@return the log for the given mountpoint

ScriptNode findScript(java.lang.Object mountPoint)

Returns the script mounted at the provided mount point (null if there is no such script)

java.lang.Object getFullState(java.lang.Object mountPoint)

java.lang.Object getMountPoints()

java.lang.Object getRootScript()

the root script

ScriptNode getScript(java.lang.Object mountPoint)

Returns the script mounted at the provided mount point.

java.util.Collection getScriptNodes()

java.lang.Object getState(java.lang.Object mountPoint)

{@inheridoc}

ScriptNode installRootScript(java.lang.Object actionArgs)

ScriptNode installScript(java.lang.Object args)

Install scripts.

boolean interruptAction(java.lang.Object args)

{@inheritDoc}

boolean isMounted(java.lang.Object mountPoint)

@return true if there is a script mounted at the given mount point

void removeScriptNode(MountPoint mountPoint)

void shutdown()

void uninstallScript(java.lang.Object mountPoint, boolean force)

Uninstall the script

java.lang.Object waitForAction(java.lang.Object args)

{@inheritDoc}

void waitForShutdown()

void waitForShutdown(java.lang.Object timeout)

boolean waitForState(java.lang.Object args)

Waits for the script to be in the state

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

MODULE

public static final java.lang.String MODULE


log

public static final java.lang.Object log


 
Property Detail

_scripts

final java.util.Map _scripts


agentContext

@Initializable(required = true)
AgentContext agentContext


rootScriptFactory

@Initializable(required = true)
ScriptFactory rootScriptFactory


scriptFactoryFactory

@Initializable
ScriptFactoryFactory scriptFactoryFactory


scriptGracePeriod1

Timespan scriptGracePeriod1


scriptGracePeriod2

Timespan scriptGracePeriod2


 
Method Detail

addScriptNode

void addScriptNode(ScriptNode node)


clearError

void clearError(java.lang.Object mountPoint)
Clears the error of the script mounted at the provided mount point


executeAction

FutureExecution executeAction(java.lang.Object args)
Executes the action on the software that was installed on the given mount point. Note that contrary to the similar action on the agent, this method is blocking.
Parameters:
args.mountPoint - same mount point provided during installScript(Object)
args.action - the lifecycle method you want to execute
args.actionArgs - the arguments to provide the action
Returns:
the value returned by the action


executeCall

java.lang.Object executeCall(java.lang.Object args)
Executes the call on the software that was installed on the given mount point. Note that this method is a blocking call and will wait for the result of the call.
Parameters:
args.mountPoint - same mount point provided during installScript(Object)
args.call - the call you want to execute
args.callArgs - the arguments to provide the call
Returns:
whatever value the call returns


findLog

Logger findLog(java.lang.Object mountPoint)
Returns:
the log for the given mountpoint


findScript

ScriptNode findScript(java.lang.Object mountPoint)
Returns the script mounted at the provided mount point (null if there is no such script)


getFullState

java.lang.Object getFullState(java.lang.Object mountPoint)


getMountPoints

java.lang.Object getMountPoints()


getRootScript

java.lang.Object getRootScript()
the root script


getScript

ScriptNode getScript(java.lang.Object mountPoint)
Returns the script mounted at the provided mount point. The difference with find it that it throws an exception.


getScriptNodes

java.util.Collection getScriptNodes()


getState

java.lang.Object getState(java.lang.Object mountPoint)
{@inheridoc}


installRootScript

ScriptNode installRootScript(java.lang.Object actionArgs)


installScript

ScriptNode installScript(java.lang.Object args)
Install scripts.
See Also:
Agent#installScript(Object)#installScript(Object)


interruptAction

boolean interruptAction(java.lang.Object args)
{@inheritDoc}


isMounted

boolean isMounted(java.lang.Object mountPoint)
Returns:
true if there is a script mounted at the given mount point


removeScriptNode

void removeScriptNode(MountPoint mountPoint)


shutdown

void shutdown()


uninstallScript

void uninstallScript(java.lang.Object mountPoint, boolean force)
Uninstall the script


waitForAction

java.lang.Object waitForAction(java.lang.Object args)
{@inheritDoc}


waitForShutdown

void waitForShutdown()


waitForShutdown

void waitForShutdown(java.lang.Object timeout)


waitForState

boolean waitForState(java.lang.Object args)
Waits for the script to be in the state
Parameters:
args.mountPoint - the mount point of the script you want to wait for
args.state - the desired state to wait for
args.timeout - if not null, the amount of time to wait maximum
Returns:
true if the state was reached within the timeout, false)


 

Groovy Documentation