All Packages Class Hierarchy This Package Previous Next Index
Class asjava.uniobjects.UniCommand
java.lang.Object
|
+----asjava.uniobjects.UniBase
|
+----asjava.uniobjects.UniCommand
- public class UniCommand
- extends UniBase
UniCommand
is used to control remote command execution. With it users
can run UniVerse commands or stored procedures on the server.
- Version:
- Version 1.0
- Author:
- David T. Meeks
-
cancel()
- cancels all outstanding output from the executing command.
-
exec()
- executes the command that was set up using the
setCommand
method.
-
getAtSelected()
- returns the value of the
-
getBlockSize()
-
returns the current block size, in bytes, that is in use for server communications.
-
getCommand()
- returns the current execution string that was set with the
setCommand
method.
-
getSystemReturnCode()
- returns the current value of
-
nextBlock()
- returns the next block of data from the command response, if the command response
size was greater than the block size established with
setBlockSize
After each call to nextBlock
, the response
method can be
called to retrieve the new block of data, and the status
method can be called to determine the state of execution
-
reply(String)
- replies to a command execution that it currently in the
UniS_REPLY
state.
-
response()
- returns the output from the command
exec
and reply
methods
-
setBlockSize(int)
- Sets the current block size to the value passed in
-
setCommand(String)
- establishes the command string or stored procedure to be run on the server
-
status()
- returns the current execution status
cancel
public void cancel() throws UniCommandException
- cancels all outstanding output from the executing command. It can only be called when
the command status, as returned by
status
is either
UVS_REPLY
or UVS_MORE
. Upon completion, the command
status will be set to UVS_COMPLETE
, allowing another command to be
executed
- Throws: UniCommandException
- is thrown upon failure conditions
- See Also:
- status, exec
exec
public void exec() throws UniCommandException
- executes the command that was set up using the
setCommand
method. The
results f the execution can be obtained using the response
method. The
status
method can be used to get the current state of the
command.
- Throws: UniCommandException
- is thrown with error conditions
- See Also:
- setCommand, status, response
getAtSelected
public int getAtSelected()
- returns the value of the @SELECTED variable from the server when the command
has successfully completed
- Returns:
- integer representing the value of the @SELECTED variable
- See Also:
- exec
getBlockSize
public int getBlockSize()
- returns the current block size, in bytes, that is in use for server communications.
By default, a value of 0 is set, which denotes that all data should be returned.
- Returns:
- integer representing the current block size, in bytes.
- See Also:
- setBlockSize
getCommand
public String getCommand()
- returns the current execution string that was set with the
setCommand
method.
- Returns:
- String representing the command to be executed
- See Also:
- setCommand
status
public int status()
- returns the current execution status
- Returns:
- integer representing the current Command Status. Valid values are:
- UVS_COMPLETE (0) - command has finished execution and is awaiting next command
- UVS_REPLY (1) - server is waiting for input data. The reply can be sent
using the
reply
method.
- UVS_MORE (2) - denotes that there is more data waiting to be retrieved. Will
only occur if the BlockSize is set to a non-zero value from
setBlockSize
. The response
method
will return a response block of BlockSize bytes each time it
is called until no more data remains, at which point, the
status will be changed to UniS_COMPLETE Overrides:
- status in class UniBase
- See Also:
- reply, setBlockSize, getBlockSize, nextBlock
getSystemReturnCode
public int getSystemReturnCode()
- returns the current value of @SYSTEM.RETURN.CODE from the server
- Returns:
- integer representing the current state of the @SYSTEM.RETURN.CODE
nextBlock
public void nextBlock() throws UniCommandException
- returns the next block of data from the command response, if the command response
size was greater than the block size established with
setBlockSize
After each call to nextBlock
, the response
method can be
called to retrieve the new block of data, and the status
method can be called to determine the state of execution
- Throws: UniCommandException
- is thrown if an error occurs
- See Also:
- setBlockSize, nextBlock, response, status
reply
public void reply(String aReplyString) throws UniCommandException
- replies to a command execution that it currently in the
UniS_REPLY
state. Often, a server side command may require user input. Use this method
to send the input requested.
- Parameters:
- aReplyString - reply string to be sent to the server
- Throws: UniCommandException
- is thrown if an error occurs
- See Also:
- status
response
public String response()
- returns the output from the command
exec
and reply
methods
- Returns:
- String output from the
exec
or reply
methods
- See Also:
- exec, reply
setBlockSize
public void setBlockSize(int aBlockSize)
- Sets the current block size to the value passed in
- Parameters:
- aBlockSize - integer representing the new block size, in bytes. This is the
amount of data retrieved with each
response
method.
- See Also:
- getBlockSize, response
setCommand
public void setCommand(String aCommand)
- establishes the command string or stored procedure to be run on the server
- Parameters:
- aCommand - command string to be executed on the server
- See Also:
- getCommand, exec
All Packages Class Hierarchy This Package Previous Next Index