|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.martealert.martealertTable
com.martealert.martealertTopStats
Class for generating top stats.
Field Summary | |
protected java.lang.String |
limit
|
Fields inherited from class com.martealert.martealertTable |
_, ALIASVAR, columnNames, data, DEFAULT, GROUPBY, IDENT, INDEX, INDEXSEARCH, NAMEDVAR, RELATION, SELECT, TX, UNNAMEDVAR, VAR |
Fields inherited from interface com.martealert.martealertConstants |
AMBIGUOUS_FIELDS, ANALYZER, CLASSIFICATION, COMPLETION, FTS, FTSTZ, HOUR_IN_MILLIS, INTERVAL, IPADDRS, LASTJOIN, LTS, LTSTZ, MAXMSGID, MAXSEVERITY, MFTS, MLTS, MSGID, MSOURCEPORT, NALERTS, NOTNULL_FIELDS, NULL_FIELDS, NXCLASSIFICATION, ORDER_BY_ALERTS, ORDER_BY_MAXTIME, ORDER_BY_TIME, PRELUDE_TABLES, PROTOCOL, SENSOR, SEVERITY, SEVERITY_COMPLETION, SOURCE, SOURCEIP, SOURCEPORT, SOURCEUID, TARGET, TARGETIP, TARGETPORT, TARGETPORT_PROTOCOL, TARGETUID, TERMINAL, TIME, TIMETZ, TLAST, TOP, TOTALTIME |
Fields inherited from interface com.martealert.martealertTopInterface |
ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, TEN_DAYS, TEN_HOURS, TEN_MINUTES, TEN_SECONDS, TOP_CONNECTION_ALERTS, TOP_CONNECTION_FTS, TOP_CONNECTION_LTS, TOP_CONNECTION_NAME, TOP_CONNECTION_NUMBER, TOP_CONNECTION_PERCENT, TOP_LOGINFO_ALERTS, TOP_LOGINFO_FTS, TOP_LOGINFO_LTS, TOP_LOGINFO_NAME, TOP_LOGINFO_PERCENT, TOP_MAX_NUMBER |
Fields inherited from interface com.martealert.martealertRealTimeInterface |
REAL_TIME_CLASSIFICATION, REAL_TIME_COMPLETION, REAL_TIME_MSGID, REAL_TIME_SEVERITY, REAL_TIME_SOURCEIP, REAL_TIME_TARGETIP, REAL_TIME_TIME |
Constructor Summary | |
martealertTopStats()
Creates a new instance of martealertTopStats with limit of 25 rows |
|
martealertTopStats(int limit)
Creates a new instance of martealertTopStats with limit specified in constructor. |
Method Summary | |
protected java.lang.String |
calcPercent(java.sql.Connection con,
int total)
Calculate % percent variable giving total number of alerts. |
abstract int |
getAlertColumn()
Get index position for column in table this with number of alerts. |
java.lang.String |
getCommand(martealertHashFilter filter)
Get SQL command for calculate martealertTopStats , from "FROM" clause until the end of the command. |
protected abstract java.lang.String |
getDefaultValue()
Get default value for a top stats table. |
protected static java.lang.String |
getDefaultValue(java.lang.String field)
|
abstract java.lang.String |
getField()
|
protected abstract java.lang.String |
getField(martealertHashFilter hf)
|
static java.lang.String |
getFilter(java.lang.Object singleFilter,
java.lang.String field)
Return a filter to be added to a SQL-WHERE clause in String format. |
int[] |
getIpColumns()
Get array with number of IP columns. |
int[] |
getMultilineColumns()
Get array with number of columns which rows can store multiline values (sub-rows). |
abstract int[] |
getPercentColumns()
Get index position for Percent (%) column in table this. |
int[] |
getPortColumns()
Get array with number of port columns, to be solved from services table in database. |
protected static java.lang.String |
getPrecisionVar(int precision,
java.lang.String title)
Get precision variable for SQL command. |
int[] |
getProtocolColumns()
Get array with number of protocol columns, to be solved from protocol table in database. |
java.lang.String |
getSqlFilteredTime(martealertHashFilter filter,
int precision)
Get list of dates and events in a rounded time, for representing in a temporal graph. |
protected java.lang.String |
getSqlFilteredTime(martealertHashFilter filter,
int precision,
java.lang.String title)
Get list of dates and events in a rounded time, for representing in a temporal graph. |
protected abstract java.lang.String |
getSqlGroupedBy()
|
protected abstract java.lang.String |
getSqlOrderBy()
|
java.lang.String[] |
getSqlTime(martealertHashFilter filter,
int prec)
Get a String array with SQL commands for generating graphics with time axe. |
protected java.lang.String[] |
getSqlTime(martealertHashFilter filter,
int prec,
int stam)
Get a String array with SQL commands for generating graphics with time axe. |
java.lang.String |
getSqlTotalTime(java.sql.Connection con,
martealertHashFilter filter,
int precision)
Return a SQL command to generate alerts graph into time interval specified by first time sign (FTS) and last time sign (LTS) into hashFilter. |
protected abstract java.lang.String |
getSqlVars(int tot)
|
void |
getStat(java.sql.Connection con,
martealertHashFilter filter)
Get top stats table and store it in this |
protected java.lang.String |
getTopVar()
Get var name of Prelude Table, for each top. |
protected java.lang.String |
getTopVar(java.lang.String field)
Get var name of Prelude Table, for each top. |
static int |
getTotalLogs(java.sql.Connection con,
martealertHashFilter hf)
Get total number of logs ocurred between FTS and LTS specified. |
void |
reload(java.sql.Connection con,
martealertHashFilter filter)
Reload top Stats martealertTable, removing last elements. |
void |
setLimit(int limit)
Set a limit for number of rows. |
Methods inherited from class com.martealert.martealertTable |
clear, getColumn, getColumnNames, getColumnSize, getData, getFTSColumn, getIgnoredColumnsPdf, getLTSColumn, getRow, getRowSize, getSeverityColumn, getSqlRelation, getTableVector, getValue, getValue, getValue, printTable, setColumnNames, setDataVector, setDataVector, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String limit
Constructor Detail |
public martealertTopStats()
public martealertTopStats(int limit)
limit
- integer with maximum number of rows for each top table.
In order to obtain unlimited rows for a TopStat object, specify limit <= 0.Method Detail |
public void setLimit(int limit)
limit
- for top stats table number of rows.public static int getTotalLogs(java.sql.Connection con, martealertHashFilter hf) throws java.sql.SQLException
con
- Connection variable to access PostgreSQL database.hf
- martealertHashFilter
to obtain top stats filtered.
martealertHashFilter
hf.
java.sql.SQLException
- SQL syntax error executing query.public void getStat(java.sql.Connection con, martealertHashFilter filter) throws java.sql.SQLException
this
con
- Connection variable to access PostgreSQL database.filter
- martealertHashFilter
to obtain top stats filtered.
java.sql.SQLException
- Sql error querying for obtain top stats.public java.lang.String getCommand(martealertHashFilter filter)
martealertTopStats
, from "FROM" clause until the end of the command.
filter
- martealertHashFilter
to obtain top stats filtered.
public void reload(java.sql.Connection con, martealertHashFilter filter) throws java.sql.SQLException
reload
in class martealertTable
con
- Connection to the databasefilter
- martealertHashFilter for filter values of topStats table.
java.sql.SQLException
- SQL error querying the database.protected java.lang.String calcPercent(java.sql.Connection con, int total) throws java.sql.SQLException
con
- Connection to the database.total
- number of alerts.
java.sql.SQLException
public int[] getIpColumns()
getIpColumns
in class martealertTable
public int[] getPortColumns()
getPortColumns
in class martealertTable
public int[] getProtocolColumns()
getProtocolColumns
in class martealertTable
public int[] getMultilineColumns()
martealertFirstLevel
.
getMultilineColumns
in class martealertTable
protected abstract java.lang.String getSqlVars(int tot)
protected abstract java.lang.String getSqlGroupedBy()
protected abstract java.lang.String getSqlOrderBy()
public abstract java.lang.String getField()
protected abstract java.lang.String getField(martealertHashFilter hf)
protected java.lang.String getTopVar()
protected java.lang.String getTopVar(java.lang.String field)
field
- String which variable name is wanted.
public abstract int getAlertColumn()
public abstract int[] getPercentColumns()
getPercentColumns
in class martealertTable
public java.lang.String getSqlTotalTime(java.sql.Connection con, martealertHashFilter filter, int precision) throws java.sql.SQLException
con
- Connection variable to access the database.filter
- martealertHashFilter which includes FTS, LTS furthermore the rest of filter conditions.precision
- int constant to get optimal number of points to represent graph according to interval lengh (LTS - FTS). They
can be ONE_SECOND, TEN_SECONDS, ONE_MINUTE, TEN_MINUTES, ONE_HOUR, TEN_HOURS, ONE_DAY
java.sql.SQLException
public java.lang.String getSqlFilteredTime(martealertHashFilter filter, int precision)
filter
- martealertHashFilter
to filter alerts in temporal graph.precision
- constant from top interface to determinate precision.
protected static java.lang.String getPrecisionVar(int precision, java.lang.String title)
precision
- constant from top interface to determinate precision.title
- String with title of graph.
protected java.lang.String getSqlFilteredTime(martealertHashFilter filter, int precision, java.lang.String title)
filter
- martealertHashFilter
to filter alerts in temporal graph.precision
- constant from top interface to determinate precision.title
- Title for temporal graph.
public java.lang.String[] getSqlTime(martealertHashFilter filter, int prec)
filter
- String with sql filter. It has to be added after WHERE clause begining with " AND "prec
- integer constants for precision defined in martealertTopStats.
protected java.lang.String[] getSqlTime(martealertHashFilter filter, int prec, int stam)
filter
- String with sql filter. It has to be added after WHERE clause begining with " AND "prec
- integer constants for precision defined in martealertTopStats.stam
- int with returned String[] size.
protected abstract java.lang.String getDefaultValue()
public static java.lang.String getFilter(java.lang.Object singleFilter, java.lang.String field)
singleFilter
- Object value to be filtered by.field
- Top stats to obtain default value.
protected static java.lang.String getDefaultValue(java.lang.String field)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |