Class SituationFilter

  • All Implemented Interfaces:
    Filter

    public class SituationFilter
    extends java.lang.Object
    implements Filter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TYPE  
    • Constructor Summary

      Constructors 
      Constructor Description
      SituationFilter​(boolean situation)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int bindParam​(java.sql.PreparedStatement ps, int parameterIndex)
      Binds the parameter values corresponding to the ? tokens in the string returned from getParamSql() to a prepared statement.
      boolean equals​(java.lang.Object o)  
      org.hibernate.criterion.Criterion getCriterion()
      Criterion used to construction an OnmsCritieria
      java.lang.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.
      java.lang.String getParamSql()
      Returns a parameterized SQL where clause.
      java.lang.String getSql()
      Returns an expression for a SQL where clause.
      java.lang.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.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SituationFilter

        public SituationFilter​(boolean situation)
    • Method Detail

      • getSql

        public java.lang.String getSql()
        Description copied from interface: Filter
        Returns an expression for a SQL where clause. Remember to include a trailing space, but no leading AND or OR.
        Specified by:
        getSql in interface Filter
        Returns:
        a String object.
      • getParamSql

        public java.lang.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
        Returns:
        a String object.
      • bindParam

        public int bindParam​(java.sql.PreparedStatement ps,
                             int parameterIndex)
                      throws java.sql.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
        Parameters:
        ps - a PreparedStatement object.
        parameterIndex - a int.
        Returns:
        a int.
        Throws:
        java.sql.SQLException - if any.
      • getDescription

        public java.lang.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:

        • "node=1"
        • "interface=192.168.0.1"
        • "severity=3"
        • "nodenamelike=opennms"

        Specified by:
        getDescription in interface Filter
        Returns:
        a String object.
      • getTextDescription

        public java.lang.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):

        • "node=nodelabel_of_node_1"
        • "interface=192.168.0.1"
        • "severity=Normal"
        • "node name containing \"opennms\""

        Specified by:
        getTextDescription in interface Filter
        Returns:
        a String object.
      • getCriterion

        public org.hibernate.criterion.Criterion getCriterion()
        Description copied from interface: Filter
        Criterion used to construction an OnmsCritieria
        Specified by:
        getCriterion in interface Filter
        Returns:
        A Criterion that represents a criteria restriction imposed by this filter
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object