com.ibm.jtopenlite.command
Class CommandConnection

java.lang.Object
  extended by com.ibm.jtopenlite.HostServerConnection
      extended by com.ibm.jtopenlite.command.CommandConnection
All Implemented Interfaces:
Connection

public class CommandConnection
extends HostServerConnection

Represents a TCP/IP socket connection to the System i Remote Command host server (QSYSWRK/QZRCSRVS prestart jobs).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.jtopenlite.HostServerConnection
HostServerConnection.HostInputStream, HostServerConnection.HostOutputStream
 
Field Summary
static int DEFAULT_COMMAND_SERVER_PORT
          The default TCP/IP port the Remote Command host server listens on.
 
Fields inherited from class com.ibm.jtopenlite.HostServerConnection
in_, out_
 
Method Summary
 CommandResult call(Program pgm)
          Calls the specified program and returns the result.
 CommandResult call(String pgmLibrary, String pgmName, Parameter[] parms)
          Calls the specified program using the specified parameter data and returns the result.
 CommandResult execute(String cmd)
          Executes the specified CL command string and returns the result.
static CommandConnection getConnection(String system, String user, String password)
          Connects to the Remote Command host server on the default port after first connecting to the Signon host server and authenticating the specified user.
static CommandConnection getConnection(SystemInfo info, String user, String password)
          Connects to the Remote Command host server on the default port using the specified system information and user.
static CommandConnection getConnection(SystemInfo info, String user, String password, int commandPort, boolean compress)
          Connects to the Remote Command host server on the specified port using the specified system information and user.
protected  void sendEndJobRequest()
           
 
Methods inherited from class com.ibm.jtopenlite.HostServerConnection
close, connect, finalize, getEncryptedPassword, getInfo, getJobName, getUser, isClosed, isDatastreamDebug, isDefaultDatastreamDebug, setDatastreamDebug, writePadEBCDIC, writePadEBCDIC10, writeStringToUnicodeBytes
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COMMAND_SERVER_PORT

public static final int DEFAULT_COMMAND_SERVER_PORT
The default TCP/IP port the Remote Command host server listens on. If your system has been configured to use a different port, use the PortMapper class to determine the port.

See Also:
Constant Field Values
Method Detail

sendEndJobRequest

protected void sendEndJobRequest()
                          throws IOException
Specified by:
sendEndJobRequest in class HostServerConnection
Throws:
IOException

getConnection

public static CommandConnection getConnection(String system,
                                              String user,
                                              String password)
                                       throws IOException
Connects to the Remote Command host server on the default port after first connecting to the Signon host server and authenticating the specified user.

Throws:
IOException

getConnection

public static CommandConnection getConnection(SystemInfo info,
                                              String user,
                                              String password)
                                       throws IOException
Connects to the Remote Command host server on the default port using the specified system information and user.

Throws:
IOException

getConnection

public static CommandConnection getConnection(SystemInfo info,
                                              String user,
                                              String password,
                                              int commandPort,
                                              boolean compress)
                                       throws IOException
Connects to the Remote Command host server on the specified port using the specified system information and user.

Throws:
IOException

call

public CommandResult call(String pgmLibrary,
                          String pgmName,
                          Parameter[] parms)
                   throws IOException
Calls the specified program using the specified parameter data and returns the result.

Throws:
IOException

call

public CommandResult call(Program pgm)
                   throws IOException
Calls the specified program and returns the result.

Throws:
IOException

execute

public CommandResult execute(String cmd)
                      throws IOException
Executes the specified CL command string and returns the result. The command must be non-interactive.

Throws:
IOException