Package com.ibm.di.fc
Class zOSTSOCommandLine
- java.lang.Object
-
- com.ibm.di.fc.Function
-
- 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
Fields Modifier and Type Field Description static java.lang.StringENTRY_ATTR_APPC_RETCODEAttribute name: "appcReturnCode"static java.lang.StringENTRY_ATTR_CMDAttribute name: "command"static java.lang.StringENTRY_ATTR_COMMAND_OUTPUTAttribute name: "commandOutput"static java.lang.StringENTRY_ATTR_TSO_CMD_RETCODEAttribute name: "tsoCommandReturnCode"static booleanisLibLoadedFlag for loaded library.static java.lang.StringLIB_NAMEParameter Name: "tdiappc"intmATBOKValue of the returned code for 'OK'static java.lang.StringMSG_NO_RESPONSEMessage indicating that no response was receivedstatic int[]PARAMS_LENAllowed length of parameterstatic java.lang.StringPARM_DEST_LU_NAMEParameter Name: "destLuName"static intPARM_DEST_LU_NAME_IDID of the parameter: 1static java.lang.StringPARM_MODE_NAMEParameter Name: "modeName"static intPARM_MODE_NAME_IDID of the parameter: 3static java.lang.StringPARM_PARTNERTPParameter Name: "partnerTP"static intPARM_PARTNERTP_IDID of the parameter: 0static java.lang.StringPARM_SRC_LU_NAMEParameter Name: "srcLuName"static intPARM_SRC_LU_NAME_IDID of the parameter: 2static java.lang.StringPARM_USER_IDParameter Name: "userID"static intPARM_USER_ID_IDID of the parameter: 4static java.lang.StringPARM_USER_PSWParameter Name: "userPSW"static intPARM_USER_PSW_IDID of the parameter: 5
-
Constructor Summary
Constructors Constructor Description zOSTSOCommandLine()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebug(java.lang.String msg)Writes a message to the log if debug/detailed logging is turned onprotected java.lang.StringexecuteTSO(java.lang.String aTsoCmd)Executes the TSO command passed as parameter.java.lang.StringgetVersion()Version information.voidinitAndPrepareForConversation()Initializes and prepares the FC.voidinitialize(java.lang.Object aParam)Initializes the function component.static voidloadLibrary()Loads IBM Tivoli Directory Integrator library for APPC.voidlogmsg(java.lang.String msg)Logs a message to the currently used logjava.lang.Objectperform(java.lang.Object aInObject)Executes command on zOS TSO command line.protected voidreadZOSParam(java.lang.String aParamName, int aParamId, boolean aRequired, boolean aToLog, boolean aToUpperCase)Retrieves zOS parameter.voidterminate()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
-
-
-
-
Field Detail
-
LIB_NAME
public static final java.lang.String LIB_NAME
Parameter Name: "tdiappc"- See Also:
- Constant Field Values
-
PARM_PARTNERTP
public static final java.lang.String PARM_PARTNERTP
Parameter Name: "partnerTP"- See Also:
- Constant Field Values
-
PARM_DEST_LU_NAME
public static final java.lang.String PARM_DEST_LU_NAME
Parameter Name: "destLuName"- See Also:
- Constant Field Values
-
PARM_SRC_LU_NAME
public static final java.lang.String PARM_SRC_LU_NAME
Parameter Name: "srcLuName"- See Also:
- Constant Field Values
-
PARM_MODE_NAME
public static final java.lang.String PARM_MODE_NAME
Parameter Name: "modeName"- See Also:
- Constant Field Values
-
PARM_USER_ID
public static final java.lang.String PARM_USER_ID
Parameter Name: "userID"- See Also:
- Constant Field Values
-
PARM_USER_PSW
public static final java.lang.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 java.lang.String ENTRY_ATTR_CMD
Attribute name: "command"- See Also:
- Constant Field Values
-
ENTRY_ATTR_COMMAND_OUTPUT
public static final java.lang.String ENTRY_ATTR_COMMAND_OUTPUT
Attribute name: "commandOutput"- See Also:
- Constant Field Values
-
ENTRY_ATTR_APPC_RETCODE
public static final java.lang.String ENTRY_ATTR_APPC_RETCODE
Attribute name: "appcReturnCode"- See Also:
- Constant Field Values
-
ENTRY_ATTR_TSO_CMD_RETCODE
public static final java.lang.String ENTRY_ATTR_TSO_CMD_RETCODE
Attribute name: "tsoCommandReturnCode"- See Also:
- Constant Field Values
-
MSG_NO_RESPONSE
public static final java.lang.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. Defaultfalse.
-
mATBOK
public int mATBOK
Value of the returned code for 'OK'
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object aParam) throws java.lang.ExceptionInitializes the function component.- Specified by:
initializein interfaceFunctionInterface- Overrides:
initializein classFunction- Parameters:
aParam- Object to initialize; not used- Throws:
java.lang.Exception
-
readZOSParam
protected void readZOSParam(java.lang.String aParamName, int aParamId, boolean aRequired, boolean aToLog, boolean aToUpperCase) throws java.lang.ExceptionRetrieves zOS parameter.- Parameters:
aParamName- parameter nameaParamId- parameter IDaRequired-trueindicates required parameteraToLog- iftrueto log to the console if debug/detailed logging is turned onaToUpperCase-trueif we want to uppercase parameter value;falseotherwise.- Throws:
java.lang.Exception-- if invalid parameter value is encountered
- if required parameter value is
null
-
initAndPrepareForConversation
public void initAndPrepareForConversation() throws java.lang.ExceptionInitializes and prepares the FC.- Throws:
java.lang.Exception- if an error occurs.
-
loadLibrary
public static void loadLibrary()
Loads IBM Tivoli Directory Integrator library for APPC.
-
perform
public java.lang.Object perform(java.lang.Object aInObject) throws java.lang.ExceptionExecutes command on zOS TSO command line.- Parameters:
aInObject- initial entry to proceed- Returns:
- Entry object containing command to execute
- Throws:
java.lang.Exception-- if invalid parameter is passed
- or invalid TSO code returned
-
executeTSO
protected java.lang.String executeTSO(java.lang.String aTsoCmd) throws java.lang.ExceptionExecutes the TSO command passed as parameter.- Parameters:
aTsoCmd- The TSO command to be executed.- Returns:
- The result of the z/OS TSO command.
- Throws:
java.lang.Exception
-
terminate
public void terminate() throws java.lang.ExceptionTerminates the function component.- Specified by:
terminatein interfaceFunctionInterface- Overrides:
terminatein classFunction- Throws:
java.lang.Exception
-
logmsg
public void logmsg(java.lang.String msg)
Logs a message to the currently used log- Specified by:
logmsgin interfaceFunctionInterface- Overrides:
logmsgin classFunction- Parameters:
msg- The message appearing in the log
-
debug
public void debug(java.lang.String msg)
Writes a message to the log if debug/detailed logging is turned on- Specified by:
debugin interfaceFunctionInterface- Overrides:
debugin classFunction- Parameters:
msg- The message
-
getVersion
public java.lang.String getVersion()
Version information.- Returns:
- version information
-
-