org.opennms.web.vulnerability.filter
Class PortFilter

java.lang.Object
  extended by org.opennms.web.vulnerability.filter.PortFilter
All Implemented Interfaces:
Filter

public class PortFilter
extends Object
implements Filter

Encapsulates port filtering functionality.


Field Summary
protected  int port
           
static String TYPE
           
 
Constructor Summary
PortFilter(int port)
           
 
Method Summary
 int bindParam(PreparedStatement ps, int parameterIndex)
          Binds the parameter values corresponding to the ? tokens in the string returned from getParamSql() to a prepared statement.
 boolean equals(Object obj)
           
 String getDescription()
          Returns a terse string (including a "=") that describes this filter in such a way to easily be included in an HTTP GET parameter.
 String getParamSql()
          Returns a parameterized SQL where clause.
 int getPort()
           
 String getSql()
          Returns an expresions for a SQL where clause.
 String getTextDescription()
          Returns a terse but human-readable string describing this filter in such a way to easily be included in a search results list.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
See Also:
Constant Field Values

port

protected int port
Constructor Detail

PortFilter

public PortFilter(int port)
Method Detail

getSql

public String getSql()
Description copied from interface: Filter
Returns an expresions for a SQL where clause. Remember to include a trailing space, but no leading AND or OR.

Specified by:
getSql in interface Filter

getParamSql

public String getParamSql()
Description copied from interface: Filter
Returns a parameterized SQL where clause. Remember to include a trailing space, but no leading AND or OR.

Specified by:
getParamSql in interface Filter

bindParam

public int bindParam(PreparedStatement ps,
                     int parameterIndex)
              throws SQLException
Description copied from interface: Filter
Binds the parameter values corresponding to the ? tokens in the string returned from getParamSql() to a prepared statement. Returns the number of parameters that were bound.

Specified by:
bindParam in interface Filter
Throws:
SQLException

getDescription

public String getDescription()
Description copied from interface: Filter
Returns a terse string (including a "=") that describes this filter in such a way to easily be included in an HTTP GET parameter.

Some examples:

Specified by:
getDescription in interface Filter

getTextDescription

public String getTextDescription()
Description copied from interface: Filter
Returns a terse but human-readable string describing this filter in such a way to easily be included in a search results list.

Some examples (corresponding to the examples in getDescription):

Specified by:
getTextDescription in interface Filter

toString

public String toString()
Overrides:
toString in class Object

getPort

public int getPort()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2009. All Rights Reserved.