|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.libs.Command
com.tivoli.twg.procman.ExecuteCommand
com.tivoli.twg.procman.api.ExecuteCommandAPI
This class encapulates for the SDK the ability to execute commands on agents.
Note: DOS based commands for NT/9X plaforms must include invokation of the appropriate command process. For example:
NT - cmd /c dir c:\
9X - command.com /c dir c:\
The command string passed in may have to include appropriate quotes if any paths in the command contain spaces (e.g. Program Files).
Field Summary |
---|
Constructor Summary | |
---|---|
ExecuteCommandAPI()
This is a constructor for the ExecuteCommand object. |
Method Summary | |
---|---|
boolean |
buildCommandLine()
Called after all data set. |
boolean |
deserialize(byte[] stream)
Take a serialized ExecuteCommand object and deserialize it and load data |
boolean |
getAsynch()
Indicates if ansync command execution set. |
boolean |
getCapture()
Indicates if output capture is set |
java.lang.String |
getCommandLine()
Get the command line string previoulsy provided |
java.lang.String |
getCWD()
Get the current working directory previously specified. |
int |
getExecRC()
Get the execution return code returned by the agent executing the command |
byte[] |
getOutput()
Return output in the form of a byte array. |
java.lang.String |
getPassword()
Get the password set in the command |
boolean |
getSynch()
Indicates if synchronous command execution set. |
long |
getTargetMOID()
Get the target MOID previously set. |
int |
getTimeout()
Get the timeout value set |
java.lang.String |
getUserId()
Get the user ID set in the command |
boolean |
isReady()
Indicates that the command has been built successfully and is ready to be sent to the agent |
byte[] |
serialize()
Serialize the data in this object for storage purposes. |
void |
setAsynch(boolean async)
Sets if command should be run asynch or synchronously. |
void |
setCapture(boolean capture)
Sets/unsets command output capture flags. |
void |
setCommandLine(java.lang.String cmdLine)
Specify the command line to be executed |
void |
setCWD(java.lang.String workingDir)
Set the working directory where the command will be executed |
boolean |
setDestinationFromMoid(long targetMoid)
Given a MOID, this method retrieves the destination address from the server. |
boolean |
setDestinationFromMoid(long targetMoid,
ServiceNode sn)
Give a MOID, the method retrieves the destination address from the server. |
void |
setPassword(java.lang.String password)
Set the password of the user ID previously set for execution of the command under a specific user. |
void |
setTimeout(int timeout)
Set the timeout period for command execution. |
void |
setUserId(java.lang.String ID)
Set the user ID the command will be executed under. |
Methods inherited from class com.tivoli.twg.procman.ExecuteCommand |
---|
addParameter, getEnvironment, isEnvironment, mapRCtoResource, setDestinationMoid, setEnvironment, setExecutable, setNoWindow, setParameters, setSynch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExecuteCommandAPI()
Method Detail |
public boolean setDestinationFromMoid(long targetMoid)
targetMoid
- MOID to retrieve destination address for
public boolean setDestinationFromMoid(long targetMoid, ServiceNode sn)
targetMoid
- MOID to retrieve destination address forsn
- service node to be used to retrieve data
public void setCommandLine(java.lang.String cmdLine)
cmdLine
- command line to be executedpublic void setTimeout(int timeout)
timeout
- timeout period in secondspublic int getTimeout()
public boolean buildCommandLine()
Command
public java.lang.String getCommandLine()
public boolean isReady()
public void setCapture(boolean capture)
capture
- true turns output capture on, false turns off output capturepublic boolean getCapture()
public void setAsynch(boolean async)
async
- true forces the command to execute asynchronouslypublic boolean getAsynch()
public boolean getSynch()
public void setUserId(java.lang.String ID)
ID
- user IDpublic java.lang.String getUserId()
public void setPassword(java.lang.String password)
password
- passwordpublic java.lang.String getPassword()
public int getExecRC()
public byte[] getOutput()
public void setCWD(java.lang.String workingDir)
workingDir
- directory where the command will be executedpublic java.lang.String getCWD()
public long getTargetMOID()
public byte[] serialize()
public boolean deserialize(byte[] stream)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |