|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.resource.ResourceList | +--com.ibm.as400.resource.BufferedResourceList | +--com.ibm.as400.resource.SystemResourceList | +--com.ibm.as400.resource.RJobLog
The RJobLog class represents an AS/400 job log. This is used
to get a list of messages in a job log or to write messages to a job log.
In order to access a job log, the system and either the job name, user name,
and job number or internal job identifier need to be set. A valid combination
of these must be set by getting any of the job log's messages.
If you do not specify any of the job name, user name, job number,
or internal job identifier, the default job is used.
The default job is the host server job for remote program calls.
The following selection IDs are supported:
Use one or more of these selection IDs with getSelectionValue() and setSelectionValue() to access the selection values for an RJobLog.
RJobLog objects generate RQueuedMessage objects. RQueuedMessage objects have many attributes. Only some of theses attribute values are set, depending on how an RQueuedMessage object is created. The following is a list of attribute IDs whose values are set on RQueuedMessage objects returned in a list of job log messages:
// Create an RJobLog object to represent a specific job log. AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD"); RJobLog jobLog = new RJobLog(system, "AJOBNAME", "AUSERID", "AJOBNUMBER");
// Set the selection so that the list of messages includes // only the newest message. jobLog.setSelectionValue(RJobLog.STARTING_MESSAGE_KEY, RJobLog.NEWEST);
// Open the list and wait for it to complete. jobLog.open(); jobLog.waitForComplete();
// Read and print the messages in the list. long numberOfMessages = jobLog.getListLength(); for(long i = 0; i < numberOfMessages; ++i) { RQueuedMessage queuedMessage = (RQueuedMessage)jobLog.resourceAt(i); System.out.println(queueMessage.getAttributeValue(RQueuedMessage.MESSAGE_TEXT)); }
// Close the list. jobLog.close();
RQueuedMessage
, Serialized FormField Summary | |
static java.lang.String |
LIST_DIRECTION
Selection ID for list direction. |
static byte[] |
NEWEST
Constant referring to the message key for the newest message in the job log. |
static java.lang.String |
NEXT
Constant referring to the next message in the job log. |
static byte[] |
OLDEST
Constant referring to the message key for the oldest message in the job log. |
static java.lang.String |
PREVIOUS
Constant referring to the previous message in the job log. |
static java.lang.String |
STARTING_MESSAGE_KEY
Selection ID for starting message key. |
Constructor Summary | |
RJobLog()
Constructs an RJobLog object. |
|
RJobLog(AS400 system)
Constructs an RJobLog object. |
|
RJobLog(AS400 system,
byte[] internalJobID)
Constructs an RJobLog object. |
|
RJobLog(AS400 system,
java.lang.String name,
java.lang.String user,
java.lang.String number)
Constructs an RJobLog object. |
Method Summary | |
protected void |
establishConnection()
Establishes the connection to the AS/400. |
byte[] |
getInternalJobID()
Returns the internal job identifier. |
java.lang.String |
getName()
Returns the job name. |
java.lang.String |
getNumber()
Returns the job number. |
java.lang.String |
getUser()
Returns the user name. |
void |
setInternalJobID(byte[] internalJobID)
Sets the internal job identifier. |
void |
setName(java.lang.String name)
Sets the job name. |
void |
setNumber(java.lang.String number)
Sets the job number. |
void |
setUser(java.lang.String user)
Sets the user name. |
static void |
writeMessage(AS400 system,
java.lang.String messageID,
int messageType)
Writes a program message to the job log for the job in which the program is running. |
static void |
writeMessage(AS400 system,
java.lang.String messageID,
int messageType,
byte[] substitutionData)
Writes a program message to the job log for the job in which the program is running. |
static void |
writeMessage(AS400 system,
java.lang.String messageID,
int messageType,
java.lang.String messageFile)
Writes a program message to the job log for the job in which the program is running. |
static void |
writeMessage(AS400 system,
java.lang.String messageID,
int messageType,
java.lang.String messageFile,
byte[] substitutionData)
Writes a program message to the job log for the job in which the program is running. |
Methods inherited from class com.ibm.as400.resource.SystemResourceList |
close, isBidiEnabled, isResourceAvailable, open, refreshContents, refreshStatus, resourceAt, setSelectionValue, waitForComplete, waitForResource |
Methods inherited from class com.ibm.as400.resource.BufferedResourceList |
fireResourceAdded, getNumberOfPages, getPageSize, setNumberOfPages, setPageSize |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte[] NEWEST
public static final java.lang.String NEXT
public static final byte[] OLDEST
public static final java.lang.String PREVIOUS
public static final java.lang.String LIST_DIRECTION
public static final java.lang.String STARTING_MESSAGE_KEY
Constructor Detail |
public RJobLog()
public RJobLog(AS400 system)
system
- The system.public RJobLog(AS400 system, java.lang.String name, java.lang.String user, java.lang.String number)
system
- The system.name
- The job name. Specify "*" to indicate the default job.user
- The user name. This must be blank if name is "*".number
- The job number. This must be blank if name is "*".public RJobLog(AS400 system, byte[] internalJobID)
system
- The system.internalJobID
- The internal job identifier.Method Detail |
protected void establishConnection() throws ResourceException
The method is called by the resource framework automatically when the connection needs to be established.
establishConnection
in class ResourceList
ResourceException
- If an error occurs.public byte[] getInternalJobID()
public java.lang.String getName()
public java.lang.String getNumber()
public java.lang.String getUser()
public void setInternalJobID(byte[] internalJobID) throws java.beans.PropertyVetoException
internalJobID
- The internal job identifier.java.beans.PropertyVetoException
- If the property change is vetoed.public void setName(java.lang.String name) throws java.beans.PropertyVetoException
name
- The job name.java.beans.PropertyVetoException
- If the change is vetoed.public void setNumber(java.lang.String number) throws java.beans.PropertyVetoException
number
- The job number.java.beans.PropertyVetoException
- If the change is vetoed.public void setUser(java.lang.String user) throws java.beans.PropertyVetoException
user
- The user name.java.beans.PropertyVetoException
- If the change is vetoed.public static void writeMessage(AS400 system, java.lang.String messageID, int messageType) throws ResourceException
system
- The system. If the system specifies localhost, the message is written
to the job log of the process from which this method is called.
Otherwise the message is written to the QZRCSRVS job.messageID
- The message ID. The message must be in the default message file
/QSYS.LIB/QCPFMSG.MSGF.messageType
- The message type. Possible values are:
The message type must be AS400Message.INFORMATIONAL for an immediate
message.ResourceException
- If an error occurs.ProgramCall.isStayOnThread()
public static void writeMessage(AS400 system, java.lang.String messageID, int messageType, byte[] substitutionData) throws ResourceException
system
- The system. If the system specifies localhost, the message is written
to the job log of the process from which this method is called.
Otherwise the message is written to the QZRCSRVS job.messageID
- The message ID. The message must be in the default message file
/QSYS.LIB/QCPFMSG.MSGF.messageType
- The message type. Possible values are:
The message type must be AS400Message.INFORMATIONAL for an immediate
message.substitutionData
- The substitution data. The substitution data can be from 0-32767 bytes
for a conventional message and from 1-6000 bytes for an immediate message.ResourceException
- If an error occurs.ProgramCall.isStayOnThread()
public static void writeMessage(AS400 system, java.lang.String messageID, int messageType, java.lang.String messageFile) throws ResourceException
system
- The system. If the system specifies localhost, the message is written
to the job log of the process from which this method is called.
Otherwise the message is written to the QZRCSRVS job.messageID
- The message ID.messageType
- The message type. Possible values are:
The message type must be AS400Message.INFORMATIONAL for an immediate
message.messageFile
- The integrated file system path name of the message file.ResourceException
- If an error occurs.ProgramCall.isStayOnThread()
public static void writeMessage(AS400 system, java.lang.String messageID, int messageType, java.lang.String messageFile, byte[] substitutionData) throws ResourceException
system
- The system. If the system specifies localhost, the message is written
to the job log of the process from which this method is called.
Otherwise the message is written to the QZRCSRVS job.messageID
- The message ID.messageType
- The message type. Possible values are:
The message type must be AS400Message.INFORMATIONAL for an immediate
message.messageFile
- The integrated file system path name of the message file.substitutionData
- The substitution data. The substitution data can be from 0-32767 bytes
for a conventional message and from 1-6000 bytes for an immediate message.ResourceException
- If an error occurs.ProgramCall.isStayOnThread()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |