com.ibm.as400.resource
Class RJobLog

java.lang.Object
  extended bycom.ibm.as400.resource.ResourceList
      extended bycom.ibm.as400.resource.BufferedResourceList
          extended bycom.ibm.as400.resource.SystemResourceList
              extended bycom.ibm.as400.resource.RJobLog
All Implemented Interfaces:
Serializable

Deprecated. Use JobLog 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() 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();

See Also:
RQueuedMessage, Serialized Form

Field Summary
static 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 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 String PREVIOUS
          Deprecated. Constant referring to the previous message in the job log.
static String STARTING_MESSAGE_KEY
          Deprecated. Selection ID for starting message key.
 
Constructor Summary
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, String name, String user, String number)
          Deprecated. Constructs an RJobLog object.
 
Method Summary
protected  void establishConnection()
          Deprecated. Establishes the connection to the system.
 byte[] getInternalJobID()
          Deprecated. Returns the internal job identifier.
 String getName()
          Deprecated. Returns the job name.
 String getNumber()
          Deprecated. Returns the job number.
 String getUser()
          Deprecated. Returns the user name.
 void setInternalJobID(byte[] internalJobID)
          Deprecated. Sets the internal job identifier.
 void setName(String name)
          Deprecated. Sets the job name.
 void setNumber(String number)
          Deprecated. Sets the job number.
 void setUser(String user)
          Deprecated. Sets the user name.
static void writeMessage(AS400 system, 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, 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, String messageID, int messageType, 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, String messageID, int messageType, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 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 String PREVIOUS
Deprecated. 
Constant referring to the previous message in the job log.

See Also:
Constant Field Values

LIST_DIRECTION

public static final 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 the STARTING_MESSAGE_KEY selection. Possible values are: The default is NEXT.

See Also:
Constant Field Values

STARTING_MESSAGE_KEY

public static final 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,
               String name,
               String user,
               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 class ResourceList
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 String getName()
Deprecated. 
Returns the job name.

Returns:
The job name, or "*" if none has been set.

getNumber

public String getNumber()
Deprecated. 
Returns the job number.

Returns:
The job number, or "" if none has been set.

getUser

public String getUser()
Deprecated. 
Returns the user name.

Returns:
The user name, or "" if none has been set.

setInternalJobID

public void setInternalJobID(byte[] internalJobID)
                      throws 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:
PropertyVetoException - If the property change is vetoed.

setName

public void setName(String name)
             throws 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:
PropertyVetoException - If the change is vetoed.

setNumber

public void setNumber(String number)
               throws 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:
PropertyVetoException - If the change is vetoed.

setUser

public void setUser(String user)
             throws 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:
PropertyVetoException - If the change is vetoed.

writeMessage

public static void writeMessage(AS400 system,
                                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,
                                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,
                                String messageID,
                                int messageType,
                                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,
                                String messageID,
                                int messageType,
                                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()