alma::acs::logging::table::LogTableRowFilter Class Reference

Inheritance diagram for alma::acs::logging::table::LogTableRowFilter:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::table::LogTableRowFilter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LogTableRowFilter (FiltersVector filtersVector, LogTypeHelper logLevel)
boolean include (Entry<?extends LogTableDataModel,?extends Integer > entry)

Private Member Functions

void buildTableFilters (FiltersVector userFilters)
boolean checkLogLevel (LogTypeHelper level)

Private Attributes

Filter[] filters = null
LogTypeHelper logLevel = LogTypeHelper.TRACE

Detailed Description

The filters used to hide/show logs in the table.

The filters defined in the FiltersVector are entirely reused by this object. To enhance performances only the active filters are stored into an array built by the constructor. All the magic happens in the include method where the filters are compared against the values of a row of the table.

Author:
acaproni

Constructor & Destructor Documentation

alma::acs::logging::table::LogTableRowFilter::LogTableRowFilter ( FiltersVector  filtersVector,
LogTypeHelper  logLevel 
) [inline]

Constructor

Parameters:
filtersVector The vector of engine filters (can be null or empty)
logLevel The log level of the logs to filter out

References buildTableFilters().


Member Function Documentation

void alma::acs::logging::table::LogTableRowFilter::buildTableFilters ( FiltersVector  userFilters  )  [inline, private]

Convert the vector of filters to a LogTableRowFilter.

The engine and the dialog define filters by means of a vector of filters that has to be converted before being applied by this sorter. If the vector of filters is null or empty this object is set to null to improve performances. All the filters defined in the vector are added in AND because this is the way they are defined in the FiltersVector.

Parameters:
userFilters The user defined vector of filters
Returns:
The RowSorter with all the filters in the passed parameter

References filters, and com::cosylab::logging::engine::FiltersVector::getAppliedFiltersIndexes().

Referenced by LogTableRowFilter().

boolean alma::acs::logging::table::LogTableRowFilter::checkLogLevel ( LogTypeHelper  level  )  [inline, private]

Check if the level of the log passed as parameter matches with the log level

Parameters:
level The level to check
Returns:
true if the parameter is greater then the log level

References logLevel.

Referenced by include().

boolean alma::acs::logging::table::LogTableRowFilter::include ( Entry<?extends LogTableDataModel,?extends Integer >  entry  )  [inline]

Compare the entry with the filters.

The entry represents a row of the table and it is possible to get the values of all the cells of the row using an index. The order of the columns is independent of the way the appear in the table and therefore is like this:

  1. - Boolean (has data)
  2. - LogField.TIMESTAMP
  3. - LogField.ENTRYTYPE
  4. - ..

The filtering is done by getting the value to check against the filter from the column (index) containing it in entry. It is possible to know which field a filter wants to filter by reading the Filter.field property.

Once we have the filter and the value to filter, we can use filter.applyTo(Object obj) method to check if the row matches the filter.

Parameters:
entry The entry to check against filters
Returns:
true if the entry passed the filters and must be displayed in the table
See also:
RowFilter.include

References com::cosylab::logging::engine::Filter::applyTo(), checkLogLevel(), com::cosylab::logging::engine::Filter::field, and filters.


Member Data Documentation

The array with the filters to apply to the entries.

This array is null but when there are filters. In this case, it contains anly the active filters read from the FiltersVector passed as parameter in the constructor.

Referenced by buildTableFilters(), and include().

LogTypeHelper alma::acs::logging::table::LogTableRowFilter::logLevel = LogTypeHelper.TRACE [private]

The log level.

All the entries whose level is less then logLevel are filtered out of the table.

Referenced by checkLogLevel().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2