public class AgentController extends Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
log
Log job agent events.
|
private int |
port |
private Properties |
properties |
private int |
timeout |
Constructor and Description |
---|
AgentController(Properties p)
Create a new controller for controlling the job agent specified by the
given properties.
|
Modifier and Type | Method and Description |
---|---|
private Agent |
createAgent(Properties p) |
JobAgentInfo |
getInfo()
Get info about running job agent by sending an info request to the agents remote control
service.
|
JobAgentInfo |
getStatus()
Get status info about running job agent by sending an info request to the agents r
emote control service.
|
static void |
main(String[] args) |
void |
pauseAgent()
Pause a running job agent by sending a stop request to the agents remote control
service.
|
private static void |
printHelp() |
private static void |
printUsage() |
void |
registerAgent() |
void |
startAgent()
Start the agent this controller is controlling.
|
void |
stopAgent()
Stop a running job agent by sending a stop request to the agents remote control
service.
|
void |
unregisterAgent() |
private static final org.slf4j.Logger log
private final Properties properties
private final int port
private final int timeout
public AgentController(Properties p)
p
- The properties for the job agent to controlpublic static void main(String[] args)
private static void printUsage()
private static void printHelp()
public void startAgent() throws IOException
IOException
- If there is an errorJobAgentConnection.sendStart()
public void stopAgent() throws IOException
IOException
- If there is an errorJobAgentConnection.sendStop()
public void pauseAgent() throws IOException
IOException
- If there is an errorJobAgentConnection.sendPause()
public JobAgentInfo getInfo() throws IOException
JobAgentInfo
objectIOException
- If there is an errorJobAgentConnection.getInfo(boolean)
public JobAgentInfo getStatus() throws IOException
JobAgentInfo
objectIOException
- If there is an errorJobAgentConnection.getInfo(boolean)
public void registerAgent()
public void unregisterAgent()
private Agent createAgent(Properties p)