public class CommandList
extends java.lang.Object
implements java.io.Serializable
Command
objects which can then be
used to retrieve information about each individual CL command in the list.
The following example demonstrates the use of CommandList:
AS400 system = new AS400("mySystem"); // Generate a list of commands that start with "CRT". CommandList list = new CommandList(system, "QSYS", "CRT*"); try { Command[] cmdList = list.generateList(); } catch (Exception e) { e.printStackTrace(); }
Command
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
ALL
Constant used to retrieve all commands in a given library.
|
Constructor and Description |
---|
CommandList()
Constructs a CommandList object.
|
CommandList(AS400 system,
java.lang.String library,
java.lang.String command)
Constructs a CommandList object.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.
|
Command[] |
generateList()
Generate a list of commands.
|
java.lang.String |
getCommand()
Returns the command name used to generate a list for.
|
java.lang.String |
getLibrary()
Returns the library where the command(s) reside.
|
AS400 |
getSystem()
Returns the system from which to retrieve the command list.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener.
|
void |
setCommand(java.lang.String command)
Sets the command name filter used to generate the list.
|
void |
setLibrary(java.lang.String library)
Sets the library where the command(s) reside.
|
void |
setSystem(AS400 system)
Sets the system from which to retrieve the command list.
|
java.lang.String |
toString()
Returns a String representation of this CommandList.
|
public static final java.lang.String ALL
public CommandList()
public CommandList(AS400 system, java.lang.String library, java.lang.String command)
system
- The system on which the commands resides.library
- The library in which the commands resides, e.g. "QSYS".command
- The name of a command or list of commands, e.g. "CRTUSRPRF" or "CRT*". Wildcards or the CommandList.ALL
constant can be used.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.public java.lang.String getCommand()
setCommand(java.lang.String)
public java.lang.String getLibrary()
setLibrary(java.lang.String)
public AS400 getSystem()
setSystem(com.ibm.as400.access.AS400)
public Command[] generateList() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.io.IOException, java.lang.InterruptedException, ObjectDoesNotExistException
AS400Exception
- If an error occurs.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.io.IOException
- If an error occurs while communicating with the system.java.lang.InterruptedException
- If this thread is interrupted.ObjectDoesNotExistException
- If the object does not exist.setCommand(java.lang.String)
,
setLibrary(java.lang.String)
,
setSystem(com.ibm.as400.access.AS400)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.public void setCommand(java.lang.String command)
command
- The command(s) for which to generate a list.getCommand()
public void setLibrary(java.lang.String library)
library
- The library where the command(s) reside.getLibrary()
public void setSystem(AS400 system)
system
- The system from which to retrieve the commands.getSystem()
public java.lang.String toString()
toString
in class java.lang.Object