Class RJobLog
- java.lang.Object
-
- com.ibm.as400.resource.ResourceList
-
- com.ibm.as400.resource.BufferedResourceList
-
- com.ibm.as400.resource.SystemResourceList
-
- com.ibm.as400.resource.RJobLog
-
- All Implemented Interfaces:
- java.io.Serializable
Deprecated.UseJobLog
instead, as this package may be removed in the future.
public class RJobLog extends SystemResourceList
The RJobLog class represents a 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()
andsetSelectionValue()
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();- See Also:
RQueuedMessage
, Serialized Form
-
-
Field Summary
Fields Modifier 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 Summary
Constructors 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.
-
Method Summary
Methods 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.-
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 com.ibm.as400.resource.ResourceList
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
-
-
-
-
Field Detail
-
NEWEST
public static final byte[] NEWEST
Deprecated.Constant referring to the message key for the newest message in the job log.
-
NEXT
public static final java.lang.String NEXT
Deprecated.Constant referring to the next message in the job log.- See Also:
- Constant Field Values
-
OLDEST
public static final byte[] OLDEST
Deprecated.Constant referring to the message key for the oldest message in the job log.
-
PREVIOUS
public static final java.lang.String PREVIOUS
Deprecated.Constant referring to the previous message in the job log.- See Also:
- Constant Field Values
-
LIST_DIRECTION
public static final java.lang.String LIST_DIRECTION
Deprecated.Selection ID for list direction. This identifies a String selection, which represents the direction to list messages relative to the values specified for theSTARTING_MESSAGE_KEY
selection. Possible values are: The default is NEXT.- See Also:
- Constant Field Values
-
STARTING_MESSAGE_KEY
public static final java.lang.String STARTING_MESSAGE_KEY
Deprecated.Selection ID for starting message key. This identifies a byte[] selection, which represents the message key used to begin searching for messages to list from the corresponding entry in the message queue. Possible values are: The default is OLDEST.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RJobLog
public RJobLog()
Deprecated.Constructs an RJobLog object.
-
RJobLog
public RJobLog(AS400 system)
Deprecated.Constructs an RJobLog object.- Parameters:
system
- The system.
-
RJobLog
public RJobLog(AS400 system, java.lang.String name, java.lang.String user, java.lang.String number)
Deprecated.Constructs an RJobLog object.- Parameters:
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 "*".
-
RJobLog
public RJobLog(AS400 system, byte[] internalJobID)
Deprecated.Constructs an RJobLog object. This sets the job name to "*INT".- Parameters:
system
- The system.internalJobID
- The internal job identifier.
-
-
Method Detail
-
establishConnection
protected void establishConnection() throws ResourceException
Deprecated.Establishes the connection to the system.The method is called by the resource framework automatically when the connection needs to be established.
- Overrides:
establishConnection
in classResourceList
- Throws:
ResourceException
- If an error occurs.
-
getInternalJobID
public byte[] getInternalJobID()
Deprecated.Returns the internal job identifier.- Returns:
- The internal job identifier, or null if none has been set.
-
getName
public java.lang.String getName()
Deprecated.Returns the job name.- Returns:
- The job name, or "*" if none has been set.
-
getNumber
public java.lang.String getNumber()
Deprecated.Returns the job number.- Returns:
- The job number, or "" if none has been set.
-
getUser
public java.lang.String getUser()
Deprecated.Returns the user name.- Returns:
- The user name, or "" if none has been set.
-
setInternalJobID
public void setInternalJobID(byte[] internalJobID) throws java.beans.PropertyVetoException
Deprecated.Sets the internal job identifier. The job name must be set to "*INT" for this to be recognized. This cannot be changed if the object has established a connection to the system.- Parameters:
internalJobID
- The internal job identifier.- Throws:
java.beans.PropertyVetoException
- If the property change is vetoed.
-
setName
public void setName(java.lang.String name) throws java.beans.PropertyVetoException
Deprecated.Sets the job name. This cannot be changed if the object has established a connection to the system.- Parameters:
name
- The job name.- Throws:
java.beans.PropertyVetoException
- If the change is vetoed.
-
setNumber
public void setNumber(java.lang.String number) throws java.beans.PropertyVetoException
Deprecated.Sets the job number. This cannot be changed if the object has established a connection to the system.- Parameters:
number
- The job number.- Throws:
java.beans.PropertyVetoException
- If the change is vetoed.
-
setUser
public void setUser(java.lang.String user) throws java.beans.PropertyVetoException
Deprecated.Sets the user name. This cannot be changed if the object has established a connection to the system.- Parameters:
user
- The user name.- Throws:
java.beans.PropertyVetoException
- If the change is vetoed.
-
writeMessage
public static void writeMessage(AS400 system, java.lang.String messageID, int messageType) throws ResourceException
Deprecated.Writes a program message to the job log for the job in which the program is running.
Note: The program runs in the job of the Remote Command Host Server (QZRCSRVS) unless it is invoked "on-thread" on the i5/OS system.- Parameters:
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.- Throws:
ResourceException
- If an error occurs.- See Also:
ProgramCall.isStayOnThread()
-
writeMessage
public static void writeMessage(AS400 system, java.lang.String messageID, int messageType, byte[] substitutionData) throws ResourceException
Deprecated.Writes a program message to the job log for the job in which the program is running.
Note: The program runs in the job of the Remote Command Host Server (QZRCSRVS) unless it is invoked "on-thread" on the i5/OS system.- Parameters:
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.- Throws:
ResourceException
- If an error occurs.- See Also:
ProgramCall.isStayOnThread()
-
writeMessage
public static void writeMessage(AS400 system, java.lang.String messageID, int messageType, java.lang.String messageFile) throws ResourceException
Deprecated.Writes a program message to the job log for the job in which the program is running.
Note: The program runs in the job of the Remote Command Host Server (QZRCSRVS) unless it is invoked "on-thread" on the i5/OS system.- Parameters:
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.- Throws:
ResourceException
- If an error occurs.- See Also:
ProgramCall.isStayOnThread()
-
writeMessage
public static void writeMessage(AS400 system, java.lang.String messageID, int messageType, java.lang.String messageFile, byte[] substitutionData) throws ResourceException
Deprecated.Writes a program message to the job log for the job in which the program is running.
Note: The program runs in the job of the Remote Command Host Server (QZRCSRVS) unless it is invoked "on-thread" on the i5/OS system.- Parameters:
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.- Throws:
ResourceException
- If an error occurs.- See Also:
ProgramCall.isStayOnThread()
-
-