Brooklyn

brooklyn.event.adapter
[Groovy] Class SshShellSensorAdapter

java.lang.Object
  brooklyn.event.adapter.AbstractSensorAdapter
      brooklyn.event.adapter.FunctionSensorAdapter
          brooklyn.event.adapter.ShellSensorAdapter
              brooklyn.event.adapter.SshShellSensorAdapter

class SshShellSensorAdapter
extends ShellSensorAdapter

Like ShellSensorAdapter but executes the shell command remotely. Useful for entities that only allow interaction via command line tools, such as Rabbit MQ or Redis.

Example usage: def status = sensorRegistry.register(new SshShellSensorAdapter(driver, "rabbitmqctl -q status")) status.poll(SERVICE_UP) { it =~ /running_applications.*RabbitMQ/ }

Note that the ScriptRunner pssed to the adapter need not execute the shell commands over ssh, for example when running entities locally.

See Also:
FunctionSensorAdapter
SshSensorAdapter


Field Summary
protected ScriptRunner driver

static Logger log

 
Fields inherited from class ShellSensorAdapter
command, log
 
Fields inherited from class FunctionSensorAdapter
CALL_TIMEOUT_MS, callable, poller
 
Constructor Summary
SshShellSensorAdapter(java.util.Map flags = [:], ScriptRunner driver, java.lang.String command)

 
Method Summary
java.lang.String[] exec(java.lang.String command)

 
Methods inherited from class ShellSensorAdapter
call, exec, process
 
Methods inherited from class FunctionSensorAdapter
call, poll, then, then
 
Methods inherited from class AbstractSensorAdapter
activateAdapter, addActivationLifecycleListeners, deactivateAdapter, isConnected, register
 

Field Detail

driver

protected final ScriptRunner driver


log

public static final Logger log


 
Constructor Detail

SshShellSensorAdapter

SshShellSensorAdapter(java.util.Map flags = [:], ScriptRunner driver, java.lang.String command)


 
Method Detail

exec

java.lang.String[] exec(java.lang.String command)


 

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