public class HistoryLog
extends java.lang.Object
close()
method should be called when you are finished retrieving messages from the list.
Note: The System API this class uses is NOT available when connecting to V5R4 or earlier systems.
QueuedMessage objects have many attributes. Only some of these attribute values are set, depending on how a QueuedMessage object is created. The following is a list of attributes whose values are set on QueuedMessage objects returned in a list of history log messages:
QueuedMessage
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AVAIL
Constant indicating that any logged data that is available for the specified dates should be listed.
|
static java.lang.String |
BEGIN
Constant indicating to list data logged from the beginning of the log.
|
static java.lang.String |
CURRENT_DATE
Constant indicating the current date.
|
static java.lang.String |
END
Constant indicating the last day on which data was logged is the last day for which logged
data is listed.
|
static int |
OMIT
Constant indicating that the message IDs in the list are to be omitted.
|
static int |
SELECT
Constant indicating that the message IDs in the list are to be selected.
|
static java.lang.String |
TYPE_COMPLETION
Message type for completion messages.
|
static java.lang.String |
TYPE_COPY
Message type for copy messages.
|
static java.lang.String |
TYPE_DIAGNOSTIC
Message type for diagnostic messages.
|
static java.lang.String |
TYPE_ESCAPE
Message type for escape messages.
|
static java.lang.String |
TYPE_INFORMATIONAL
Message type for informational messages.
|
static java.lang.String |
TYPE_INQUIRY
Message type for inquiry messages.
|
static java.lang.String |
TYPE_NOTIFY
Message type for notify messages.
|
static java.lang.String |
TYPE_REPLY
Message type for reply messages.
|
static java.lang.String |
TYPE_REQUEST
Message type for request messages.
|
Constructor and Description |
---|
HistoryLog(AS400 system)
Constructs a HistoryLog object for the specified system.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the message list on the system.
|
protected void |
finalize()
Closes the list on the system when this object is garbage collected.
|
java.util.Date |
getEndingDate()
Returns the ending date for messages and jobs to be listed.
|
Job[] |
getJobs()
Returns the list of jobs used to filter which messages in the log are listed.
|
int |
getLength()
Returns the number of messages in the history log.
|
java.lang.String[] |
getMessageIDs()
Returns the list of message ids used to filter which messages in the log are listed.
|
int |
getMessageIDsListIndicator()
Returns the list indicator indicating if the message ids in the list are omitted or selected.
|
java.util.Enumeration |
getMessages()
Returns the list of messages in the history log.
|
QueuedMessage[] |
getMessages(int listOffset,
int number)
Returns a subset of the list of messages in the history log.
|
int |
getMessageSeverity()
Returns the minimum severity of the messages to be listed.
|
int |
getMessageTypeListIndicator()
Returns the list indicator indicating if the message types in the list should
be omitted or selected.
|
java.lang.String[] |
getMessageTypes()
Returns the message types to be selected or omitted from the list.
|
java.util.Date |
getStartingDate()
Returns the starting date for messages and jobs to be listed.
|
AS400 |
getSystem()
Returns the system object representing the system on which the history log exists.
|
void |
load()
Loads the list of messages on the system.
|
void |
setEndingDate(java.util.Date date)
Specifies the end date and time for messages and jobs to be listed.
|
void |
setEndingDate(java.lang.String date,
java.lang.String time)
Specifies the ending date and time for messages and jobs to be listed.
|
void |
setJobs(Job[] jobs)
Specifies the specific jobs (if any) for which messages in the log are listed.
|
void |
setMessageIDs(java.lang.String[] ids)
Specifies the specific messaged IDs to be retrieved or omitted.
|
void |
setMessageIDsListIndicator(int indicator)
Specifies if the message IDs in the list are to be omitted or selected.
|
void |
setMessageSeverity(int severity)
The minimum severity of the messages to be listed.
|
void |
setMessageTypeListIndicator(int indicator)
Specifies if the message types in the list are to be omitted or selected.
|
void |
setMessageTypes(java.lang.String[] types)
Specifies the specific message types to be retrieved or omitted.
|
void |
setStartingDate(java.util.Date date)
Specifies the starting date and time for messages and jobs to be listed.
|
void |
setStartingDate(java.lang.String date,
java.lang.String time)
Specifies the starting date and time for messages and jobs to be listed.
|
public static final java.lang.String CURRENT_DATE
public static final java.lang.String BEGIN
public static final java.lang.String END
public static final java.lang.String AVAIL
public static final int OMIT
public static final int SELECT
public static final java.lang.String TYPE_COMPLETION
public static final java.lang.String TYPE_COPY
public static final java.lang.String TYPE_DIAGNOSTIC
public static final java.lang.String TYPE_ESCAPE
public static final java.lang.String TYPE_INFORMATIONAL
public static final java.lang.String TYPE_INQUIRY
public static final java.lang.String TYPE_NOTIFY
public static final java.lang.String TYPE_REPLY
public static final java.lang.String TYPE_REQUEST
public HistoryLog(AS400 system)
system
- The system object representing the system on which the history log exists.public void close() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system.public int getLength() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
load()
.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system or when running to V5R4 or an earlier release.load()
public java.util.Enumeration getMessages() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system or when running to V5R4 or an earlier release.public QueuedMessage[] getMessages(int listOffset, int number) throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
load()
is made (either implicitly or explicitly), then the messages at a given list 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 starting offset in the list of messages (0-based). This value must be greater than or equal to 0 and less than the list length; or specify -1 to retrieve all of the messages.
Note: Prior to JTOpen 7.2, this parameter was incorrectly described.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.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system, or when running to V5R4 or an earlier release.QueuedMessage
public AS400 getSystem()
public void load() throws AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.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.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist on the system or when running to V5R4 or an earlier release.getLength()
public void setStartingDate(java.lang.String date, java.lang.String time) throws ExtendedIllegalArgumentException
date
- The starting date.
Valid values include:
CURRENT_DATE
(default)BEGIN
time
- The starting time.
Valid values include:
AVAIL
(default)
ExtendedIllegalArgumentException
- if the date is not in a valid format.public void setStartingDate(java.util.Date date) throws ExtendedIllegalArgumentException
date
- The starting date.ExtendedIllegalArgumentException
- if the date is not valid.public java.util.Date getStartingDate()
public void setEndingDate(java.lang.String date, java.lang.String time) throws ExtendedIllegalArgumentException
date
- The ending date.
Valid values include:
CURRENT_DATE
END
(default)time
- The ending time.
Valid values include:
AVAIL
(default)
ExtendedIllegalArgumentException
- if the date is not in a valid format.public void setEndingDate(java.util.Date date) throws ExtendedIllegalArgumentException
date
- The ending date.ExtendedIllegalArgumentException
- if the date is not valid.public java.util.Date getEndingDate()
public void setMessageIDs(java.lang.String[] ids) throws ExtendedIllegalArgumentException
ids
- The message IDs.ExtendedIllegalArgumentException
- if more than 100 message IDs are specified, or if
a message ID is more than 7 characters.public java.lang.String[] getMessageIDs()
public void setMessageIDsListIndicator(int indicator) throws ExtendedIllegalArgumentException
indicator
- The indicator.
Valid values are:
ExtendedIllegalArgumentException
- If an argument is illegal.public int getMessageIDsListIndicator()
public void setMessageTypeListIndicator(int indicator) throws ExtendedIllegalArgumentException
indicator
- The indicator.
Valid values are:
ExtendedIllegalArgumentException
- If an argument is illegal.public int getMessageTypeListIndicator()
public void setMessageTypes(java.lang.String[] types) throws ExtendedIllegalArgumentException
types
- The message types to be retrieved or omitted. Valid values are:
ExtendedIllegalArgumentException
- If an argument is illegal.public java.lang.String[] getMessageTypes()
public void setMessageSeverity(int severity) throws ExtendedIllegalArgumentException
severity
- The minumum severity of the messages to be listed. The default is zero.ExtendedIllegalArgumentException
- If an argument is illegal.public int getMessageSeverity()
public void setJobs(Job[] jobs) throws ExtendedIllegalArgumentException
jobs
- The list of jobs.ExtendedIllegalArgumentException
- if the number of jobs is greater than fivepublic Job[] getJobs()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable