public class ShellUtility extends Utility
EAC_MAX_TOKEN_LENGTH, ENDECA_CONF, IS_WINDOWS, WINDOWS_MAX_PATH_LENGTH
appName, dataPrefix, eacHost, eacPort, elementId, lockManager, logDir, sslEnabled, workingDir
Constructor and Description |
---|
ShellUtility() |
ShellUtility(String appName,
String eacHost,
int eacPort,
boolean sslEnabled)
Default (inherited) constructor.
|
Modifier and Type | Method and Description |
---|---|
com.endeca.eac.client.RunUtilityType |
buildEacStub()
Builds a RunUtilityType object to send to the EAC.
|
boolean |
conditionalRun()
Runs the shell utility synchronously, returning true if the invocation completes
with no error condition and false if the shell call results in an error condition.
|
String |
getCommand() |
String |
getHostId() |
void |
init(String token,
String host,
String command,
String workingDir)
Shell initializer.
|
protected void |
initializeEacStub(com.endeca.eac.client.RunShellType stub) |
protected int |
maximumAllowedTokenLength() |
void |
setCommand(String command) |
void |
setHostId(String hostId) |
getDirContents, getMaxMissedStatusChecksAllowed, getMaxWaitTimeSeconds, getMinWaitTimeSeconds, getNonNullPositiveLongValueOrDefault, getNumMissedStatusChecks, getSlowPollingIntervalMs, getStandardPollingIntervalMs, getStatus, incrementMissedStatusQueries, initializeEacStub, isActive, isFailed, run, runInParallel, setElementId, setMaxMissedStatusQueriesAllowed, setMaxWaitSeconds, setMinWaitSeconds, setNumMissedStatusChecks, setPollingIntervalMs, setSlowPollingIntervalMs, start, stop, waitForFinished
getAppName, getDataPrefix, getEacHost, getEacPort, getElementId, getLockManager, getLogDir, getWorkingDir, isSslEnabled, setAppName, setDataPrefix, setEacHost, setEacPort, setLockManager, setLogDir, setSslEnabled, setWorkingDir
public ShellUtility(String appName, String eacHost, int eacPort, boolean sslEnabled) throws AppConfigurationException
AppConfigurationException
- If the application name or EAC host is null.public ShellUtility()
public void init(String token, String host, String command, String workingDir)
token
- ID of the shell utility.host
- ID of the host on which to execute the command.command
- Command string to execute.workingDir
- Working directory from which to execute the command.public boolean conditionalRun() throws EacCommunicationException, InterruptedException
EacCommunicationException
- If a communication error occurs while
requesting the status of the utility from the EAC.EacComponentControlException
- If an error occurs while trying to
start the utility.InterruptedException
- If the thread is interrupted while waiting for the
utility to finish.public com.endeca.eac.client.RunUtilityType buildEacStub()
Utility
buildEacStub
in class Utility
protected void initializeEacStub(com.endeca.eac.client.RunShellType stub)
public String getCommand()
public void setCommand(String command)
public String getHostId()
public void setHostId(String hostId)
protected int maximumAllowedTokenLength()
maximumAllowedTokenLength
in class Utility
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.