com.ibm.as400.access
Class JobQueue
- java.lang.Object
-
- com.ibm.as400.access.JobQueue
-
- All Implemented Interfaces:
- java.io.Serializable
public class JobQueue extends java.lang.Object implements java.io.Serializable
Represents an IBM i job queue. Note that calling any of the attribute getters for the first time will result in an implicit call torefresh()
. If any exception is thrown by an implicit call to refresh(), it will be logged toTrace.ERROR
and rethrown as a java.lang.RuntimeException. However, should an exception occur during an explicit call to refresh(), the exception will be thrown as-is to the caller. Implementation note: This class internally calls the Retrieve Job Queue(QSPRJOBQ) API.- Author:
- zhangze
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description JobQueue(AS400 system, QSYSObjectPathName path)
Constructs a JobQueue.JobQueue(AS400 system, java.lang.String library, java.lang.String name)
Constructs a JobQueue.
-
Method Summary
Methods Modifier and Type Method and Description boolean
exists()
Determines if the subsystem currently exists on the system.java.lang.String
getAuthorityCheck()
Whether the user must be the owner of the queue in order to control the queue by holding or releasing the queueint
getCurrentActive()
Return The current number of jobs that are active that came through this job queue entryjava.lang.String
getJobQLibrary()
Return the library containing the job queue.java.lang.String
getJobQName()
Return the job queue namejava.lang.String
getJobQueueStatus()
Return The status of the job queueint
getMaxActive()
Return The maximum number of jobs that can be active at the same time through this job queue entry.int
getNumberOfJobs()
Return The number of jobs in the queueObjectDescription
getObjectDescription()
Returns an ObjectDescription instance representing the subsystem.java.lang.String
getOperatorControlled()
Return Whether a user who has job control authority is allowed to control this job queue and manage the jobs on the queue.int
getSequenceNumber()
Return The job queue entry sequence numberjava.lang.String
getSubsystemLibrary()
Return The library in which the subsystem description residesjava.lang.String
getSubsystemName()
Return The name of the subsystem that can receive jobs from this job queuejava.lang.String
getTextDescription()
Return Text that briefly describes the job queuevoid
refresh()
Refreshes the values for all attributes of the job queue.void
setFormat(java.lang.String format)
Set retrieve Job Queue formatvoid
setLibraryName(java.lang.String library)
Sets the job queue library.void
setName(java.lang.String name)
Sets the job queue name.void
setSystem(AS400 system)
Sets the system.
-
-
-
Constructor Detail
-
JobQueue
public JobQueue(AS400 system, java.lang.String library, java.lang.String name)
Constructs a JobQueue.- Parameters:
system
- The system where the job queue resides.library
- library The library containing the job queue.name
- name The name of the job queue to retrieve.
-
JobQueue
public JobQueue(AS400 system, QSYSObjectPathName path)
Constructs a JobQueue.- Parameters:
system
- The system where the job queue resides.path
- path The fully qualified IFS path to the job queue.
-
-
Method Detail
-
refresh
public void refresh() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, ObjectDoesNotExistException, java.io.IOException
Refreshes the values for all attributes of the job queue.- Throws:
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.ObjectDoesNotExistException
- If the object does not exist on the system.java.io.IOException
- If an error occurs while communicating with the system.
-
getJobQName
public java.lang.String getJobQName()
Return the job queue name- Returns:
- the job queue name
-
getJobQLibrary
public java.lang.String getJobQLibrary()
Return the library containing the job queue.- Returns:
- the library containing the job queue.
-
getSubsystemName
public java.lang.String getSubsystemName()
Return The name of the subsystem that can receive jobs from this job queue- Returns:
- The name of the subsystem that can receive jobs from this job queue
-
getSubsystemLibrary
public java.lang.String getSubsystemLibrary()
Return The library in which the subsystem description resides- Returns:
- The library in which the subsystem description resides
-
getOperatorControlled
public java.lang.String getOperatorControlled()
Return Whether a user who has job control authority is allowed to control this job queue and manage the jobs on the queue.- Returns:
- Whether a user who has job control authority is allowed to control this job queue and manage the jobs on the queue. The possible values are: *YES *NO
-
getAuthorityCheck
public java.lang.String getAuthorityCheck()
Whether the user must be the owner of the queue in order to control the queue by holding or releasing the queue- Returns:
- Whether the user must be the owner of the queue in order to control the queue by holding or releasing the queue The possible values are: *OWNER *DTAAUT
-
getNumberOfJobs
public int getNumberOfJobs()
Return The number of jobs in the queue- Returns:
- The number of jobs in the queue
-
getJobQueueStatus
public java.lang.String getJobQueueStatus()
Return The status of the job queue- Returns:
- The status of the job queue The possible values are: RELEASED HELD
-
getTextDescription
public java.lang.String getTextDescription()
Return Text that briefly describes the job queue- Returns:
- Text that briefly describes the job queue
-
getSequenceNumber
public int getSequenceNumber()
Return The job queue entry sequence number- Returns:
- The job queue entry sequence number
-
getMaxActive
public int getMaxActive()
Return The maximum number of jobs that can be active at the same time through this job queue entry. A -1 in this field indicates that the value is *NOMAX.- Returns:
- The maximum number of jobs that can be active at the same time through this job queue entry
-
getCurrentActive
public int getCurrentActive()
Return The current number of jobs that are active that came through this job queue entry- Returns:
- The current number of jobs that are active that came through this job queue entry
-
setSystem
public void setSystem(AS400 system)
Sets the system. Cannot be changed after the object has established a connection to the system.- Parameters:
system
- The system where the job queue resides.
-
setName
public void setName(java.lang.String name)
Sets the job queue name. Cannot be changed after the object has established a connection to the system.- Parameters:
name
- the job queue name
-
setLibraryName
public void setLibraryName(java.lang.String library)
Sets the job queue library. Cannot be changed after the object has established a connection to the system.- Parameters:
name
- the job queue library
-
setFormat
public void setFormat(java.lang.String format)
Set retrieve Job Queue format- Parameters:
format
- The possible values are:- "JOBQ0100" format
- "JOBQ0200" format
-
exists
public boolean exists() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
Determines if the subsystem currently exists on the system.
More precisely, this method reports if the subsystem description exists on the system.- Returns:
- true if the subsystem exists; false if the subsystem does not exist.
- Throws:
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.
-
getObjectDescription
public ObjectDescription getObjectDescription()
Returns an ObjectDescription instance representing the subsystem.- Returns:
- An ObjectDescription for the subsystem.
-
-