com.ibm.di.fc
Class zOSTSOCommandLine

java.lang.Object
  extended by com.ibm.di.fc.Function
      extended by com.ibm.di.fc.zOSTSOCommandLine
All Implemented Interfaces:
FunctionInterface, VersionInfoInterface

public class zOSTSOCommandLine
extends Function

The zOSTSOCommandLine Function Component executes specified commands in zOS TSO command line. It uses APPC protocol to communicate with the zOS environment.

In order for the zOS TSO Command Line Function Component to successfully connect and execute commands the APPC should be started and running on the zOS machine. Also this function component can execute commands only on the same machine on which the IBM Tivoli Directory Integrator is running.

The connection to the MVS is maintained by four native methods implemented on the program language 'C' which on the other hand use REXX script to execute commands on behalf of the IBM Tivoli Directory Integrator.


Field Summary
static String ENTRY_ATTR_APPC_RETCODE
          Attribute name: "appcReturnCode"
static String ENTRY_ATTR_CMD
          Attribute name: "command"
static String ENTRY_ATTR_COMMAND_OUTPUT
          Attribute name: "commandOutput"
static String ENTRY_ATTR_TSO_CMD_RETCODE
          Attribute name: "tsoCommandReturnCode"
static boolean isLibLoaded
          Flag for loaded library.
static String LIB_NAME
          Parameter Name: "tdiappc"
 int mATBOK
          Value of the returned code for 'OK'
static String MSG_NO_RESPONSE
          Message indicating that no response was received
static int[] PARAMS_LEN
          Allowed length of parameter
static String PARM_DEST_LU_NAME
          Parameter Name: "destLuName"
static int PARM_DEST_LU_NAME_ID
          ID of the parameter: 1
static String PARM_MODE_NAME
          Parameter Name: "modeName"
static int PARM_MODE_NAME_ID
          ID of the parameter: 3
static String PARM_PARTNERTP
          Parameter Name: "partnerTP"
static int PARM_PARTNERTP_ID
          ID of the parameter: 0
static String PARM_SRC_LU_NAME
          Parameter Name: "srcLuName"
static int PARM_SRC_LU_NAME_ID
          ID of the parameter: 2
static String PARM_USER_ID
          Parameter Name: "userID"
static int PARM_USER_ID_ID
          ID of the parameter: 4
static String PARM_USER_PSW
          Parameter Name: "userPSW"
static int PARM_USER_PSW_ID
          ID of the parameter: 5
 
Fields inherited from class com.ibm.di.fc.Function
logger
 
Constructor Summary
zOSTSOCommandLine()
           
 
Method Summary
 void debug(String msg)
          Writes a message to the log if debug/detailed logging is turned on
protected  String executeTSO(String aTsoCmd)
          Executes the TSO command passed as parameter.
 String getVersion()
          Version information.
 void initAndPrepareForConversation()
          Initializes and prepares the FC.
 void initialize(Object aParam)
          Initializes the function component.
static void loadLibrary()
          Loads IBM Tivoli Directory Integrator library for APPC.
 void logmsg(String msg)
          Logs a message to the currently used log
 Object perform(Object aInObject)
          Executes command on zOS TSO command line.
protected  void readZOSParam(String aParamName, int aParamId, boolean aRequired, boolean aToLog, boolean aToUpperCase)
          Retrieves zOS parameter.
 void terminate()
          Terminates the function component.
 
Methods inherited from class com.ibm.di.fc.Function
getConfiguration, getContext, getDebug, getLog, getParam, getRSInterface, getUI, initialize, querySchema, setConfiguration, setContext, setDebug, setLog, setParam, setRSInterface, updateSchema, verifyInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIB_NAME

public static final String LIB_NAME
Parameter Name: "tdiappc"

See Also:
Constant Field Values

PARM_PARTNERTP

public static final String PARM_PARTNERTP
Parameter Name: "partnerTP"

See Also:
Constant Field Values

PARM_DEST_LU_NAME

public static final String PARM_DEST_LU_NAME
Parameter Name: "destLuName"

See Also:
Constant Field Values

PARM_SRC_LU_NAME

public static final String PARM_SRC_LU_NAME
Parameter Name: "srcLuName"

See Also:
Constant Field Values

PARM_MODE_NAME

public static final String PARM_MODE_NAME
Parameter Name: "modeName"

See Also:
Constant Field Values

PARM_USER_ID

public static final String PARM_USER_ID
Parameter Name: "userID"

See Also:
Constant Field Values

PARM_USER_PSW

public static final String PARM_USER_PSW
Parameter Name: "userPSW"

See Also:
Constant Field Values

PARM_PARTNERTP_ID

public static final int PARM_PARTNERTP_ID
ID of the parameter: 0

See Also:
Constant Field Values

PARM_DEST_LU_NAME_ID

public static final int PARM_DEST_LU_NAME_ID
ID of the parameter: 1

See Also:
Constant Field Values

PARM_SRC_LU_NAME_ID

public static final int PARM_SRC_LU_NAME_ID
ID of the parameter: 2

See Also:
Constant Field Values

PARM_MODE_NAME_ID

public static final int PARM_MODE_NAME_ID
ID of the parameter: 3

See Also:
Constant Field Values

PARM_USER_ID_ID

public static final int PARM_USER_ID_ID
ID of the parameter: 4

See Also:
Constant Field Values

PARM_USER_PSW_ID

public static final int PARM_USER_PSW_ID
ID of the parameter: 5

See Also:
Constant Field Values

PARAMS_LEN

public static final int[] PARAMS_LEN
Allowed length of parameter


ENTRY_ATTR_CMD

public static final String ENTRY_ATTR_CMD
Attribute name: "command"

See Also:
Constant Field Values

ENTRY_ATTR_COMMAND_OUTPUT

public static final String ENTRY_ATTR_COMMAND_OUTPUT
Attribute name: "commandOutput"

See Also:
Constant Field Values

ENTRY_ATTR_APPC_RETCODE

public static final String ENTRY_ATTR_APPC_RETCODE
Attribute name: "appcReturnCode"

See Also:
Constant Field Values

ENTRY_ATTR_TSO_CMD_RETCODE

public static final String ENTRY_ATTR_TSO_CMD_RETCODE
Attribute name: "tsoCommandReturnCode"

See Also:
Constant Field Values

MSG_NO_RESPONSE

public static final String MSG_NO_RESPONSE
Message indicating that no response was received

See Also:
Constant Field Values

isLibLoaded

public static boolean isLibLoaded
Flag for loaded library. Default false.


mATBOK

public int mATBOK
Value of the returned code for 'OK'

Constructor Detail

zOSTSOCommandLine

public zOSTSOCommandLine()
Method Detail

initialize

public void initialize(Object aParam)
                throws Exception
Initializes the function component.

Specified by:
initialize in interface FunctionInterface
Overrides:
initialize in class Function
Parameters:
aParam - Object to initialize; not used
Throws:
Exception

readZOSParam

protected void readZOSParam(String aParamName,
                            int aParamId,
                            boolean aRequired,
                            boolean aToLog,
                            boolean aToUpperCase)
                     throws Exception
Retrieves zOS parameter.

Parameters:
aParamName - parameter name
aParamId - parameter ID
aRequired - true indicates required parameter
aToLog - if true to log to the console if debug/detailed logging is turned on
aToUpperCase - true if we want to uppercase parameter value; false otherwise.
Throws:
Exception -
  • if invalid parameter value is encountered
  • if required parameter value is null

  • initAndPrepareForConversation

    public void initAndPrepareForConversation()
                                       throws Exception
    Initializes and prepares the FC.

    Throws:
    Exception - if an error occurs.

    loadLibrary

    public static void loadLibrary()
    Loads IBM Tivoli Directory Integrator library for APPC.


    perform

    public Object perform(Object aInObject)
                   throws Exception
    Executes command on zOS TSO command line.

    Parameters:
    aInObject - initial entry to proceed
    Returns:
    Entry object containing command to execute
    Throws:
    Exception -
  • if invalid parameter is passed
  • or invalid TSO code returned

  • executeTSO

    protected String executeTSO(String aTsoCmd)
                         throws Exception
    Executes the TSO command passed as parameter.

    Parameters:
    aTsoCmd - The TSO command to be executed.
    Returns:
    The result of the z/OS TSO command.
    Throws:
    Exception

    terminate

    public void terminate()
                   throws Exception
    Terminates the function component.

    Specified by:
    terminate in interface FunctionInterface
    Overrides:
    terminate in class Function
    Throws:
    Exception

    logmsg

    public void logmsg(String msg)
    Logs a message to the currently used log

    Specified by:
    logmsg in interface FunctionInterface
    Overrides:
    logmsg in class Function
    Parameters:
    msg - The message appearing in the log

    debug

    public void debug(String msg)
    Writes a message to the log if debug/detailed logging is turned on

    Specified by:
    debug in interface FunctionInterface
    Overrides:
    debug in class Function
    Parameters:
    msg - The message

    getVersion

    public String getVersion()
    Version information.

    Returns:
    version information