SystemStatus classes

The SystemStatus classes allow you to retrieve system status information and to retrieve and change system pool information.

The SystemStatus object allows you to retrieve system status information including the following:

  • getUsersCurrentSignedOn(): Returns the number of users currently signed on the system
  • getUsersTemporarilySignedOff(): Returns the number of interactive jobs that are disconnected
  • getDateAndTimeStatusGathered(): Returns the date and time when the system status information was gathered
  • getJobsInSystem(): Returns the total number of user and system jobs that are currently running
  • getBatchJobsRunning(): Returns the number of batch jobs currently running on the system
  • getBatchJobsEnding(): Returns the number of batch jobs that are in the process of ending
  • getSystemPools(): Returns an enumeration containing a SystemPool object for each system pool

In addition to the methods within the SystemStatus class, you also can access SystemPool through SystemStatus. SystemPool allows you to get information about system pools and change system pool information.

Example

Note: Read the Code example disclaimer for important legal information.

This example shows you how to use caching with the SystemStatus class:

AS400 system = new AS400("MyAS400");
SystemStatus status = new SystemStatus(system);

// Turn on caching. It is off by default.
status.setCaching(true); 

// This will retrieve the value from the system.
// Every subsequent call will use the cached value
// instead of retrieving it from the system.
int jobs = status.getJobsInSystem();


// ... Perform other operations here ...


// This determines if caching is still enabled.
if (status.isCaching())
{
  // This will retrieve the value from the cache.
  jobs = status.getJobsInSystem();
}

// Go to the system next time, regardless if caching is enabled.
status.refreshCache();

// This will retrieve the value from the system.
jobs = status.getJobsInSystem();

// Turn off caching. Every subsequent call will go to the system.
status.setCaching(false);

// This will retrieve the value from the system.
jobs = status.getJobsInSystem();