public class MvsConsole extends java.lang.Object implements WtoConstants
Uses JNI wrappers to the C Library __console2() api.
DESC_CRITICAL_EVENTUAL_ACTION_REQUESTED, DESC_DYNAMIC_STATUS_DISPLAYS, DESC_EVENTUAL_ACTION_REQUIRED, DESC_IMMEDIATE_ACTION_REQUIRED, DESC_IMMEDIATE_COMMAND_RESPONSE, DESC_IMPORTANT_INFORMATION_MESSAGES, DESC_JOB_STATUS, DESC_MESSAGE_PREVIOUSLY_AUTOMATED, DESC_OPERATOR_REQUEST, DESC_OUT_OF_LINE_MESSAGE, DESC_RETAIN, DESC_SYSTEM_FAILURE, DESC_SYSTEM_STATUS, FLAG_CONSOLE_HARDCOPY, ROUTCDE_DASD_POOL, ROUTCDE_DISK_LIBRARY, ROUTCDE_EMULATORS, ROUTCDE_MASTER_CONSOLE_ACTION, ROUTCDE_MASTER_CONSOLE_INFORMATION, ROUTCDE_PROGRAMMER_INFORMATION, ROUTCDE_SYSPROG_INFORMATION, ROUTCDE_SYSTEM_SECURITY, ROUTCDE_TAPE_LIBRARY, ROUTCDE_TAPE_POOL, ROUTCDE_TELEPROCESSING_CONTROL, ROUTCDE_UNIT_RECORD_POOL
Constructor and Description |
---|
MvsConsole() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteMessage(int msgId)
Delete a WTO message.
|
static void |
deleteMessages(int[] msgIds)
Delete multiple WTO messages.
|
static void |
deleteMessagesWithToken(int deleteToken)
Delete all WTO messages with a given token id.
|
static java.lang.String |
getStartParameters()
Answer a String contain any parameters on the MVS Start command that
started the current started task.
|
static MvsConsoleResult |
interact(java.lang.String msg,
java.lang.String encoding,
int[] routcde,
int[] descr,
long flags,
int token,
int deleteToken,
int[] deleteIds,
boolean waitForCmd)
Interact with the system console by issuing/deleting WTO messages and/or waiting for
modify/stop commands.
|
static boolean |
isListening()
Returns true if an MvsCommandListener has been established.
|
static MvsCommandCallback |
registerMvsCommandCallback(MvsCommandCallback callback)
Register an MVS operator command callback.
|
static void |
startMvsCommandListener()
Called by JZOS to allow this Java application intercept MVS Operator
commands.
|
static MvsConsoleResult |
waitForCmd()
Wait for a command from the operators console.
|
static int |
wto(java.lang.String msg,
int routcdeBitMask,
int descrBitMask)
Convenience method for writing a WTO.
|
static int |
wto(WtoMessage wtoMessage)
Write a WTO message.
|
static int |
wto(WtoMessage wtoMessage,
java.lang.String encoding)
Write a WTO message with a specific encoding.
|
public static java.lang.String getStartParameters()
public static boolean isListening()
public static void startMvsCommandListener()
java.lang.IllegalStateException
- if there is already a listener runningpublic static MvsCommandCallback registerMvsCommandCallback(MvsCommandCallback callback)
callback
- an implementation of MvsCommandCallback that has customized
handlers for START, MODIFY and STOP.public static int wto(java.lang.String msg, int routcdeBitMask, int descrBitMask) throws ErrnoException
msg
- the message to write. If longer than 125 characters, it will be broken into
multiple lines of 69 characters, broken on word boundaries using the formatting
algorithm in __console2(). Embedded line-separators will cause a new WTO message
line.routcdeBitMask
- the ROUTE codes to use for the message. See WtoConstants for details.descrBitMask
- the descriptor codes to use. See WtoConstants for details.ErrnoException
- if an error occurs with the __console2() interaction.public static int wto(WtoMessage wtoMessage) throws ErrnoException
wtoMessage
- the WtoMessage object contain the message, route codes and descriptor codes.ErrnoException
- if an error occurs with the __console2() interaction.public static int wto(WtoMessage wtoMessage, java.lang.String encoding) throws ErrnoException
wtoMessage
- the WtoMessage object contain the message, route codes and descriptor codes.encoding
- a String containing the encoding name.ErrnoException
- if an error occurs with the __console2() interaction.public static void deleteMessage(int msgId) throws ErrnoException
msgId
- an int containing the message id of the message to deleteErrnoException
- if an error occurs with the __console2() interaction.public static void deleteMessages(int[] msgIds) throws ErrnoException
msgIds
- an int array containing the message ids of the messages to deleteErrnoException
- if an error occurs with the __console2() interaction.public static void deleteMessagesWithToken(int deleteToken) throws ErrnoException
deleteToken
- the token id, given on the matching WtoMessage objectsErrnoException
- if an error occurs with the __console2() interaction.WtoMessage.setToken(int)
public static MvsConsoleResult waitForCmd() throws ErrnoException
ErrnoException
- if the call to __console2() fails.registerMvsCommandCallback(MvsCommandCallback)
public static MvsConsoleResult interact(java.lang.String msg, java.lang.String encoding, int[] routcde, int[] descr, long flags, int token, int deleteToken, int[] deleteIds, boolean waitForCmd) throws ErrnoException
This method calls the __console2() C-Library function.
msg
- the WTO message to write.encoding
- the codepage to use for the WTO message.routcde
- an array of routing codes assigned to the message.descr
- an array of message descriptor codes assigned to the message.flags
- the flags assigned to the message. Can be 0 or FLAG_CONSOLE_HARDCOPYtoken
- the grouping token to use to tag this messagedeleteToken
- the grouping token to use to delete messages from the consoledeleteIds
- an array of message ids to delete from the console.waitForCmd
- a boolean that directs the __console2() command to wait for an operator commandErrnoException
- if the call to __console2() fails. The errno and errno2 code
can be used to determine what the nature of the failure is.