|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
com.martealert.martealertHashtable
com.martealert.martealertHashFilter
Class for create instances of martealertHashFilter objects and filter martealertTables
Field Summary | |
java.lang.String |
ftsStr
|
com.martealert.martealertFields |
jpFields
|
int |
limitFTS
|
int |
limitLTS
|
java.lang.String |
ltsStr
|
int |
nfilteredAlerts
|
int |
ntotalAlerts
|
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 |
Constructor Summary | |
martealertHashFilter()
Creates a new instance of an empty martealertHashFilter |
|
martealertHashFilter(java.sql.Connection con,
java.lang.String _FTS,
java.lang.String _LTS)
Creates a new instance of a martealertHashFilter with only date filters. |
|
martealertHashFilter(martealertHashFilter t)
Creates a new instante of martealertHashFilter initialize by a map or another Hashtable. |
Method Summary | |
protected void |
addFields(java.lang.String[] nn,
java.lang.String[] nllj)
Add vector of fields to this.jpFields, keeping the before values of jpFields. |
protected void |
addFields(java.util.Vector nn,
java.util.Vector nllj)
Add vector of fields to this.jpFields, keeping the before values of jpFields. |
java.lang.Object |
clone()
Clone a martealertHashFilter from this. |
static martealertHashFilter |
combineHashFilters(java.sql.Connection con,
java.util.Vector filters,
java.lang.String _FTS,
java.lang.String _LTS)
Combine a vector of martealertHashfilter assigning first time sign and last time sign |
java.lang.Object |
get(java.lang.Object key)
Get an object from key index |
protected java.util.Vector |
getAdvancedFilterFormule()
Calculate formules for each component of a filter, replacing comile, no-needed brackets and default/null values. |
protected java.util.Vector |
getAdvancedFilterLogicOp()
Get logic operator selected in advanced filter dialog. |
protected java.lang.String[] |
getFieldsToFilter(java.lang.String s)
Get fields to be filtered. |
protected java.lang.String[] |
getFieldsToFilter(java.lang.String[] as)
Get fields to be filtered. |
protected java.lang.String[] |
getFieldsToFilter(java.util.Vector fields)
Get fields to be filtered. |
protected java.lang.String |
getFilterLastJoin()
Compose a filter with all components depending on if they contains NULL or default value. |
martealertCalendar |
getFTS()
Get FTS from martealertHashfilter where time has been stored with the following syntax: (t0.time >= '2006-01-11 00:00:00.0' AND t0.time <= '2006-02-24 23:59:00.0') AND |
static martealertHashFilter |
getHashFilter(int[] rows,
martealertTopStats table)
Return a martealertHashFilter grouping martealertTopStats.getField() rows and this Hashfilter conditions in only one filter, which will be combinated later. |
java.lang.String |
getHtmlDescription()
Calculate a html description from a filter. |
int |
getIdFTS()
Get "First Time Seen" identifier. |
int |
getIdLTS()
Get "Last Time Seen" identifier. |
martealertCalendar |
getLTS()
Get LTS from martealertHashfilter where time has been stored with the following syntax: (t0.time >= '2006-01-11 0:0.00.0' AND t0.time <= '2006-02-24 23:59.00.0') AND |
int |
getTotalAlerts()
Get last total number of alerts calculated in |
int |
getTotalFilteredAlerts()
Get total number of alerts after having applied this filter. |
java.lang.String |
getValue(java.lang.String key)
Obtain 192.168.1.20 from filter.get(SOURCEIP), when string stored is for example: "t2.address = '192.168.1.20' AND " |
void |
initProperties(java.sql.Connection con,
java.lang.String _FTS,
java.lang.String _LTS)
Inittialize int and String filter properties but not jpFields. |
void |
loadFrom(java.io.FileInputStream in)
Load a martealertHashFilter from in input stream. |
void |
loadFrom(java.lang.String pathFile)
Load a martealertHashFilter from a path file. |
void |
negateFilter()
Negate martealertHashFilter. |
void |
printFilter()
Print hashtable filter and filter properties in standard output. |
protected static java.lang.String |
putComile(java.lang.String field,
java.lang.String filter)
Return a String with comile containing values, from a logic formule. |
java.lang.Object |
putValue(java.lang.Object key,
java.lang.Object value)
Put a value into hashtable for index key. |
void |
saveTo(java.awt.Component parent)
Save a martealertHashFilter in a file given by parameter out. |
void |
saveTo(java.io.FileOutputStream out)
Save a martealertHashFilter in a file given by parameter out. |
martealertHashFilter |
setAdvancedFilter(java.lang.String field,
java.lang.String value,
java.lang.String operator)
Set and get a filter value for a field usin logic operator passed as param. |
protected void |
setFields(java.lang.String[] nn,
java.lang.String[] nllj)
Set arrays of fields to this.jpFields, deleting the before values of jpFields. |
protected void |
setFields(java.lang.String[] nn,
java.lang.String[] nllj,
int fd)
Set arrays of fields to this.jpFields, deleting the before values of jpFields. |
void |
setHashFilter(int[] row,
martealertTopStats table)
Set into this martealertHashFilter values according to rows in row[] array for martealertTopStats in params. |
protected void |
setNumProperties(martealertHashFilter filter)
Set to this filter properties of martealertHashFilter passed, and jpFields, but not hashtable filter values. |
void |
setPairAddress(int i,
martealertTable pt)
Set source and target ip to this martealertHashFilter modifying SOURCEIP, TARGETIP and IPADDRS keys from martealertTable pt. |
void |
setPairAddress(martealertTable pt)
Set source and target ip to this martealertHashFilter modifying SOURCEIP, TARGETIP and IPADDRS keys from martealertTable pt. |
void |
setPairAddress(java.lang.String sourceAddr,
java.lang.String targetAddr)
Set source and target ip to this martealertHashFilter modifying SOURCEIP, TARGETIP and IPADDRS keys from martealertTable pt. |
void |
setPairAddress(java.util.Vector v)
Set source and target ip to this martealertHashFilter modifying SOURCEIP, TARGETIP and IPADDRS keys from martealertTable pt. |
void |
setTime(java.lang.String _FTS,
java.lang.String _LTS)
Update time and store it into HashFilter this. |
Methods inherited from class com.martealert.martealertHashtable |
getTemporalFilter, printHashtable, setFilter |
Methods inherited from class java.util.Hashtable |
clear, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public int limitFTS
public int limitLTS
public java.lang.String ftsStr
public java.lang.String ltsStr
public int nfilteredAlerts
public int ntotalAlerts
public com.martealert.martealertFields jpFields
Constructor Detail |
public martealertHashFilter()
public martealertHashFilter(java.sql.Connection con, java.lang.String _FTS, java.lang.String _LTS) throws java.sql.SQLException
_FTS
- String with first time sign in local time._LTS
- String with last time sign in local time.public martealertHashFilter(martealertHashFilter t)
t
- Map to initialize martealertHashFilter object.Method Detail |
public void initProperties(java.sql.Connection con, java.lang.String _FTS, java.lang.String _LTS) throws java.sql.SQLException
con
- Connection to database._FTS
- First time seen._LTS
- Last time seen.
java.sql.SQLException
- Error while getting identifier from FTS or LTS.protected void setNumProperties(martealertHashFilter filter)
filter
- martealertHashFilter from which values are copied to this.public void setTime(java.lang.String _FTS, java.lang.String _LTS)
public java.lang.Object putValue(java.lang.Object key, java.lang.Object value)
key
- index of hashtable.value
- Object value to be stored in key position.
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
get
in class martealertHashtable
key
- Object index (It will usually be an String)
public martealertHashFilter setAdvancedFilter(java.lang.String field, java.lang.String value, java.lang.String operator)
field
- Fieldvalue
- It contains "field var = 'value'", not only value.operator
- Logic operator can be AND, OR.
public static martealertHashFilter getHashFilter(int[] rows, martealertTopStats table)
rows
- rows from table to filter.
public void setHashFilter(int[] row, martealertTopStats table)
row
- int[] array with rows to filter by.table
- martealertTopStats table where are taken data for filtering.
java.sql.SQLException
public void setPairAddress(martealertTable pt)
pt
- martealertTable which contains source IP's in first column (0) and target in second one (1).public void setPairAddress(int i, martealertTable pt)
i
- int which indicate row of pt to take addresses from it.pt
- martealertTable which contains source IP's in first column (0) and target in second one (1).public void setPairAddress(java.util.Vector v)
v
- vector with source ip in component 0 and target ip in component 1public void setPairAddress(java.lang.String sourceAddr, java.lang.String targetAddr)
sourceAddr
- source ip address.targetAddr
- target ip address.public java.lang.String getValue(java.lang.String key)
key
- index of martealertHashtable.
key
position of this
object in String format.protected static java.lang.String putComile(java.lang.String field, java.lang.String filter)
field
- String with field or martealertHashFilter keyfilter
- String with component of martealertHashFilter value.
protected java.util.Vector getAdvancedFilterFormule()
protected java.util.Vector getAdvancedFilterLogicOp()
public martealertCalendar getFTS()
public martealertCalendar getLTS()
public static martealertHashFilter combineHashFilters(java.sql.Connection con, java.util.Vector filters, java.lang.String _FTS, java.lang.String _LTS) throws java.sql.SQLException
filters
- Vector of martealertHashFilters. Size must be > 0_FTS
- String with first time sign in ISO format._LTS
- String with last time sign in ISO format.
java.sql.SQLException
protected java.lang.String getFilterLastJoin()
protected java.lang.String[] getFieldsToFilter(java.lang.String s)
s
- String with fields to filter.
protected java.lang.String[] getFieldsToFilter(java.lang.String[] as)
as
- String[] with fields to filter.
protected java.lang.String[] getFieldsToFilter(java.util.Vector fields)
fields
- Vector with fields to filter.
public void negateFilter()
public java.lang.String getHtmlDescription()
public void saveTo(java.io.FileOutputStream out) throws java.io.IOException
out
- FileOutputStream to save file.
java.io.IOException
- Launched when saving has not possible to be done.public void saveTo(java.awt.Component parent)
parent
- Component parent of advanced filter dialog.public void loadFrom(java.lang.String pathFile) throws java.io.IOException
pathFile
- path file to load filter.
java.io.IOException
- File not found.public void loadFrom(java.io.FileInputStream in) throws java.io.IOException
in
input stream.
in
- FileInputStream
to load file.
java.io.IOException
public int getTotalAlerts()
public int getTotalFilteredAlerts()
public int getIdFTS()
public int getIdLTS()
public void printFilter()
public java.lang.Object clone()
protected void setFields(java.lang.String[] nn, java.lang.String[] nllj)
nn
- Array with not null fields to be added.nllj
- Array with null fields to be added.protected void setFields(java.lang.String[] nn, java.lang.String[] nllj, int fd)
nn
- Array with not null fields to be added.nllj
- Array with null fields to be added.fd
- Flag which specify if there are double fields (SEVERITY_COMPLETION or PROTOCOL_TARGETPORT) or not.protected void addFields(java.util.Vector nn, java.util.Vector nllj)
nn
- Vector with not null fields to be added.nllj
- Vector with null fields to be added.protected void addFields(java.lang.String[] nn, java.lang.String[] nllj)
nn
- Array with not null fields to be added.nllj
- Array with null fields to be added.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |