JobLog
instead, as this package may be removed in the future.public class RJobLog extends SystemResourceList
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:
DATE_SENT
DEFAULT_REPLY
MESSAGE_FILE
MESSAGE_HELP
MESSAGE_ID
MESSAGE_KEY
MESSAGE_SEVERITY
MESSAGE_TEXT
MESSAGE_TYPE
REPLY_STATUS
SENDER_JOB_NAME
SENDER_JOB_NUMBER
SENDER_USER_NAME
SENDING_PROGRAM_NAME
// 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 FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
LIST_DIRECTION
Deprecated.
Selection ID for list direction.
|
static byte[] |
NEWEST
Deprecated.
Constant referring to the message key for the newest message in the job log.
|
static java.lang.String |
NEXT
Deprecated.
Constant referring to the next message in the job log.
|
static byte[] |
OLDEST
Deprecated.
Constant referring to the message key for the oldest message in the job log.
|
static java.lang.String |
PREVIOUS
Deprecated.
Constant referring to the previous message in the job log.
|
static java.lang.String |
STARTING_MESSAGE_KEY
Deprecated.
Selection ID for starting message key.
|
Constructor and Description |
---|
RJobLog()
Deprecated.
Constructs an RJobLog object.
|
RJobLog(AS400 system)
Deprecated.
Constructs an RJobLog object.
|
RJobLog(AS400 system,
byte[] internalJobID)
Deprecated.
Constructs an RJobLog object.
|
RJobLog(AS400 system,
java.lang.String name,
java.lang.String user,
java.lang.String number)
Deprecated.
Constructs an RJobLog object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
establishConnection()
Deprecated.
Establishes the connection to the system.
|
byte[] |
getInternalJobID()
Deprecated.
Returns the internal job identifier.
|
java.lang.String |
getName()
Deprecated.
Returns the job name.
|
java.lang.String |
getNumber()
Deprecated.
Returns the job number.
|
java.lang.String |
getUser()
Deprecated.
Returns the user name.
|
void |
setInternalJobID(byte[] internalJobID)
Deprecated.
Sets the internal job identifier.
|
void |
setName(java.lang.String name)
Deprecated.
Sets the job name.
|
void |
setNumber(java.lang.String number)
Deprecated.
Sets the job number.
|
void |
setUser(java.lang.String user)
Deprecated.
Sets the user name.
|
static void |
writeMessage(AS400 system,
java.lang.String messageID,
int messageType)
Deprecated.
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)
Deprecated.
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)
Deprecated.
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)
Deprecated.
Writes a program message to the job log for the job in which the program is running.
|
close, isBidiEnabled, isResourceAvailable, open, refreshContents, refreshStatus, resourceAt, setSelectionValue, waitForComplete, waitForResource
fireResourceAdded, getNumberOfPages, getPageSize, setNumberOfPages, setPageSize
addActiveStatusListener, addPropertyChangeListener, addResourceListListener, addVetoableChangeListener, arePropertiesFrozen, fireBusy, fireIdle, fireLengthChanged, fireListClosed, fireListCompleted, fireListInError, fireListOpened, firePropertyChange, fireVetoableChange, freezeProperties, getAttributeMetaData, getAttributeMetaData, getListLength, getPresentation, getSelectionMetaData, getSelectionMetaData, getSelectionValue, getSelectionValue, getSortMetaData, getSortMetaData, getSortOrder, getSortValue, getSystem, isComplete, isConnectionEstablished, isInError, isOpen, removeActiveStatusListener, removePropertyChangeListener, removeResourceListListener, removeVetoableChangeListener, resources, setAttributeMetaData, setPresentation, setSelectionValue, setSortOrder, setSortValue, setSystem, toString
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
STARTING_MESSAGE_KEY
selection. Possible values are:
The default is NEXT.public static final java.lang.String STARTING_MESSAGE_KEY
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.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()