com.ibm.websphere.logging.hpel.reader
Class AbstractRemoteRepositoryReader
- java.lang.Object
-
- com.ibm.websphere.logging.hpel.reader.AbstractRemoteRepositoryReader
-
- All Implemented Interfaces:
- RepositoryReader
public abstract class AbstractRemoteRepositoryReader extends java.lang.Object implements RepositoryReader
Abstract implementation of the RepositoryReader for remote reading of log records. Extensions of this class need need to provide transportation of parameters and results over the wire. On the server side of the callreadLogLists(LogQueryBean, RepositoryPointer)
should result inRemoteResultCollector.getLogLists(LogQueryBean, RepositoryPointer)
to be called andreadLogRecords(RemoteInstanceDetails, RepositoryPointer, int, int, Locale)
- inRemoteResultCollector.getLogListForServerInstance(RemoteInstanceDetails, RepositoryPointer, int, int, Locale)
.
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
AbstractRemoteRepositoryReader(int maxRecords, java.util.Locale locale)
constructs instance returning log records translated into specified Locale and with a limit on number of records requested in each call to server.protected
AbstractRemoteRepositoryReader(java.util.Locale locale)
constructs instance returning log records translated into specified Locale.
-
Method Summary
Methods Modifier and Type Method and Description abstract java.io.File
generateLogOutput(LogQueryBean query, java.lang.String outputFileName, java.lang.String formatter)
ServerInstanceLogRecordList
getLogListForCurrentServerInstance()
returns log records from the repository that were created since the last server startup.ServerInstanceLogRecordList
getLogListForServerInstance(java.util.Date time)
returns log records from the repository of a server instance running at the time specified.ServerInstanceLogRecordList
getLogListForServerInstance(java.util.Date time, int threadID)
returns log records from the repository of a server instance running at a specified time created by the given thread.ServerInstanceLogRecordList
getLogListForServerInstance(java.util.Date time, java.util.logging.Level minLevel, java.util.logging.Level maxLevel)
returns log records from the repository of a server instance running at a specified time, within the level range as specified.ServerInstanceLogRecordList
getLogListForServerInstance(java.util.Date time, LogQueryBean query)
returns log records from the repository of a server instance running at a specified time, according to the criteria specified by the log query bean.ServerInstanceLogRecordList
getLogListForServerInstance(RepositoryPointer after)
returns log records from the repository that are beyond a given repository location as specified.ServerInstanceLogRecordList
getLogListForServerInstance(RepositoryPointer after, int threadID)
returns log records from the repository that are beyond a given repository location and created by a given thread as specified.ServerInstanceLogRecordList
getLogListForServerInstance(RepositoryPointer after, java.util.logging.Level minLevel, java.util.logging.Level maxLevel)
returns log records from the repository that are beyond a given repository location and within the level range as specified.ServerInstanceLogRecordList
getLogListForServerInstance(RepositoryPointer after, LogQueryBean query)
returns log records from the repository for one server instance that are beyond a given repository location, according to the criteria specified by the log query bean.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists()
returns all log records from the repository.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists(java.util.Date minTime, java.util.Date maxTime)
returns log records from the repository that are within the date range as specified.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists(java.util.logging.Level minLevel, java.util.logging.Level maxLevel)
returns log records from the repository that are within the level range as specified.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists(LogQueryBean query)
returns log records from the repository according to the criteria specified by the log query bean.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists(RepositoryPointer after)
returns all log records from the repository beyond a given repository location as specified.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists(RepositoryPointer after, java.util.Date maxTime)
returns log records from the repository that are beyond a given repository location and occurred before a given time as specified.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists(RepositoryPointer after, java.util.logging.Level minLevel, java.util.logging.Level maxLevel)
returns log records from the repository that are beyond a given repository location and within the level range as specified.java.lang.Iterable<ServerInstanceLogRecordList>
getLogLists(RepositoryPointer after, LogQueryBean query)
returns log records from the repository that are beyond a given repository location, according to the criteria specified by the log query bean.int
getMaxRecords()
Returns limit on records set for this instance.abstract RemoteAllResults
readLogLists(LogQueryBean query, RepositoryPointer after)
retrieves results for all server instances in the repository.abstract RemoteInstanceResult
readLogRecords(RemoteInstanceDetails indicator, RepositoryPointer after, int offset, int size, java.util.Locale locale)
retrieves records and header for one server instance.
-
-
-
Constructor Detail
-
AbstractRemoteRepositoryReader
protected AbstractRemoteRepositoryReader(java.util.Locale locale)
constructs instance returning log records translated into specified Locale.- Parameters:
locale
- language all records should be translated to.null
means not translation required.
-
AbstractRemoteRepositoryReader
protected AbstractRemoteRepositoryReader(int maxRecords, java.util.Locale locale)
constructs instance returning log records translated into specified Locale and with a limit on number of records requested in each call to server.- Parameters:
maxRecords
- limit on number of records in each requestlocale
- language all records should be translated to.null
means not translation required.
-
-
Method Detail
-
getMaxRecords
public int getMaxRecords()
Returns limit on records set for this instance.- Returns:
- maxRecords value
-
getLogListForCurrentServerInstance
public ServerInstanceLogRecordList getLogListForCurrentServerInstance() throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that were created since the last server startup.- Specified by:
getLogListForCurrentServerInstance
in interfaceRepositoryReader
- Returns:
- the iterable list of log records If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(java.util.Date time) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository of a server instance running at the time specified.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
time
-Date
value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this value- Returns:
- the iterable list of log records If no records meet the criteria, a list is returned with a null properties object and a null record list
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that are beyond a given repository location as specified. Callers need to invokeRepositoryLogRecordHeader.getRepositoryPointer()
to obtain the RepositoryPointer for a particular log record. The returned logs will be from one server instance.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start after- Returns:
- the iterable list of log records If no records meet the criteria, the list is empty.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(java.util.Date time, java.util.logging.Level minLevel, java.util.logging.Level maxLevel) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository of a server instance running at a specified time, within the level range as specified.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
time
-Date
value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this valueminLevel
- minimumLevel
that will be included in the returned listmaxLevel
- maximumLevel
that will be included in the returned list- Returns:
- the iterable list of log records If no records meet the criteria, the list is empty.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, java.util.logging.Level minLevel, java.util.logging.Level maxLevel) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that are beyond a given repository location and within the level range as specified. Callers need to invokeRepositoryLogRecordHeader.getRepositoryPointer()
to obtain the RepositoryPointer for a particular log record. The returned logs will be from one server instance.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start afterminLevel
- minimumLevel
that will be included in the returned listmaxLevel
- maximumLevel
that will be included in the returned list- Returns:
- the iterable list of log records If no records meet the criteria, the list is empty.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(java.util.Date time, int threadID) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository of a server instance running at a specified time created by the given thread.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
time
-Date
value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this valuethreadID
- ID of the thread that the returned records will match- Returns:
- the iterable list of log records If no records meet the criteria, the list is empty.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, int threadID) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that are beyond a given repository location and created by a given thread as specified. Callers need to invokeRepositoryLogRecordHeader.getRepositoryPointer()
to obtain the RepositoryPointer for a particular log record. The returned logs will be from one server instance.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start afterthreadID
- ID of the thread that the returned records will match- Returns:
- the iterable list of log records If no records meet the criteria, the list is empty.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(java.util.Date time, LogQueryBean query) throws LogRepositoryException
returns log records from the repository of a server instance running at a specified time, according to the criteria specified by the log query bean.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
time
-Date
value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this valuequery
-LogQueryBean
instance representing set of criteria each of which need to be met by the return records.- Returns:
- the iterable list of log records If no records meet the criteria, the list is empty.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.- See Also:
LogQueryBean
-
getLogListForServerInstance
public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, LogQueryBean query) throws LogRepositoryException
returns log records from the repository for one server instance that are beyond a given repository location, according to the criteria specified by the log query bean.- Specified by:
getLogListForServerInstance
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start afterquery
-LogQueryBean
instance representing set of criteria each of which need to be met by the return records.- Returns:
- the iterable list of log records If no records meet the criteria, the list is empty.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.- See Also:
LogQueryBean
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(LogQueryBean query) throws LogRepositoryException
returns log records from the repository according to the criteria specified by the log query bean.- Specified by:
getLogLists
in interfaceRepositoryReader
- Parameters:
query
-LogQueryBean
instance representing set of criteria each of which need to be met by the return records.- Returns:
- the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, LogQueryBean query) throws LogRepositoryException
returns log records from the repository that are beyond a given repository location, according to the criteria specified by the log query bean.- Specified by:
getLogLists
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start afterquery
-LogQueryBean
instance representing set of criteria each of which need to be met by the return records.- Returns:
- the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists() throws LogRepositoryException
Description copied from interface:RepositoryReader
returns all log records from the repository.- Specified by:
getLogLists
in interfaceRepositoryReader
- Returns:
- the iterable instance of a list of log records within a process
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns all log records from the repository beyond a given repository location as specified. Callers need to invokeRepositoryLogRecordHeader.getRepositoryPointer()
to obtain the RepositoryPointer for a particular log record.- Specified by:
getLogLists
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start after- Returns:
- the iterable instance of a list of log records within a process. If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(java.util.logging.Level minLevel, java.util.logging.Level maxLevel) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that are within the level range as specified.- Specified by:
getLogLists
in interfaceRepositoryReader
- Parameters:
minLevel
- minimumLevel
that will be included in the returned listmaxLevel
- maximumLevel
that will be included in the returned list- Returns:
- the iterable instance of a list of records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, java.util.logging.Level minLevel, java.util.logging.Level maxLevel) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that are beyond a given repository location and within the level range as specified. Callers need to invokeRepositoryLogRecordHeader.getRepositoryPointer()
to obtain the RepositoryPointer for a particular log record.- Specified by:
getLogLists
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start afterminLevel
- minimumLevel
that will be included in the returned listmaxLevel
- maximumLevel
that will be included in the returned list- Returns:
- the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(java.util.Date minTime, java.util.Date maxTime) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that are within the date range as specified. The parameters can be null to indicate an open ended range. For example, a caller may passnull
as the maxTime to indicate that the returned log records do not have to meet a maxTime criteria.- Specified by:
getLogLists
in interfaceRepositoryReader
- Parameters:
minTime
- minimumDate
value that will be included in the returned listmaxTime
- maximumDate
value that will be included in the returned list- Returns:
- the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
getLogLists
public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, java.util.Date maxTime) throws LogRepositoryException
Description copied from interface:RepositoryReader
returns log records from the repository that are beyond a given repository location and occurred before a given time as specified. Callers need to invokeRepositoryLogRecordHeader.getRepositoryPointer()
to obtain the RepositoryPointer for a particular log record.- Specified by:
getLogLists
in interfaceRepositoryReader
- Parameters:
after
- pointer to a record the list will start aftermaxTime
- maximumDate
value that will be included in the returned list- Returns:
- the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
readLogLists
public abstract RemoteAllResults readLogLists(LogQueryBean query, RepositoryPointer after) throws LogRepositoryException
retrieves results for all server instances in the repository. Implementation should usually result inRemoteResultCollector.getLogLists(LogQueryBean, RepositoryPointer)
to be invoked with the same parameters on the server side.- Parameters:
query
- log query bean indicatorafter
- reference point after which we need log records.- Returns:
- Set of all server instances satisfying the query request.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading list of instances from the server.
-
readLogRecords
public abstract RemoteInstanceResult readLogRecords(RemoteInstanceDetails indicator, RepositoryPointer after, int offset, int size, java.util.Locale locale) throws LogRepositoryException
retrieves records and header for one server instance. Implementation should usually result inRemoteResultCollector.getLogListForServerInstance(RemoteInstanceDetails, RepositoryPointer, int, int, Locale)
to be invoked with the same parameters on the server side.- Parameters:
indicator
- server instance identifier.after
- reference point after which we need log records.offset
- number of records to skip after the reference point.size
- maximum number of records to return.locale
- language records should be translated to in the result.null
means no translation required.- Returns:
- Set of instance log records satisfying the original query request.
- Throws:
LogRepositoryException
- indicating that an error occurred while reading records from the server.
-
generateLogOutput
public abstract java.io.File generateLogOutput(LogQueryBean query, java.lang.String outputFileName, java.lang.String formatter) throws LogRepositoryException
- Specified by:
generateLogOutput
in interfaceRepositoryReader
- Throws:
LogRepositoryException
-
-