com.ibm.as400.access
Class Command

java.lang.Object
  extended by com.ibm.as400.access.Command
All Implemented Interfaces:
Serializable

public class Command
extends Object
implements Serializable

Represents information about a CL command (*CMD) object on the system.

To actually execute a CL command, use the CommandCall class.

To generate HTML help for a CL command, see the CommandHelpRetriever utility.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
static byte ACTION_ESCAPE_MESSAGE
          Constant indicating that the multithreaded job action used by the command is not to run the command, but issue an escape message instead.
static byte ACTION_INFO_MESSAGE
          Constant indicating that the multithreaded job action used by the command is to run the command and issue an informational message.
static byte ACTION_NO_MESSAGE
          Constant indicating that the multithreaded job action used by the command is to run the command and issue no messages.
static byte ACTION_SYSTEM_VALUE
          Constant indicating that the multithreaded job action used by the command is specified by the QMLTTHDACN system value.
static int ALLOW_ALL
          Constant indicating that the command is allowed to run in all environments.
static int ALLOW_BATCH_JOB
          Constant indicating that the command is allowed to run in a batch job (*BATCH).
static int ALLOW_BATCH_PROGRAM
          Constant indicating that the command is allowed to run in a batch program (*BPGM).
static int ALLOW_BATCH_REXX_PROCEDURE
          Constant indicating that the command is allowed to run in a batch REXX procedure (*BREXX).
static int ALLOW_EXEC
          Constant indicating that the command is allowed to run using QCMDEXC, QCAEXEC, or QCAPCMD (*EXEC).
static int ALLOW_INTERACTIVE_JOB
          Constant indicating that the command is allowed to run in an interactive job (*INTERACT).
static int ALLOW_INTERACTIVE_PROGRAM
          Constant indicating that the command is allowed to run in an interactive program (*IPGM).
static int ALLOW_INTERACTIVE_REXX_PROCEDURE
          Constant indicating that the command is allowed to run in an interactive REXX procedure (*IREXX).
static int MODE_ALL
          Constant indicating that the command will run in all modes.
static int MODE_DEBUG
          Constant indicating that the command will run in debug mode of the operating environment.
static int MODE_PRODUCTION
          Constant indicating that the command will run in production mode of the operating environment.
static int MODE_SERVICE
          Constant indicating that the command will run in service mode of the operating environment.
static String SYSTEM_STATE
          Constant indicating that a program is called from system state.
static byte THREADSAFE_CONDITIONAL
          Constant indicating that the command is threadsafe under certain conditions.
static byte THREADSAFE_NO
          Constant indicating that the command is not threadsafe.
static byte THREADSAFE_YES
          Constant indicating that the command is threadsafe.
static String USER_STATE
          Constant indicating that a program is called from user state.
 
Constructor Summary
Constructor and Description
Command()
          Constructs a Command object.
Command(AS400 system, String path)
          Constructs a Command object.
 
Method Summary
Modifier and Type Method and Description
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 boolean allowsLimitedUser()
          Indicates whether or not a user with limited authorities is allowed to run this command.
 int getCCSID()
          Returns the coded character set ID (CCSID) associated with this command.
 String getCommandProcessingProgram()
          Returns the fully qualified integrated file system path of the program that accepts parameters from this command processes this command.
 String getCommandProcessingState()
          Returns the state from which the command processing program is called.
 String getCurrentLibrary()
          Returns the library used as the current library during the processing of this command.
 String getDescription()
          Returns the user text used to briefly describe this command and its function.
 String getHelpIdentifier()
          Returns the name of the general help module for the names of the help identifiers for this command.
 PanelGroup getHelpPanelGroup()
          Returns the fully integrated file system path of the help panel group in which the online help information exists for this command.
 String getHelpSearchIndex()
          Returns the fully qualified integrated file system path of the help search index used for this command.
 int getMaximumPositionalParameters()
          Returns the maximum number of parameters that can be coded in a positional manner for this command.
 MessageFile getMessageFile()
          Returns a MessageFile object representing the message file from which messages identified on the DEP statements used to define the command are retrieved.
 byte getMultithreadedJobAction()
          Returns the action taken when a command that is not threadsafe is called in a multithreaded job.
 String getPath()
          Returns the path name of this Command object.
 String getProductLibrary()
          Returns the library that is in effect during the processing of the command.
 MessageFile getPromptMessageFile()
          Returns a MessageFile object representing the message file that contains the prompt text for this command.
 String getPromptOverrideProgram()
          Returns the fully qualified integrated file system path of the program that replaces default values on the prompt display with the current actual values for the parameter.
 String getPromptOverrideState()
          Returns the state from which the prompt override program is called.
 String getRestrictedRelease()
          Returns the version, release, and modification level to which this command is restricted.
 String getSourceFile()
          Returns the fully qualified integrated file system path of the source file member that contains the command definition statements used to create this command.
 AS400 getSystem()
          Returns the system object for this command.
 byte getThreadSafety()
          Returns the type of threadsafety for this command; that is, whether or not this command can be used safely in a multithreaded job.
 String getValidityCheckProgram()
          Returns the fully qualified integrated file system path of the program that performs additional user-defined validity checking on the parameters for this command.
 String getValidityCheckState()
          Returns the state from which the validity check program is called.
 String getWhereAllowedToRun()
          Returns the API string for the "where allowed to run" field.
 String getXML()
          Retrieves the XML source for this CL command.
 String getXMLExtended()
          Retrieves the extended XML source for this CL command.
 PanelGroupHelpIdentifier[] getXMLHelpIdentifiers()
          Parses the XML source for this CL command and returns the help identifiers.
 String getXMLHelpText()
          Parses the XML source for this CL command and returns the help text.
 String getXMLHelpText(PanelGroup panelGroup)
          Parses the XML source for this CL command and returns the help text.
 String getXMLPanelGroup()
          Parses the XML source for this CL command and returns the name of the panel group.
 String getXMLProductLibrary()
          Parses the XML source for this CL command and returns the product library.
 boolean isAllowedToRun(int environment)
          Indicates whether the command is allowed to run in the specified environment.
 boolean isAllowedToRunBatch()
          Indicates whether or not this command is allowed to run in one or more of the batch environments: ALLOW_BATCH_PROGRAM ALLOW_BATCH_JOB ALLOW_BATCH_REXX_PROCEDURE
 boolean isAllowedToRunInteractive()
          Indicates whether or not this command is allowed to run in one or more of the interactive environments: ALLOW_INTERACTIVE_PROGRAM ALLOW_INTERACTIVE_JOB ALLOW_INTERACTIVE_REXX_PROCEDURE
 boolean isEnabledForGUI()
          Indicates whether or not the command prompt panels are enabled for conversion to a graphical user interface.
 boolean isOperatingMode(int mode)
          Indicates if this command applies to the specified mode of operating environment.
 void refresh()
          Refreshes the information for this Command object.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the PropertyChangeListener.
 void setPath(String path)
          Sets the path name of the command.
 void setSystem(AS400 system)
          Sets the system from which to retrieve the command list.
 String toString()
          Returns a String representation of this Command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_ESCAPE_MESSAGE

public static final byte ACTION_ESCAPE_MESSAGE
Constant indicating that the multithreaded job action used by the command is not to run the command, but issue an escape message instead.

See Also:
getMultithreadedJobAction(), Constant Field Values

ACTION_INFO_MESSAGE

public static final byte ACTION_INFO_MESSAGE
Constant indicating that the multithreaded job action used by the command is to run the command and issue an informational message.

See Also:
getMultithreadedJobAction(), Constant Field Values

ACTION_NO_MESSAGE

public static final byte ACTION_NO_MESSAGE
Constant indicating that the multithreaded job action used by the command is to run the command and issue no messages.

See Also:
getMultithreadedJobAction(), Constant Field Values

ACTION_SYSTEM_VALUE

public static final byte ACTION_SYSTEM_VALUE
Constant indicating that the multithreaded job action used by the command is specified by the QMLTTHDACN system value.

See Also:
getMultithreadedJobAction(), Constant Field Values

ALLOW_ALL

public static final int ALLOW_ALL
Constant indicating that the command is allowed to run in all environments.

See Also:
isAllowedToRun(int), Constant Field Values

ALLOW_BATCH_JOB

public static final int ALLOW_BATCH_JOB
Constant indicating that the command is allowed to run in a batch job (*BATCH).

See Also:
isAllowedToRun(int), Constant Field Values

ALLOW_BATCH_PROGRAM

public static final int ALLOW_BATCH_PROGRAM
Constant indicating that the command is allowed to run in a batch program (*BPGM).

See Also:
isAllowedToRun(int), Constant Field Values

ALLOW_BATCH_REXX_PROCEDURE

public static final int ALLOW_BATCH_REXX_PROCEDURE
Constant indicating that the command is allowed to run in a batch REXX procedure (*BREXX).

See Also:
isAllowedToRun(int), Constant Field Values

ALLOW_EXEC

public static final int ALLOW_EXEC
Constant indicating that the command is allowed to run using QCMDEXC, QCAEXEC, or QCAPCMD (*EXEC).

See Also:
isAllowedToRun(int), Constant Field Values

ALLOW_INTERACTIVE_JOB

public static final int ALLOW_INTERACTIVE_JOB
Constant indicating that the command is allowed to run in an interactive job (*INTERACT).

See Also:
isAllowedToRun(int), Constant Field Values

ALLOW_INTERACTIVE_PROGRAM

public static final int ALLOW_INTERACTIVE_PROGRAM
Constant indicating that the command is allowed to run in an interactive program (*IPGM).

See Also:
isAllowedToRun(int), Constant Field Values

ALLOW_INTERACTIVE_REXX_PROCEDURE

public static final int ALLOW_INTERACTIVE_REXX_PROCEDURE
Constant indicating that the command is allowed to run in an interactive REXX procedure (*IREXX).

See Also:
isAllowedToRun(int), Constant Field Values

MODE_ALL

public static final int MODE_ALL
Constant indicating that the command will run in all modes.

See Also:
isOperatingMode(int), Constant Field Values

MODE_DEBUG

public static final int MODE_DEBUG
Constant indicating that the command will run in debug mode of the operating environment.

See Also:
isOperatingMode(int), Constant Field Values

MODE_PRODUCTION

public static final int MODE_PRODUCTION
Constant indicating that the command will run in production mode of the operating environment.

See Also:
isOperatingMode(int), Constant Field Values

MODE_SERVICE

public static final int MODE_SERVICE
Constant indicating that the command will run in service mode of the operating environment.

See Also:
isOperatingMode(int), Constant Field Values

SYSTEM_STATE

public static final String SYSTEM_STATE
Constant indicating that a program is called from system state.

See Also:
USER_STATE, Constant Field Values

THREADSAFE_CONDITIONAL

public static final byte THREADSAFE_CONDITIONAL
Constant indicating that the command is threadsafe under certain conditions. See the API documentation for the command to determine the conditions for threadsafety.

See Also:
THREADSAFE_NO, THREADSAFE_YES, getThreadSafety(), Constant Field Values

THREADSAFE_NO

public static final byte THREADSAFE_NO
Constant indicating that the command is not threadsafe.

See Also:
THREADSAFE_CONDITIONAL, THREADSAFE_YES, getThreadSafety(), Constant Field Values

THREADSAFE_YES

public static final byte THREADSAFE_YES
Constant indicating that the command is threadsafe.

See Also:
THREADSAFE_CONDITIONAL, THREADSAFE_NO, getThreadSafety(), Constant Field Values

USER_STATE

public static final String USER_STATE
Constant indicating that a program is called from user state.

See Also:
SYSTEM_STATE, Constant Field Values
Constructor Detail

Command

public Command()
Constructs a Command object. The system and command path must be set before this object can be used.

See Also:
setPath(java.lang.String), setSystem(com.ibm.as400.access.AS400)

Command

public Command(AS400 system,
               String path)
Constructs a Command object.

Parameters:
system - The system on which the command resides.
path - The fully qualified integrated file system path of the command, e.g. "/QSYS.LIB/CRTUSRPRF.CMD".
See Also:
QSYSObjectPathName
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method will be called each time the value of any bound property is changed. The PropertyChangeListener object is added to a list of PropertyChangeListeners managed by this Command. It can be removed with removePropertyChangeListener.

Parameters:
listener - The PropertyChangeListener.

allowsLimitedUser

public boolean allowsLimitedUser()
                          throws AS400Exception,
                                 AS400SecurityException,
                                 ErrorCompletingRequestException,
                                 IOException,
                                 InterruptedException,
                                 ObjectDoesNotExistException
Indicates whether or not a user with limited authorities is allowed to run this command.

Returns:
true if a limited user is allowed to run this command; false otherwise.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getCCSID

public int getCCSID()
             throws AS400Exception,
                    AS400SecurityException,
                    ErrorCompletingRequestException,
                    IOException,
                    InterruptedException,
                    ObjectDoesNotExistException
Returns the coded character set ID (CCSID) associated with this command. It is the value of the job CCSID when this command was created.

Returns:
The CCSID of the command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getCommandProcessingProgram

public String getCommandProcessingProgram()
                                   throws AS400Exception,
                                          AS400SecurityException,
                                          ErrorCompletingRequestException,
                                          IOException,
                                          InterruptedException,
                                          ObjectDoesNotExistException
Returns the fully qualified integrated file system path of the program that accepts parameters from this command processes this command.

Returns:
The command processing program name, or *REXX if the command processing program is a REXX procedure.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getCommandProcessingState

public String getCommandProcessingState()
                                 throws AS400Exception,
                                        AS400SecurityException,
                                        ErrorCompletingRequestException,
                                        IOException,
                                        InterruptedException,
                                        ObjectDoesNotExistException
Returns the state from which the command processing program is called. Possible values are:

Returns:
The state.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getCurrentLibrary

public String getCurrentLibrary()
                         throws AS400Exception,
                                AS400SecurityException,
                                ErrorCompletingRequestException,
                                IOException,
                                InterruptedException,
                                ObjectDoesNotExistException
Returns the library used as the current library during the processing of this command. Special values include:

Returns:
The current library name.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getDescription

public String getDescription()
                      throws AS400Exception,
                             AS400SecurityException,
                             ErrorCompletingRequestException,
                             IOException,
                             InterruptedException,
                             ObjectDoesNotExistException
Returns the user text used to briefly describe this command and its function.

Returns:
The text description, or "" if there is none.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getHelpIdentifier

public String getHelpIdentifier()
                         throws AS400Exception,
                                AS400SecurityException,
                                ErrorCompletingRequestException,
                                IOException,
                                InterruptedException,
                                ObjectDoesNotExistException
Returns the name of the general help module for the names of the help identifiers for this command. Special values include:

Returns:
The help identifier.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getHelpPanelGroup

public PanelGroup getHelpPanelGroup()
                             throws AS400Exception,
                                    AS400SecurityException,
                                    ErrorCompletingRequestException,
                                    IOException,
                                    InterruptedException,
                                    ObjectDoesNotExistException
Returns the fully integrated file system path of the help panel group in which the online help information exists for this command.

Returns:
The help panel group, or null if no help panel group is defined for this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getHelpSearchIndex

public String getHelpSearchIndex()
                          throws AS400Exception,
                                 AS400SecurityException,
                                 ErrorCompletingRequestException,
                                 IOException,
                                 InterruptedException,
                                 ObjectDoesNotExistException
Returns the fully qualified integrated file system path of the help search index used for this command.

Returns:
The search index name, or *NONE if no help search index is specified.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getMaximumPositionalParameters

public int getMaximumPositionalParameters()
                                   throws AS400Exception,
                                          AS400SecurityException,
                                          ErrorCompletingRequestException,
                                          IOException,
                                          InterruptedException,
                                          ObjectDoesNotExistException
Returns the maximum number of parameters that can be coded in a positional manner for this command.

Returns:
The number of parameters, or -1 if there is no maximum positional coding limit specified for this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getMessageFile

public MessageFile getMessageFile()
                           throws AS400Exception,
                                  AS400SecurityException,
                                  ErrorCompletingRequestException,
                                  IOException,
                                  InterruptedException,
                                  ObjectDoesNotExistException
Returns a MessageFile object representing the message file from which messages identified on the DEP statements used to define the command are retrieved.

Returns:
The message file.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getMultithreadedJobAction

public byte getMultithreadedJobAction()
                               throws AS400Exception,
                                      AS400SecurityException,
                                      ErrorCompletingRequestException,
                                      IOException,
                                      InterruptedException,
                                      ObjectDoesNotExistException
Returns the action taken when a command that is not threadsafe is called in a multithreaded job. Possible values are: If the threadsafe indicator is either THREADSAFE_YES or THREADSAFE_CONDITIONAL, then the multithreaded job action will be returned as ACTION_NO_MESSAGE.

Returns:
The multithreaded job action for this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
See Also:
getThreadSafety()

getPath

public String getPath()
Returns the path name of this Command object.

Returns:
The path name, or null if the path is not set.
See Also:
setPath(java.lang.String)

getProductLibrary

public String getProductLibrary()
                         throws AS400Exception,
                                AS400SecurityException,
                                ErrorCompletingRequestException,
                                IOException,
                                InterruptedException,
                                ObjectDoesNotExistException
Returns the library that is in effect during the processing of the command. Special values include:

Returns:
The product library name.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getPromptMessageFile

public MessageFile getPromptMessageFile()
                                 throws AS400Exception,
                                        AS400SecurityException,
                                        ErrorCompletingRequestException,
                                        IOException,
                                        InterruptedException,
                                        ObjectDoesNotExistException
Returns a MessageFile object representing the message file that contains the prompt text for this command.

Returns:
The message file, or null if no message file was specified for the prompt text.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getPromptOverrideProgram

public String getPromptOverrideProgram()
                                throws AS400Exception,
                                       AS400SecurityException,
                                       ErrorCompletingRequestException,
                                       IOException,
                                       InterruptedException,
                                       ObjectDoesNotExistException
Returns the fully qualified integrated file system path of the program that replaces default values on the prompt display with the current actual values for the parameter.

Returns:
The prompt override program name, or *NONE if no prompt override program was specified for this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getPromptOverrideState

public String getPromptOverrideState()
                              throws AS400Exception,
                                     AS400SecurityException,
                                     ErrorCompletingRequestException,
                                     IOException,
                                     InterruptedException,
                                     ObjectDoesNotExistException
Returns the state from which the prompt override program is called. Possible values are:

Returns:
The state.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getRestrictedRelease

public String getRestrictedRelease()
                            throws AS400Exception,
                                   AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   IOException,
                                   InterruptedException,
                                   ObjectDoesNotExistException
Returns the version, release, and modification level to which this command is restricted. If this field is blank, the command can be used in the current release. This applies only to a command used in a CL program. It must match the contents of the target release parameter on the Create CL Program (CRTCLPGM) command.

Returns:
The release in the format "VxRxMx", or "" if the command can be used in the current release.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
See Also:
AS400.getVRM()

getSourceFile

public String getSourceFile()
                     throws AS400Exception,
                            AS400SecurityException,
                            ErrorCompletingRequestException,
                            IOException,
                            InterruptedException,
                            ObjectDoesNotExistException
Returns the fully qualified integrated file system path of the source file member that contains the command definition statements used to create this command.

Returns:
The source file name, or null if the source file is not known.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getSystem

public AS400 getSystem()
Returns the system object for this command.

Returns:
The system, or null if the system is not set.

getThreadSafety

public byte getThreadSafety()
                     throws AS400Exception,
                            AS400SecurityException,
                            ErrorCompletingRequestException,
                            IOException,
                            InterruptedException,
                            ObjectDoesNotExistException
Returns the type of threadsafety for this command; that is, whether or not this command can be used safely in a multithreaded job. Possible values are:

Returns:
The threadsafety indicator for this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
See Also:
getMultithreadedJobAction()

getValidityCheckProgram

public String getValidityCheckProgram()
                               throws AS400Exception,
                                      AS400SecurityException,
                                      ErrorCompletingRequestException,
                                      IOException,
                                      InterruptedException,
                                      ObjectDoesNotExistException
Returns the fully qualified integrated file system path of the program that performs additional user-defined validity checking on the parameters for this command.

Returns:
The validity check program name, or *NONE if no separate user-defined validity checking is done for this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getValidityCheckState

public String getValidityCheckState()
                             throws AS400Exception,
                                    AS400SecurityException,
                                    ErrorCompletingRequestException,
                                    IOException,
                                    InterruptedException,
                                    ObjectDoesNotExistException
Returns the state from which the validity check program is called. Possible values are:

Returns:
The state.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getWhereAllowedToRun

public String getWhereAllowedToRun()
                            throws AS400Exception,
                                   AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   IOException,
                                   InterruptedException,
                                   ObjectDoesNotExistException
Returns the API string for the "where allowed to run" field. This method is externalized for those classes that need the entire field. Simpler access to this data can be achieved by using the following methods:

Returns:
The "where allowed to run" field.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getXML

public String getXML()
              throws AS400Exception,
                     AS400SecurityException,
                     ErrorCompletingRequestException,
                     IOException,
                     InterruptedException,
                     ObjectDoesNotExistException
Retrieves the XML source for this CL command.

Returns:
The XML describing this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

getXMLExtended

public String getXMLExtended()
                      throws AS400Exception,
                             AS400SecurityException,
                             ErrorCompletingRequestException,
                             IOException,
                             InterruptedException,
                             ObjectDoesNotExistException
Retrieves the extended XML source for this CL command. This returns more information than getXML().

Note: This method uses the CMDD0200 format on the QCDRCMDD API. If the system does not support this format, an AS400Exception will be thrown with a message ID of CPF3C21, and you should use the getXML() method instead.

Returns:
The XML describing this command.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
See Also:
getXML()

getXMLHelpIdentifiers

public PanelGroupHelpIdentifier[] getXMLHelpIdentifiers()
                                                 throws AS400Exception,
                                                        AS400SecurityException,
                                                        ErrorCompletingRequestException,
                                                        IOException,
                                                        InterruptedException,
                                                        ObjectDoesNotExistException,
                                                        SAXException,
                                                        ParserConfigurationException
Parses the XML source for this CL command and returns the help identifiers.

Returns:
The help identifiers, or null if no panel group was found in the XML source.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
SAXException
ParserConfigurationException

getXMLProductLibrary

public String getXMLProductLibrary()
                            throws AS400Exception,
                                   AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   IOException,
                                   InterruptedException,
                                   ObjectDoesNotExistException,
                                   SAXException,
                                   ParserConfigurationException
Parses the XML source for this CL command and returns the product library.

Returns:
The product library, or null if no panel group was found in the XML source.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
SAXException
ParserConfigurationException

getXMLPanelGroup

public String getXMLPanelGroup()
                        throws AS400Exception,
                               AS400SecurityException,
                               ErrorCompletingRequestException,
                               IOException,
                               InterruptedException,
                               ObjectDoesNotExistException,
                               SAXException,
                               ParserConfigurationException
Parses the XML source for this CL command and returns the name of the panel group.

Returns:
The panel group, or null if no panel group was found in the XML source.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
SAXException
ParserConfigurationException

getXMLHelpText

public String getXMLHelpText()
                      throws AS400Exception,
                             AS400SecurityException,
                             ErrorCompletingRequestException,
                             IOException,
                             InterruptedException,
                             ObjectDoesNotExistException,
                             SAXException,
                             ParserConfigurationException
Parses the XML source for this CL command and returns the help text.

Returns:
The help text, or null if no panel group was found in the XML source.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
SAXException
ParserConfigurationException

getXMLHelpText

public String getXMLHelpText(PanelGroup panelGroup)
                      throws AS400Exception,
                             AS400SecurityException,
                             ErrorCompletingRequestException,
                             IOException,
                             InterruptedException,
                             ObjectDoesNotExistException,
                             SAXException,
                             ParserConfigurationException
Parses the XML source for this CL command and returns the help text. The XML help text generated by this method is not cached like the text generated by getXMLHelpText().

Parameters:
panelGroup - The panel group used to generate the help text, instead of the Command's defined panel group.
Returns:
The help text.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
SAXException
ParserConfigurationException
See Also:
getXMLPanelGroup()

isAllowedToRun

public boolean isAllowedToRun(int environment)
                       throws AS400Exception,
                              AS400SecurityException,
                              ErrorCompletingRequestException,
                              IOException,
                              InterruptedException,
                              ObjectDoesNotExistException
Indicates whether the command is allowed to run in the specified environment.

Parameters:
environment - The environment to check. Possible values are:
Returns:
true if this command is allowed to run in the specified environment; false otherwise.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

isAllowedToRunBatch

public boolean isAllowedToRunBatch()
                            throws AS400Exception,
                                   AS400SecurityException,
                                   ErrorCompletingRequestException,
                                   IOException,
                                   InterruptedException,
                                   ObjectDoesNotExistException
Indicates whether or not this command is allowed to run in one or more of the batch environments:

Returns:
true if this command is allowed to run in one or more of the batch environments; false otherwise.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
See Also:
isAllowedToRun(int)

isAllowedToRunInteractive

public boolean isAllowedToRunInteractive()
                                  throws AS400Exception,
                                         AS400SecurityException,
                                         ErrorCompletingRequestException,
                                         IOException,
                                         InterruptedException,
                                         ObjectDoesNotExistException
Indicates whether or not this command is allowed to run in one or more of the interactive environments:

Returns:
true if this command is allowed to run in one or more of the interactive environments; false otherwise.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
See Also:
isAllowedToRun(int)

isEnabledForGUI

public boolean isEnabledForGUI()
                        throws AS400Exception,
                               AS400SecurityException,
                               ErrorCompletingRequestException,
                               IOException,
                               InterruptedException,
                               ObjectDoesNotExistException
Indicates whether or not the command prompt panels are enabled for conversion to a graphical user interface.

Returns:
true if the command prompt panels are enabled for conversion to a graphical user interface by including information about the panel content in the 5250 data stream; false otherwise.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

isOperatingMode

public boolean isOperatingMode(int mode)
                        throws AS400Exception,
                               AS400SecurityException,
                               ErrorCompletingRequestException,
                               IOException,
                               InterruptedException,
                               ObjectDoesNotExistException
Indicates if this command applies to the specified mode of operating environment.

Parameters:
mode - The operating mode to check. Possible values are:
Returns:
true if this command applies to the specified operating mode; false otherwise.
Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException

refresh

public void refresh()
             throws AS400Exception,
                    AS400SecurityException,
                    ErrorCompletingRequestException,
                    IOException,
                    InterruptedException,
                    ObjectDoesNotExistException,
                    SAXException,
                    ParserConfigurationException
Refreshes the information for this Command object. This method is used to perform the call to the system that retrieves the command information, XML, and help ID information for this CL command. That information is cached internally until this method is called again. Note that this method does not currently refresh the extended XML information provided by the getXMLExtended() method.

The necessary information is implicitly refreshed by the various getter methods. The system and path must be set before refresh() is called.

Throws:
AS400Exception
AS400SecurityException
ErrorCompletingRequestException
IOException
InterruptedException
ObjectDoesNotExistException
SAXException
ParserConfigurationException
See Also:
setPath(java.lang.String), setSystem(com.ibm.as400.access.AS400)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener. If the PropertyChangeListener is not on the list, nothing is done.

Parameters:
listener - The PropertyChangeListener.

setPath

public void setPath(String path)
Sets the path name of the command.

Parameters:
path - The command path, e.g. "/QSYS.LIB/CRTUSRPRF.CMD".
See Also:
getPath()

setSystem

public void setSystem(AS400 system)
Sets the system from which to retrieve the command list.

Parameters:
system - The system from which to retrieve the commands.
See Also:
getSystem()

toString

public String toString()
Returns a String representation of this Command.

Overrides:
toString in class Object
Returns:
The string, which includes the fully integrated file system path name of this command.