|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.tfe.console.QueryFactory
| Method Summary | |
static java.lang.String |
convertAddressToString(long number)
Converts IP addresses from a long to a String (dotted decimal format) This function is used to convert the long number value IP address that is stored in the snort database into a human readable IP address. |
static long |
convertStringToAddress(java.lang.String address)
|
void |
deleteAlert(int sid,
int cid)
Deletes an alert from the database. |
Alert |
getAlert(int sid,
int cid)
Queries the database for alerts that have a specific sid and cid. |
java.util.ArrayList |
getAlertCountByProtocol(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the number of Alerts for each protocol (ICMP, TCP, UDP) from the database. |
int[] |
getAlertIndices(Alert alert)
Retrieves the sid and cid of a given Alert. |
AlertList |
getAlerts(java.lang.String SQLString)
Queries the database for alerts. |
AlertList |
getAlerts(java.lang.String sDateTime,
java.lang.String eDateTime)
Queries the database for alerts that fall between a specific start and end date. |
java.util.ArrayList |
getAlertsPerDay(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the number of Alerts per day from the database. |
Incident |
getIncident(int ID)
Retrieves an Incident from the database. |
int |
getIncidentIndex()
Retrieves the last incident index number from the database. |
java.util.ArrayList |
getIncidents(java.lang.String SQL)
Queries the database for Incidents that match a custom SQL string. |
java.util.ArrayList |
getIncidents(java.lang.String sDateTime,
java.lang.String eDateTime)
Retrieves all Incidents that fall between the specified dates & times. |
static QueryFactory |
getInstance(java.lang.String[] dbInfo)
|
java.util.ArrayList |
getMostActiveSensors(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the top 10 most active sensors (by number of Alerts) from the database. |
int |
getNumIncidentAlerts(int incident_id)
Retrieve the number of Alerts associated with an Incident. |
java.util.ArrayList |
getTopDstIPs(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the top 10 destination IP addresses (by number of Alerts) from the database. |
java.util.ArrayList |
getTopSignatures(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the top 10 Alert signatures from the database. |
java.util.ArrayList |
getTopSrcIPs(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the top 10 source IP addresses (by number of Alerts) from the database. |
java.util.ArrayList |
getTopTCPPorts(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the top 10 TCP ports (by number of Alerts) from the database. |
java.util.ArrayList |
getTopUDPPorts(java.lang.String sDateTime,
java.lang.String eDateTime)
Gets the top 10 UDP ports (by number of Alerts) from the database. |
boolean |
insertIncident(Incident tempIncident)
Inserts a given Incident into the database. |
boolean |
updateIncident(Incident tempIncident)
Updates information about a specific Incident in the database. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static QueryFactory getInstance(java.lang.String[] dbInfo)
public AlertList getAlerts(java.lang.String sDateTime,
java.lang.String eDateTime)
sDateTime - the start date and time for which to search for alerts.eDateTime - the end date and time for which to search for alerts.
public Alert getAlert(int sid,
int cid)
sid - the sid of the Alert.cid - the cid of the Alert.
Alert that matched the query parameters, null if nothing found.public AlertList getAlerts(java.lang.String SQLString)
SQLString - a custom, user-defined SQL string that gets appended to the standard SQL statement for retrieving Alerts.
public int[] getAlertIndices(Alert alert)
Alert.
This function queries the database and retrieves the sid and cid that are associated with a given alert. This
can be useful when creating an Incident from the Alert.
alert - the Alert for which to retrieve the sid and cid from the database.
Alert in the database, or null if nothing was found.
public void deleteAlert(int sid,
int cid)
sid - the sid of the alert to be deletedcid - the cid of the alert to be deletedpublic int getIncidentIndex()
Incident in the database. This is useful for determining
what the index number of the next Incident should be. It can also be used in reporting functions to tell
the total number of Incidents in a given time period (this functionality is not yet implemented).
Incident index in the database.public boolean insertIncident(Incident tempIncident)
Incident into the database.
This function will take a newly created Incident and insert it into the database. It checks first
to see if the Incident is already in the database, and if it is, then it returns. If not, it proceeds.
tempIncident - the Incident to be stored in the database.
public boolean updateIncident(Incident tempIncident)
Incident in the database.
This function will update the information in the database for a given incident. This is used when
Incident related information is updated by the user.
tempIncident - the Incident to be updated (with new values set).
public Incident getIncident(int ID)
Incident from the database.
ID - the integer ID of the Incident to retrieve from the database.
Incident, or null if nothing was found.public int getNumIncidentAlerts(int incident_id)
Alerts associated with an Incident.
incident_id - the integer ID of the Incident to query.
Alerts associated with the specified Incident.
public java.util.ArrayList getIncidents(java.lang.String sDateTime,
java.lang.String eDateTime)
Incidents that fall between the specified dates & times.
This function will query the database and retrieve all incidents that fall between the dates/times that the user
specifies. This enables reporting and metrics to be generated on the Incidents. Note that this queries
by the CREATION date & time of the Incident, not the onset date & time of the Incident.
sDateTime - the earliest possible creation time for which to retrieve Alerts.eDateTime - the latest possible creation time for which to retrieve Alerts.
Incidents that matched the specified parameters, or null if nothing was found.public java.util.ArrayList getIncidents(java.lang.String SQL)
Incidents that match a custom SQL string.
This code will allow the user to specify custom constraints that will be appended to the WHERE clause of the
SQL statement. This code will (eventually) check the input for any instances of the INSERT, UPDATE, or DELETE
keywords.
SQL - a custom, user-defined SQL string that gets appended to the standard SQL statement for retrieving Incidents.
Incidents that matched the specified parameters, null if nothing found.
public java.util.ArrayList getTopTCPPorts(java.lang.String sDateTime,
java.lang.String eDateTime)
Alerts) from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted from greatest # of Alerts/port to least # of Alerts/port.
public java.util.ArrayList getTopUDPPorts(java.lang.String sDateTime,
java.lang.String eDateTime)
Alerts) from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted from greatest # of Alerts/port to least # of Alerts/port.
public java.util.ArrayList getTopSrcIPs(java.lang.String sDateTime,
java.lang.String eDateTime)
Alerts) from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted from greatest # of Alerts/IP to least # of Alerts/IP.
public java.util.ArrayList getTopDstIPs(java.lang.String sDateTime,
java.lang.String eDateTime)
Alerts) from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted from greatest # of Alerts/IP to least # of Alerts/IP.
public java.util.ArrayList getTopSignatures(java.lang.String sDateTime,
java.lang.String eDateTime)
Alert signatures from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted from greatest # of Alerts/signature to least # of Alerts/signature.
public java.util.ArrayList getAlertCountByProtocol(java.lang.String sDateTime,
java.lang.String eDateTime)
Alerts for each protocol (ICMP, TCP, UDP) from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted from greatest # of Alerts/Protocol to least # of Alerts/Protocol.
public java.util.ArrayList getMostActiveSensors(java.lang.String sDateTime,
java.lang.String eDateTime)
Alerts) from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted from greatest # of Alerts/Sensor to least # of Alerts/Sensor.
public java.util.ArrayList getAlertsPerDay(java.lang.String sDateTime,
java.lang.String eDateTime)
Alerts per day from the database.
This function is used in conjunction with ReportInputFrame & JFreeChart to generate charts.
sDateTime - the earliest date for which to query.eDateTime - the latest date for which to query.
ChartQueryResults, sorted chronologically from the first day to the last day.public static java.lang.String convertAddressToString(long number)
public static long convertStringToAddress(java.lang.String address)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||