public class VulnerabilityFactory extends Object
Modifier and Type | Class and Description |
---|---|
static class |
VulnerabilityFactory.ResolutionType
Convenience class to determine what sort of events to include in a query.
|
static class |
VulnerabilityFactory.SortStyle
Convenience class to determine sort style of a query.
|
Modifier and Type | Field and Description |
---|---|
protected static ThreadCategory |
log
Constant
log |
Modifier and Type | Method and Description |
---|---|
protected static String |
getOrderByClause(VulnerabilityFactory.SortStyle sortStyle)
Convenience method for getting the SQL ORDER BY clause related
to a given sort style.
|
protected static String |
getResolutionTypeClause(VulnerabilityFactory.ResolutionType resType)
Convenience method for getting the SQL WHERE clause related to a given
resolution type.
|
static Vulnerability[] |
getVulnerabilities()
Return all open vulnerabilities sorted by time.
|
static Vulnerability[] |
getVulnerabilities(VulnerabilityFactory.ResolutionType resType)
Return all open or resolved vulnerabilities sorted by identifier.
|
static Vulnerability[] |
getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle)
Return all open vulnerabilities sorted by the given sort style.
|
static Vulnerability[] |
getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle,
VulnerabilityFactory.ResolutionType resType)
Return all vulnerabilities (optionally only open vulnerabilities) sorted
by the given sort style.
|
static Vulnerability[] |
getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle,
VulnerabilityFactory.ResolutionType resType,
Filter[] filters)
Return all vulnerabilities (optionally only open vulnerabilities) sorted
by the given sort style.
|
static Vulnerability[] |
getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle,
VulnerabilityFactory.ResolutionType resType,
Filter[] filters,
int limit,
int offset)
Return all vulnerabilities (optionally only open vulnerabilities) sorted
by the given sort style.
|
static Vulnerability[] |
getVulnerabilitiesForNode(int nodeId,
VulnerabilityFactory.SortStyle sortStyle,
VulnerabilityFactory.ResolutionType resType,
int throttle,
int offset,
javax.servlet.ServletContext servletContext)
Return some maximum number of vulnerabilities or less sorted by the given
sort style for the given node.
|
static Vulnerability |
getVulnerability(int vulId)
Return a specific vulnerability.
|
static int |
getVulnerabilityCount()
Count all open vulnerabilities.
|
static int |
getVulnerabilityCount(VulnerabilityFactory.ResolutionType resType,
Filter[] filters)
Count the number of vulnerabilities for a given resolution type and given
filters..
|
static int |
getVulnerabilityCountForInterface(int nodeId,
String ipAddress,
VulnerabilityFactory.ResolutionType resType,
javax.servlet.ServletContext servletContext)
Return the number of vulnerabilities for this IP address and the given
resolution type.
|
static int |
getVulnerabilityCountForNode(int nodeId,
VulnerabilityFactory.ResolutionType resType,
javax.servlet.ServletContext servletContext)
Return the number of vulnerabilities for this node and the given
resolution type.
|
static Vulnerability[] |
getVulnerablilitiesForInterface(int nodeId,
String ipAddress,
VulnerabilityFactory.SortStyle sortStyle,
VulnerabilityFactory.ResolutionType resType,
int throttle,
int offset,
javax.servlet.ServletContext servletContext)
Return some maximum number of events or less (optionally only
unacknowledged events) sorted by the given sort style for the given IP
address.
|
protected static Vulnerability[] |
rs2Vulnerabilities(ResultSet rs)
Convenience method for translating a
java.sql.ResultSet
containing vulnerability information into an array of
Vulnerability objects. |
protected static final ThreadCategory log
log
public static int getVulnerabilityCount() throws SQLException
SQLException
- if any.public static int getVulnerabilityCount(VulnerabilityFactory.ResolutionType resType, Filter[] filters) throws SQLException
resType
- a VulnerabilityFactory.ResolutionType
object.filters
- an array of Filter
objects.SQLException
- if any.public static Vulnerability getVulnerability(int vulId) throws SQLException
vulId
- a int.Vulnerability
object.SQLException
- if any.public static Vulnerability[] getVulnerabilitiesForNode(int nodeId, VulnerabilityFactory.SortStyle sortStyle, VulnerabilityFactory.ResolutionType resType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws SQLException
throttle
- a value less than one means no throttlingnodeId
- a int.sortStyle
- a VulnerabilityFactory.SortStyle
object.resType
- a VulnerabilityFactory.ResolutionType
object.offset
- a int.Vulnerability
objects.SQLException
- if any.public static int getVulnerabilityCountForNode(int nodeId, VulnerabilityFactory.ResolutionType resType, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.resType
- a VulnerabilityFactory.ResolutionType
object.SQLException
- if any.public static Vulnerability[] getVulnerablilitiesForInterface(int nodeId, String ipAddress, VulnerabilityFactory.SortStyle sortStyle, VulnerabilityFactory.ResolutionType resType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws SQLException
throttle
- a value less than one means no throttlingoffset
- which row to start on in the result listnodeId
- a int.ipAddress
- a String
object.sortStyle
- a VulnerabilityFactory.SortStyle
object.resType
- a VulnerabilityFactory.ResolutionType
object.Vulnerability
objects.SQLException
- if any.public static int getVulnerabilityCountForInterface(int nodeId, String ipAddress, VulnerabilityFactory.ResolutionType resType, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.resType
- a VulnerabilityFactory.ResolutionType
object.SQLException
- if any.public static Vulnerability[] getVulnerabilities() throws SQLException
Vulnerability
objects.SQLException
- if any.public static Vulnerability[] getVulnerabilities(VulnerabilityFactory.ResolutionType resType) throws SQLException
resType
- a VulnerabilityFactory.ResolutionType
object.Vulnerability
objects.SQLException
- if any.public static Vulnerability[] getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle) throws SQLException
sortStyle
- a VulnerabilityFactory.SortStyle
object.Vulnerability
objects.SQLException
- if any.public static Vulnerability[] getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle, VulnerabilityFactory.ResolutionType resType) throws SQLException
sortStyle
- a VulnerabilityFactory.SortStyle
object.resType
- a VulnerabilityFactory.ResolutionType
object.Vulnerability
objects.SQLException
- if any.public static Vulnerability[] getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle, VulnerabilityFactory.ResolutionType resType, Filter[] filters) throws SQLException
sortStyle
- a VulnerabilityFactory.SortStyle
object.resType
- a VulnerabilityFactory.ResolutionType
object.filters
- an array of Filter
objects.Vulnerability
objects.SQLException
- if any.public static Vulnerability[] getVulnerabilities(VulnerabilityFactory.SortStyle sortStyle, VulnerabilityFactory.ResolutionType resType, Filter[] filters, int limit, int offset) throws SQLException
Note: This limit/offset code is Postgres specific! Per Shane , this is okay for now until we can come up with an Oracle alternative too.
limit
- if -1 or zero, no limit or offset is usedoffset
- if -1, no limit or offset if usedsortStyle
- a VulnerabilityFactory.SortStyle
object.resType
- a VulnerabilityFactory.ResolutionType
object.filters
- an array of Filter
objects.Vulnerability
objects.SQLException
- if any.protected static Vulnerability[] rs2Vulnerabilities(ResultSet rs) throws SQLException
java.sql.ResultSet
containing vulnerability information into an array of
Vulnerability
objects.rs
- a ResultSet
object.Vulnerability
objects.SQLException
- if any.protected static String getOrderByClause(VulnerabilityFactory.SortStyle sortStyle)
sortStyle
- a VulnerabilityFactory.SortStyle
object.String
object.protected static String getResolutionTypeClause(VulnerabilityFactory.ResolutionType resType)
resType
- the resolution type to map to a clauseString
object.Copyright © 2015. All Rights Reserved.