|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.access.HistoryLog
public class HistoryLog extends Object
Represents a history log on the system. This class is used to get a list of messages in a history log.
The 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 theses 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 String |
AVAIL
Constant indicating that any logged data that is available for the specified dates should be listed. |
static String |
BEGIN
Constant indicating to list data logged from the beginning of the log. |
static String |
CURRENT_DATE
Constant indicating the current date. |
static 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 String |
TYPE_COMPLETION
Message type for completion messages. |
static String |
TYPE_COPY
Message type for copy messages. |
static String |
TYPE_DIAGNOSTIC
Message type for diagnostic messages. |
static String |
TYPE_ESCAPE
Message type for escape messages. |
static String |
TYPE_INFORMATIONAL
Message type for informational messages. |
static String |
TYPE_INQUIRY
Message type for inquiry messages. |
static String |
TYPE_NOTIFY
Message type for notify messages. |
static String |
TYPE_REPLY
Message type for reply messages. |
static 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. |
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. |
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. |
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. |
String[] |
getMessageTypes()
Returns the message types to be selected or omitted from the list. |
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(Date date)
Specifies the end date and time for messages and jobs to be listed. |
void |
setEndingDate(String date,
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(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(String[] types)
Specifies the specific message types to be retrieved or omitted. |
void |
setStartingDate(Date date)
Specifies the starting date and time for messages and jobs to be listed. |
void |
setStartingDate(String date,
String time)
Specifies the starting date and time for messages and jobs to be listed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CURRENT_DATE
public static final String BEGIN
public static final String END
public static final String AVAIL
public static final int OMIT
public static final int SELECT
public static final String TYPE_COMPLETION
public static final String TYPE_COPY
public static final String TYPE_DIAGNOSTIC
public static final String TYPE_ESCAPE
public static final String TYPE_INFORMATIONAL
public static final String TYPE_INQUIRY
public static final String TYPE_NOTIFY
public static final String TYPE_REPLY
public static final String TYPE_REQUEST
Constructor Detail |
---|
public HistoryLog(AS400 system)
system
- The system object representing the system on which the history log exists.Method Detail |
---|
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() throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
load()
.
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 or when running to V5R4 or an earlier release.load()
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 or when running to V5R4 or an earlier release.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, or when running to V5R4 or an earlier release.QueuedMessage
public AS400 getSystem()
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 or when running to V5R4 or an earlier release.getLength()
public void setStartingDate(String date, 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(Date date) throws ExtendedIllegalArgumentException
date
- The starting date.ExtendedIllegalArgumentException
- if the date is not valid.public Date getStartingDate()
public void setEndingDate(String date, 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(Date date) throws ExtendedIllegalArgumentException
date
- The ending date.ExtendedIllegalArgumentException
- if the date is not valid.public Date getEndingDate()
public void setMessageIDs(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 String[] getMessageIDs()
public void setMessageIDsListIndicator(int indicator) throws ExtendedIllegalArgumentException
public int getMessageIDsListIndicator()
public void setMessageTypeListIndicator(int indicator) throws ExtendedIllegalArgumentException
public int getMessageTypeListIndicator()
public void setMessageTypes(String[] types) throws ExtendedIllegalArgumentException
types
- The message types to be retrieved or omitted. Valid values are:
ExtendedIllegalArgumentException
public String[] getMessageTypes()
public void setMessageSeverity(int severity) throws ExtendedIllegalArgumentException
severity
- The minumum severity of the messages to be listed. The default is zero.ExtendedIllegalArgumentException
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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |