com.sonyericsson.hudson.plugins.gerrit.gerritevents.workers.cmd
Class AbstractSendCommandJob

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.gerrit.gerritevents.workers.cmd.AbstractSendCommandJob
All Implemented Interfaces:
GerritCmdRunner, Runnable

public abstract class AbstractSendCommandJob
extends Object
implements Runnable, GerritCmdRunner

An abstract Job implementation to be scheduled on GerritSendCommandQueue.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Field Summary
protected static org.slf4j.Logger logger
          An instance of a logger for sub-classes to use.
 
Constructor Summary
protected AbstractSendCommandJob(GerritConnectionConfig config)
          Standard constructor taking the latest configuration.
 
Method Summary
 GerritConnectionConfig getConfig()
          Gets the connection config used when sending a command.
 boolean sendCommand(String command)
          Sends a command to the Gerrit server.
 String sendCommandStr(String command)
          Sends a command to the Gerrit server, returning the output from the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

logger

protected static org.slf4j.Logger logger
An instance of a logger for sub-classes to use.

Constructor Detail

AbstractSendCommandJob

protected AbstractSendCommandJob(GerritConnectionConfig config)
Standard constructor taking the latest configuration.

Parameters:
config - the connection config.
Method Detail

getConfig

public GerritConnectionConfig getConfig()
Gets the connection config used when sending a command.

Returns:
the config.

sendCommand

public boolean sendCommand(String command)
Sends a command to the Gerrit server.

Specified by:
sendCommand in interface GerritCmdRunner
Parameters:
command - the command.
Returns:
true if there were no exceptions when sending.

sendCommandStr

public String sendCommandStr(String command)
Sends a command to the Gerrit server, returning the output from the command.

Specified by:
sendCommandStr in interface GerritCmdRunner
Parameters:
command - the command.
Returns:
the output from the command.


Copyright © 2004-2012 Hudson. All Rights Reserved.