Groovy Documentation

org.linkedin.glu.agent.impl.script
[Groovy] Interface ScriptManager

org.linkedin.util.lifecycle.Shutdownable
  org.linkedin.glu.agent.impl.script.ScriptManager
All Superinterfaces:
Shutdownable

interface ScriptManager
extends Shutdownable

Manager for scripts

Authors:
ypujante@linkedin.com


Method Summary
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 (or null if no such mountpoint)

ScriptNode findScript(java.lang.Object mountPoint)

@return a script previously installed (or null if not found)

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

@return the full state of the mountpoint ([scriptDefinition: [...], scriptState: [...]]

java.lang.Object getMountPoints()

@return a list of all mount points currently mounted

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

@return the state of the script (currentState/transitionState/error)

ScriptNode installRootScript(java.lang.Object actionArgs)

Installs the root script

ScriptNode installScript(java.lang.Object args)

Install scripts.

boolean interruptAction(java.lang.Object args)

@param args.mountPoint same mount point provided during installScript(Object)

boolean isMounted(java.lang.Object mountPoint)

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

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

Uninstall the script

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

Waits for the action (previously scheduled in executeAction(Object)) to complete no longer than the timeout provided.

boolean waitForState(java.lang.Object args)

Waits for the script to be in the state

 

Method Detail

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 (or null if no such mountpoint)


findScript

ScriptNode findScript(java.lang.Object mountPoint)
Returns:
a script previously installed (or null if not found)


getFullState

java.lang.Object getFullState(java.lang.Object mountPoint)
Returns:
the full state of the mountpoint ([scriptDefinition: [...], scriptState: [...]]


getMountPoints

java.lang.Object getMountPoints()
Returns:
a list of all mount points currently mounted


getState

java.lang.Object getState(java.lang.Object mountPoint)
Returns:
the state of the script (currentState/transitionState/error)


installRootScript

ScriptNode installRootScript(java.lang.Object actionArgs)
Installs the root script
actionArgs:
arguments for the install action


installScript

ScriptNode installScript(java.lang.Object args)
Install scripts.
See Also:
org.linkedin.glu.agent.api.Agent#installScript(Object)


interruptAction

boolean interruptAction(java.lang.Object args)
Parameters:
args.mountPoint - same mount point provided during installScript(Object)
args.action - the name of the action to interrupt
args.actionId - the id of the action to interrupt (only one of each)
Returns:
false if the task could not be cancelled, typically because it has already completed normally; true otherwise


isMounted

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


uninstallScript

void uninstallScript(java.lang.Object mountPoint, boolean force)
Uninstall the script
Parameters:
force - force uninstall regardless of the state of the script


waitForAction

java.lang.Object waitForAction(java.lang.Object args)
Waits for the action (previously scheduled in executeAction(Object)) to complete no longer than the timeout provided. Note that due to the nature of the call it is possible that this method throws a NoSuchActionException in some cases:
throws:
org.linkedin.glu.agent.api.NoSuchActionException if the action cannot be found
throws:
TimeoutException if the action cannot be completed in the given amount of time
Parameters:
args.mountPoint - the mount point of the script you want to wait for
args.actionId - the id of the action to wait for
args.timeout - if not null, the amount of time to wait maximum
Returns:
the value of the execution


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