|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.access.JobLog
public class JobLog extends Object implements Serializable
Represents a job log on the system. This class is used to get a list of messages in a job log or to write messages to a job log.
QueuedMessage objects have many attributes. Only some of theses attribute values are set, depending on how a QueuedMessage object is created. The following is a list of attributes whose values can be set on QueuedMessage objects returned in a list of job log messages:
QueuedMessage
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
ALERT_OPTION
|
static int |
CCSID_CONVERSION_STATUS_DATA
|
static int |
CCSID_CONVERSION_STATUS_TEXT
|
static int |
CCSID_FOR_DATA
|
static int |
CCSID_FOR_TEXT
|
static int |
DEFAULT_REPLY
|
static int |
MESSAGE
|
static int |
MESSAGE_FILE_LIBRARY_USED
|
static int |
MESSAGE_HELP
|
static int |
MESSAGE_HELP_WITH_FORMATTING_CHARACTERS
|
static int |
MESSAGE_HELP_WITH_REPLACEMENT_DATA
|
static int |
MESSAGE_HELP_WITH_REPLACEMENT_DATA_AND_FORMATTING_CHARACTERS
|
static int |
MESSAGE_WITH_REPLACEMENT_DATA
|
static int |
RECEIVING_MODULE_NAME
|
static int |
RECEIVING_PROCEDURE_NAME
|
static int |
RECEIVING_PROGRAM_NAME
|
static int |
RECEIVING_STATEMENT_NUMBERS
|
static int |
RECEIVING_TYPE
|
static int |
REPLACEMENT_DATA
|
static int |
REPLY_STATUS
|
static int |
REQUEST_LEVEL
|
static int |
REQUEST_STATUS
|
static int |
SENDER_TYPE
|
static int |
SENDING_MODULE_NAME
|
static int |
SENDING_PROCEDURE_NAME
|
static int |
SENDING_PROGRAM_NAME
|
static int |
SENDING_STATEMENT_NUMBERS
|
static int |
SENDING_USER_PROFILE
|
Constructor and Description |
---|
JobLog()
Constructs a JobLog object. |
JobLog(AS400 system)
Constructs a JobLog object. |
JobLog(AS400 system,
String name,
String user,
String number)
Constructs a JobLog object. |
Modifier and Type | Method and Description |
---|---|
void |
addAttributeToRetrieve(int attribute)
Adds a message attribute that will be retrieved for each joblog. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. |
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds a VetoableChangeListener. |
void |
clearAttributesToRetrieve()
Clears the message attributes to be retrieved for a given Joblog. |
void |
close()
Closes the message list on the system. |
int |
getLength()
Returns the number of messages in the job log. |
boolean |
getListDirection()
Returns the list direction. |
Enumeration |
getMessages()
Returns the list of messages in the job log. |
QueuedMessage[] |
getMessages(int listOffset,
int number)
Returns a subset of the list of messages in the job log. |
String |
getName()
Returns the job name. |
String |
getNumber()
Returns the job number. |
byte[] |
getStartingMessageKey()
Returns the starting message key. |
AS400 |
getSystem()
Returns the system object representing the system on which the job log exists. |
String |
getUser()
Returns the job user name. |
void |
load()
Loads the list of messages on the system. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener. |
void |
setListDirection(boolean listDirection)
Sets the list direction. |
void |
setName(String name)
Sets the job name. |
void |
setNumber(String number)
Sets the job number. |
void |
setStartingMessageKey(byte[] startingMessageKey)
Sets the message key used to begin searching for messages to list from the corresponding entry in the job log. |
void |
setSystem(AS400 system)
Sets the system. |
void |
setUser(String user)
Sets the job user name. |
static void |
writeMessage(AS400 system,
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,
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,
String messageID,
int messageType,
String messageFile)
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)
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,
boolean onThread)
Writes a program message to the job log for the job in which the program is running. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ALERT_OPTION
public static final int REPLACEMENT_DATA
public static final int MESSAGE
public static final int MESSAGE_WITH_REPLACEMENT_DATA
public static final int MESSAGE_HELP
public static final int MESSAGE_HELP_WITH_REPLACEMENT_DATA
public static final int MESSAGE_HELP_WITH_FORMATTING_CHARACTERS
public static final int MESSAGE_HELP_WITH_REPLACEMENT_DATA_AND_FORMATTING_CHARACTERS
public static final int DEFAULT_REPLY
public static final int SENDER_TYPE
public static final int SENDING_PROGRAM_NAME
public static final int SENDING_MODULE_NAME
public static final int SENDING_PROCEDURE_NAME
public static final int SENDING_STATEMENT_NUMBERS
public static final int SENDING_USER_PROFILE
public static final int RECEIVING_TYPE
public static final int RECEIVING_PROGRAM_NAME
public static final int RECEIVING_MODULE_NAME
public static final int RECEIVING_PROCEDURE_NAME
public static final int RECEIVING_STATEMENT_NUMBERS
public static final int MESSAGE_FILE_LIBRARY_USED
public static final int REPLY_STATUS
public static final int REQUEST_STATUS
public static final int REQUEST_LEVEL
public static final int CCSID_FOR_TEXT
public static final int CCSID_CONVERSION_STATUS_TEXT
public static final int CCSID_FOR_DATA
public static final int CCSID_CONVERSION_STATUS_DATA
Constructor Detail |
---|
public JobLog()
public JobLog(AS400 system)
system
- The system object representing the system on which the job log exists.public JobLog(AS400 system, String name, String user, String number)
system
- The system object representing the system on which the job log exists.name
- The job name.user
- The job user name.number
- The job number.Method Detail |
---|
public void addAttributeToRetrieve(int attribute) throws IOException
The list of message attributes is maintained internally even when this JobList is closed and re-used.
To start over with a new set of job attributes to retrieve,
call clearAttributesToRetrieve()
. This will set all attributes to null including the default attributes.
attribute
- The message attribute to retrieve. Possible values are all joblog attributes in the api document for the Open List of Job Log Messages (QGYOLJBL) API.IOException
public void clearAttributesToRetrieve()
addAttributeToRetrieve(int)
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The listener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener.removeVetoableChangeListener(java.beans.VetoableChangeListener)
public void close() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public int getLength()
load()
.
load()
public boolean getListDirection()
public Enumeration getMessages() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public QueuedMessage[] getMessages(int listOffset, int number) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
load()
is made (either implicitly or explicitly), then the messages at a given offset will change, so a subsequent call to getMessages() with the same listOffset and number will most likely not return the same QueuedMessages as the previous call.
listOffset
- The offset into the list of messages. This value must be greater than 0 and less than the list length, or specify -1 to retrieve all of the messages.number
- The number of messages to retrieve out of the list, starting at the specified listOffset. This value must be greater than or equal to 0 and less than or equal to the list length. If the listOffset is -1, this parameter is ignored.QueuedMessage
objects. The length of this array may not necessarily be equal to number, depending upon the size of the list on the system, and the specified listOffset.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.QueuedMessage
public String getName()
setName(java.lang.String)
public String getNumber()
setNumber(java.lang.String)
public byte[] getStartingMessageKey()
setStartingMessageKey(byte[])
public AS400 getSystem()
setSystem(com.ibm.as400.access.AS400)
public String getUser()
setUser(java.lang.String)
public void load() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
getMessages()
will retrieve the actual message information and attributes for each message in the list from the system.
This method updates the list length.
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.getLength()
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The listener object.public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- The listener object.public void setListDirection(boolean listDirection)
listDirection
- true to sort the messages oldest to newest; false to sort them newest to oldest. The default is true.public void setName(String name) throws PropertyVetoException
name
- The job name.PropertyVetoException
- If any of the registered listeners vetos the property change.public void setNumber(String number) throws PropertyVetoException
number
- The job number.PropertyVetoException
- If any of the registered listeners vetos the property change.public void setStartingMessageKey(byte[] startingMessageKey)
MessageQueue.OLDEST
and MessageQueue#NEWEST
.
startingMessageKey
- The key. Specify null to set it back to the default, which will be OLDEST or NEWEST based on the list direction.public void setSystem(AS400 system) throws PropertyVetoException
system
- The system object representing the system on which the job log exists.PropertyVetoException
- If any of the registered listeners vetos the property change.public void setUser(String user) throws PropertyVetoException
user
- The job user name.PropertyVetoException
- If any of the registered listeners vetos the property change.public static void writeMessage(AS400 system, String messageID, int messageType) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
system
- The system object representing the system on which the job log exists. 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:
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.ProgramCall.isStayOnThread()
public static void writeMessage(AS400 system, String messageID, int messageType, byte[] substitutionData) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
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:
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.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.ProgramCall.isStayOnThread()
public static void writeMessage(AS400 system, String messageID, int messageType, String messageFile) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
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:
messageFile
- The integrated file system path name of the message file.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.ProgramCall.isStayOnThread()
public static void writeMessage(AS400 system, String messageID, int messageType, String messageFile, byte[] substitutionData) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
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:
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.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.ProgramCall.isStayOnThread()
public static void writeMessage(AS400 system, String messageID, int messageType, String messageFile, byte[] substitutionData, boolean onThread) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
system
- The system. The system cannot be null.messageID
- The message ID. The message ID cannot be null.messageType
- The message type. Possible values are:
messageFile
- The integrated file system path name of the message file. If null is specified, the message file used is /QSYS.LIB/QCPFMSG.MSGF.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. If null is specified, no substitution data is used.onThread
- Whether or not to stay on thread when calling the API to write the message to the job log. true to write the message to the current job's job log, false to write the message to the Remote Command Host Server job's job log. Note that this parameter is meaningless unless this Java program is running on the system and the system object is using native optimizations.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.InterruptedException
- If this thread is interrupted.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.ProgramCall.isStayOnThread()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |