public class Subsystem
extends java.lang.Object
refresh()
. Other than getObjectDescription(), none of the getters will themselves go to the system to get the current attribute value. Prior to the first refresh(), many of the getters will return null or zero.
Subsystem sbs = new Subsystem(system, library, name); if (!sbs.exists()) { System.out.println("No such subsystem: "+sbs.getPath()); } else { sbs.refresh(); System.out.println("Status: " + sbs.getStatus()); System.out.println("Number of jobs: " + sbs.getCurrentActiveJobs()); System.out.println("Maximum jobs: " + sbs.getMaximumActiveJobs()); SystemPool[] pools = sbs.getPools(); System.out.print("Pools: "); if (pools == null) System.out.println("null"); else for (int i=0; i<pools.length; i++) { System.out.print(" " + (pools[i] == null ? "null" : pools[i].getName())); } System.out.println(); } System.out.println("All subsystems on "+system.getSystemName()); Subsystem[] list = Subsystem.listAllSubsystems(system); for (int i=0; i<list.length; i++) { System.out.println(list[i].getLibrary()+"/"+list[i].getName()); }
Modifier and Type | Field and Description |
---|---|
static int |
NO_MAX
Value for the maximumActiveJobs property, indicating "no maximum".
|
static int |
NO_TIME_LIMIT
Value for the timeLimit parameter of the end() methods, indicating "no time limit".
|
Constructor and Description |
---|
Subsystem(AS400 system,
java.lang.String path)
Constructs a Subsystem object.
|
Subsystem(AS400 system,
java.lang.String library,
java.lang.String name)
Constructs a Subsystem object.
|
Modifier and Type | Method and Description |
---|---|
void |
assignPool(int sequenceNumber,
int size,
int activityLevel)
Defines a private storage pool and adds it to the list of storage pools defined for the subsystem.
|
void |
assignPool(int sequenceNumber,
java.lang.String poolName)
Adds a shared system pool to the list of storage pools defined for the subsystem.
|
void |
changeDescriptionText(java.lang.String text)
Sets the subsystem description text.
|
void |
changeDisplayFilePath(java.lang.String path)
Specifies the signon display file that is used when showing signon displays at work stations allocated to the subsystem.
|
void |
changeLanguageLibrary(java.lang.String library)
Specifies a library to enter ahead of other libraries in the system portion of the library list.
|
void |
changeMaximumActiveJobs(int maxJobs)
Sets the maximum number of active jobs that can run or use resources within the subsystem at one time.
|
void |
create()
Creates the subsystem on the system.
|
void |
create(java.lang.String authority)
Creates the subsystem on the system.
|
void |
delete()
Deletes the subsystem from the system.
|
void |
end(int timeLimit)
Ends the subsystem on the system, in a controlled manner.
|
static void |
endAllSubsystems(AS400 system,
int timeLimit)
Ends all active subsystems on the system, in a controlled manner.
|
static void |
endAllSubsystemsImmediately(AS400 system)
Ends all active subsystems on the system, immediately.
|
void |
endImmediately()
Ends the subsystem on the system, immediately.
|
boolean |
equals(java.lang.Object obj)
Determines whether this Subsystem object is equal to another object.
|
boolean |
exists()
Determines if the subsystem currently exists on the system.
|
int |
getCurrentActiveJobs()
Returns the number of jobs currently active in the subsystem.
|
java.lang.String |
getDescriptionText()
Returns the subsystem description text.
|
java.lang.String |
getDisplayFilePath()
Returns the path of the signon display file that is used when showing signon displays at work stations allocated to the subsystem.
|
java.lang.String |
getLanguageLibrary()
Returns the library that is entered ahead of other libraries in the system portion of the library list.
|
java.lang.String |
getLibrary()
Returns the name of the library where the subsystem resides on the system.
|
int |
getMaximumActiveJobs()
Returns the maximum number of active jobs that can run or use resources within the subsystem at one time.
|
Job |
getMonitorJob()
Returns the subsystem monitor job.
|
java.lang.String |
getName()
Returns the subsystem name.
|
ObjectDescription |
getObjectDescription()
Returns an ObjectDescription instance representing the subsystem.
|
java.lang.String |
getPath()
Returns the fully-qualifed IFS pathname of the subsystem.
|
SystemPool |
getPool(int sequenceNumber)
Returns the storage pool defined at the specified position for the subsystem.
|
SystemPool[] |
getPools()
Returns the list of storage pools that are defined for the subsystem.
|
java.lang.String |
getStatus()
Returns the extended status of the subsystem.
|
AS400 |
getSystem()
Returns the system where the subsystem resides.
|
int |
hashCode()
Returns a hash code value for the object.
|
static Subsystem[] |
listAllSubsystems(AS400 system)
Lists all subsystems on the system.
|
void |
refresh()
Refreshes the attributes of this Subsystem object, to reflect the current state of the subsystem on the system.
|
void |
removePool(int sequenceNumber)
Removes a storage pool from the list of pools defined for the subsystem.
|
void |
start()
Starts the subsystem on the system.
|
public static final int NO_MAX
public static final int NO_TIME_LIMIT
public Subsystem(AS400 system, java.lang.String library, java.lang.String name)
system
- The system.library
- The name of the library where the subsystem resides.name
- The simple name of the subsystem.create()
public void assignPool(int sequenceNumber, java.lang.String poolName) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
sequenceNumber
- The number of the pool, within the pool list for the subsystem. Valid values are 1-10.poolName
- The name of a shared system storage pool. Valid values include: *BASE, *NOSTG, *INTERACT, *SPOOL, and *SHRPOOLnn, where nn is an integer from 1 to 60.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void assignPool(int sequenceNumber, int size, int activityLevel) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
sequenceNumber
- The number of the pool, within the pool list for the subsystem. Valid values are 1-10.size
- The size of the storage pool, in kilobytes. Must be at least 256 (meaning 256 kilobytes).activityLevel
- The activity level of the pool.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void changeDescriptionText(java.lang.String text) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
text
- The subsystem description text. To clear the description, specify "".AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void changeDisplayFilePath(java.lang.String path) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
path
- The fully qualified pathname of the signon display file. See QSYSObjectPathName.toString()
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void changeLanguageLibrary(java.lang.String library) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
library
- The name of the library. Specify "" or "*NONE" to remove the current secondary language library from the system library list.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void changeMaximumActiveJobs(int maxJobs) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
maxJobs
- The maximum number of active jobs. Valid values are 0-1000. Special value NO_MAX
is the default, and indicates no maximum.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void create() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ObjectAlreadyExistsException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.ObjectAlreadyExistsException
- If the object already exists on the system.public void create(java.lang.String authority) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ObjectAlreadyExistsException
authority
- The authority to give to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object. The default is *LIBCRTAUT. The "base system pool" (*BASE) is used.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.ObjectAlreadyExistsException
- If the object already exists on the system.public void delete() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void end(int timeLimit) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
timeLimit
- The amount of time (in seconds) that is allowed to complete the controlled subsystem end operation. If this amount of time is exceeded and the end operation is not complete, any jobs still being processed in the subsystem are ended immediately. Special value NO_TIME_LIMIT
indicates no time limit.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public static void endAllSubsystems(AS400 system, int timeLimit) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException
system
- The system.timeLimit
- The amount of time (in seconds) that is allowed to complete the controlled subsystem end operation. If this amount of time is exceeded and the end operation is not complete, any jobs still being processed in the subsystem are ended immediately. Special value NO_TIME_LIMIT
indicates no time limit.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public static void endAllSubsystemsImmediately(AS400 system) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException
system
- The system.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.public void endImmediately() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean exists() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the system API (that queries subsystem description information) is missing.public int getCurrentActiveJobs()
public java.lang.String getDescriptionText()
public java.lang.String getDisplayFilePath()
public java.lang.String getLanguageLibrary() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public java.lang.String getLibrary()
public int getMaximumActiveJobs()
NO_MAX
if no maximum.public Job getMonitorJob()
public java.lang.String getName()
public ObjectDescription getObjectDescription()
public java.lang.String getPath()
public SystemPool getPool(int sequenceNumber)
sequenceNumber
- The number of the pool, within the pool list for the subsystem. Valid values are 1-10.public SystemPool[] getPools()
public java.lang.String getStatus()
public AS400 getSystem()
public static Subsystem[] listAllSubsystems(AS400 system) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, RequestNotSupportedException
system
- AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.RequestNotSupportedException
- If the requested function is not supported because the system is not at the correct level.public void refresh() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void removePool(int sequenceNumber) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
sequenceNumber
- The number of the pool, within the pool list for the subsystem. Valid values are 1-10.AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public void start() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.