planetj.common
Class AS400Manager

java.lang.Object
  |
  +--planetj.common.AS400Manager

public class AS400Manager
extends Object

An AS400Manager is responsible for running and managing AS400 resources. This includes functions such as running a cl command or calling a program.


Field Summary
static String AS400_OS_NAME
           
static String OS_NAME
           
 
Constructor Summary
AS400Manager()
           
 
Method Summary
 void createAS400ConnectionPool(ConnectionRow pConRow)
          Create a pool of AS400 objects.
 boolean doesObjectExist(String objectName, String objectLibrary, String objectType)
           
 void freeAS400Connection(com.ibm.as400.access.AS400 pAS400, ConnectionRow pConRow)
           
 void freeAS400Connection(com.ibm.as400.access.AS400 pAS400, String pAlias)
           
 boolean ftp(com.ibm.as400.access.AS400 pAS400System, String pSaveFile, String pAS400Location)
          This method will FTP a file to the AS400 specified in system.
 boolean ftp(String pSaveFile, String pAS400Location)
          This method will FTP a file to the AS400 specified in system.
 boolean ftp(String system, String userid, String password, String pSaveFile, String pAS400Location)
          This method will FTP a file to the AS400 specified in system.
 com.ibm.as400.access.AS400 getAS400Connection(ConnectionRow pConRow)
          Get an AS400 object from a pool of AS400 objects.
 com.ibm.as400.access.AS400 getAS400Connection(String pAlias)
          Return an AS400 object for this specified connection alias
 com.ibm.as400.access.AS400 getCurrentSystem()
           
 ILogger getLogger()
          Gets the logger to use when logging messages
 String getSystemAlias()
          Insert the method's description here.
 boolean isAS400ConnectionPoolRunning(ConnectionRow pConRow)
          Create a pool of AS400 objects.
static boolean isRunningOnAS400()
          Returns true if the the current Operating System is OS/400 Creation date: (4/19/2002 4:04:03 PM)
 boolean runAS400Command(String cmdString)
           
 IAS400ProgramCall runAS400Program(IAS400ProgramCall pgmCall)
           
 void runJDBCCLCommand(String command)
          Deprecated. This method no longer works
 com.ibm.as400.access.AS400 setCurrentSystem(com.ibm.as400.access.AS400 as400)
          setCurrentSystem sets the AS400 Object that will be used for Command calls
 void setLogger(ILogger newLogger)
          Sets the logger to use when logging messages
static void setSingleton(AS400Manager manager)
           
 void setSystemAlias(String newSystemAlias)
          Insert the method's description here.
 boolean signOn(String userId, String password, String systemName)
          Signon the AS400 and create an AS400 object.
 boolean signOn(String userID, String password, String systemName, String systemAlias)
          Signon the AS400 and create an AS400 object.
static AS400Manager singleton()
           
 void stopAS400ConnectionPool(ConnectionRow pConRow)
          Stop an AS400 object connection pool.
 boolean validateSignon(String system, String userid, String password)
          Returns true if the provided system, userid and password are valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OS_NAME

public static final String OS_NAME
See Also:
Constant Field Values

AS400_OS_NAME

public static final String AS400_OS_NAME
See Also:
Constant Field Values
Constructor Detail

AS400Manager

public AS400Manager()
Method Detail

stopAS400ConnectionPool

public void stopAS400ConnectionPool(ConnectionRow pConRow)
                             throws CMException
Stop an AS400 object connection pool.

Refer the the AS400 Toolbox for Java for details.

Creation date: (3/10/04 4:36:36 PM)

CMException

createAS400ConnectionPool

public void createAS400ConnectionPool(ConnectionRow pConRow)
                               throws CMException
Create a pool of AS400 objects. These can be used to run commands and program calls.

Refer the the AS400 Toolbox for Java for details.

Creation date: (3/10/04 4:36:36 PM)

CMException

freeAS400Connection

public void freeAS400Connection(com.ibm.as400.access.AS400 pAS400,
                                String pAlias)
                         throws CMException
CMException

freeAS400Connection

public void freeAS400Connection(com.ibm.as400.access.AS400 pAS400,
                                ConnectionRow pConRow)
                         throws CMException
CMException

doesObjectExist

public boolean doesObjectExist(String objectName,
                               String objectLibrary,
                               String objectType)
                        throws CMException
CMException

ftp

public boolean ftp(com.ibm.as400.access.AS400 pAS400System,
                   String pSaveFile,
                   String pAS400Location)
            throws CMException
This method will FTP a file to the AS400 specified in system.

The following example puts a save file to the AS/400. Note the application does not set data transfer type to binary or use Toolbox CommandCall to create the save file. Since the extension is .savf, AS400FTP class detects the file to put is a save file so it does these step automatically. AS400 system = new AS400(); AS400FTP ftp = new AS400FTP(system); ftp.put("myData.savf", "/QSYS.LIB/MYLIB.LIB/MYDATA.SAVF"); or ftp.put("D:\\Temp\\planetj50.savf","/QSYS.LIB/PJMIKET.LIB/TYTEST.SAVF");

Creation date: (7/10/03 4:36:36 PM)

CMException

ftp

public boolean ftp(String pSaveFile,
                   String pAS400Location)
            throws CMException
This method will FTP a file to the AS400 specified in system.

The following example puts a save file to the AS/400. Note the application does not set data transfer type to binary or use Toolbox CommandCall to create the save file. Since the extension is .savf, AS400FTP class detects the file to put is a save file so it does these step automatically. AS400 system = new AS400(); AS400FTP ftp = new AS400FTP(system); ftp.put("myData.savf", "/QSYS.LIB/MYLIB.LIB/MYDATA.SAVF"); or ftp.put("D:\\Temp\\planetj50.savf","/QSYS.LIB/PJMIKET.LIB/TYTEST.SAVF");

Creation date: (7/10/03 4:36:36 PM)

CMException

ftp

public boolean ftp(String system,
                   String userid,
                   String password,
                   String pSaveFile,
                   String pAS400Location)
            throws CMException
This method will FTP a file to the AS400 specified in system.

The following example puts a save file to the AS/400. Note the application does not set data transfer type to binary or use Toolbox CommandCall to create the save file. Since the extension is .savf, AS400FTP class detects the file to put is a save file so it does these step automatically. AS400 system = new AS400(); AS400FTP ftp = new AS400FTP(system); ftp.put("myData.savf", "/QSYS.LIB/MYLIB.LIB/MYDATA.SAVF"); or ftp.put("D:\\Temp\\planetj50.savf","/QSYS.LIB/PJMIKET.LIB/TYTEST.SAVF");

Creation date: (7/10/03 4:36:36 PM)

CMException

getAS400Connection

public com.ibm.as400.access.AS400 getAS400Connection(String pAlias)
                                              throws CMException
Return an AS400 object for this specified connection alias

Returns:
AS400
CMException

getAS400Connection

public com.ibm.as400.access.AS400 getAS400Connection(ConnectionRow pConRow)
                                              throws CMException
Get an AS400 object from a pool of AS400 objects. These AS400 objects can be used to run commands and program calls.

Refer the the AS400 Toolbox for Java for details.

Creation date: (3/10/04 4:36:36 PM)

CMException

getCurrentSystem

public com.ibm.as400.access.AS400 getCurrentSystem()

getLogger

public ILogger getLogger()
Gets the logger to use when logging messages


getSystemAlias

public String getSystemAlias()
Insert the method's description here. Creation date: (2/15/02 12:02:36 PM)

Returns:
java.lang.String

isAS400ConnectionPoolRunning

public boolean isAS400ConnectionPoolRunning(ConnectionRow pConRow)
                                     throws CMException
Create a pool of AS400 objects. These can be used to run commands and program calls.

Refer the the AS400 Toolbox for Java for details.

Creation date: (3/10/04 4:36:36 PM)

CMException

isRunningOnAS400

public static boolean isRunningOnAS400()
Returns true if the the current Operating System is OS/400 Creation date: (4/19/2002 4:04:03 PM)

Returns:
boolean

runAS400Command

public boolean runAS400Command(String cmdString)

runAS400Program

public IAS400ProgramCall runAS400Program(IAS400ProgramCall pgmCall)

runJDBCCLCommand

public void runJDBCCLCommand(String command)
                      throws CMException,
                             SQLException
Deprecated. This method no longer works

Runs a CL command via JDBC connection which allows

Parameters:
command - java.lang.String
CMException
SQLException

setCurrentSystem

public com.ibm.as400.access.AS400 setCurrentSystem(com.ibm.as400.access.AS400 as400)
setCurrentSystem sets the AS400 Object that will be used for Command calls

Parameters:
as400 - com.ibm.as400.access.AS400

setLogger

public void setLogger(ILogger newLogger)
Sets the logger to use when logging messages


setSingleton

public static void setSingleton(AS400Manager manager)

setSystemAlias

public void setSystemAlias(String newSystemAlias)
Insert the method's description here. Creation date: (2/15/02 12:02:36 PM)

Parameters:
newSystemAlias - java.lang.String

signOn

public boolean signOn(String userId,
                      String password,
                      String systemName)
Signon the AS400 and create an AS400 object. Author: Paul Holm Verison: .9

Parameters:
userId - java.lang.String
password - java.lang.String

signOn

public boolean signOn(String userID,
                      String password,
                      String systemName,
                      String systemAlias)
Signon the AS400 and create an AS400 object. Author: Paul Holm

Returns:
true for success, false for failure

singleton

public static AS400Manager singleton()

validateSignon

public boolean validateSignon(String system,
                              String userid,
                              String password)
                       throws CMException
Returns true if the provided system, userid and password are valid. An exception is thrown if errors occur. Creation date: (10/16/2001 8:05:28 AM)

Parameters:
system - java.lang.String
userid - java.lang.String
password - java.lang.String
Returns:
boolean
Throws:
CMException