OpenNMS API 1.2.9

## org.opennms.netmgt.eventd.db
Class Constants

    java.lang.Object
      org.opennms.netmgt.eventd.db.Constants

public class Constants
extends java.lang.Object

This class contains the constants and methods related to inserting events into the database

Author:
  Sowmya Kumaraswamy , OpenNMS

Field Summary
`(package private) static java.lang.String` `ATTRIB_DELIM` The parser adds the value and attributes of an element to a single element of eventBlock and uses the ATTRIB_DELIM to separate these values
`(package private) static char` `DB_ATTRIB_DELIM` The values and the corresponding attributes of an element are added to a single column of the table and delimited by DB_ATTRIB_DELIM
`(package private) static char` `MULTIPLE_VAL_DELIM` The delimiter used to delimit multiple values of the same element that are appended and made the value of a single database column
`(package private) static char` `NAME_VAL_DELIM` The 'parms' are added to a single column of the DB - the parm name and value are added as delimiter separated list of ' <parmName>= <value>' strings
`static int` `SEV_CLEARED` Enumerated values for severity being unimplemented at this time
`static int` `SEV_CRITICAL` Enumerated values for severity is critical
`static int` `SEV_INDETERMINATE` Enumerated values for severity being indeterminate
`static int` `SEV_MAJOR` Enumerated values for severity is major
`static int` `SEV_MINOR` Enumerated values for severity is minor
`static int` `SEV_NORMAL` Enumerated values for severity indicates a warning
`static int` `SEV_WARNING` Enumerated values for severity indicates a warning
`(package private) static int` `STATE_OFF` Enumerated value for the state(tticket and forward) when entry is not active
`(package private) static int` `STATE_ON` Enumerated value for the state(tticket and forward) when entry is active
`(package private) static java.lang.String` `VALUE_TRUNCATE_INDICATOR` Multiple values of any xml element are appended into one value when inserted into the database - if the length of the appended string exceeds the column length, the value is appended with this pattern

Constructor Summary
`Constants()`

Method Summary
`static java.lang.String` `escape(java.lang.String inStr, char delimchar)` This method is used to escape required values from strings that may contain those values.
`static java.lang.String` `format(java.util.List strings, int maxlen)` This method is passed a list of strings and a maximum string size that must not be exceeded by the composite string.
`static java.lang.String` `format(java.lang.String[] strings, int maxlen)` This method is passed an array of strings and a maximum string size that must not be exceeded by the composite string.
`static java.lang.String` `format(java.lang.String string, int maxlen)` This method is passed a string to be truncated to the maximum string size passed.
`static int` `getSeverity(java.lang.String sev)` Converts the severity to an integer

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SEV_INDETERMINATE

    public static final int SEV_INDETERMINATE

  Enumerated values for severity being indeterminate

  See Also:
    Constant Field Values

### SEV_CLEARED

    public static final int SEV_CLEARED

  Enumerated values for severity being unimplemented at this time

  See Also:
    Constant Field Values

### SEV_NORMAL

    public static final int SEV_NORMAL

  Enumerated values for severity indicates a warning

  See Also:
    Constant Field Values

### SEV_WARNING

    public static final int SEV_WARNING

  Enumerated values for severity indicates a warning

  See Also:
    Constant Field Values

### SEV_MINOR

    public static final int SEV_MINOR

  Enumerated values for severity is minor

  See Also:
    Constant Field Values

### SEV_MAJOR

    public static final int SEV_MAJOR

  Enumerated values for severity is major

  See Also:
    Constant Field Values

### SEV_CRITICAL

    public static final int SEV_CRITICAL

  Enumerated values for severity is critical

  See Also:
    Constant Field Values

### STATE_ON

    static final int STATE_ON

  Enumerated value for the state(tticket and forward) when entry is active

  See Also:
    Constant Field Values

### STATE_OFF

    static final int STATE_OFF

  Enumerated value for the state(tticket and forward) when entry is not active

  See Also:
    Constant Field Values

### NAME_VAL_DELIM

    static final char NAME_VAL_DELIM

  The 'parms' are added to a single column of the DB - the parm name and value are added as delimiter separated list of ' <parmName>= <value>' strings

  See Also:
    Constant Field Values

### MULTIPLE_VAL_DELIM

    static final char MULTIPLE_VAL_DELIM

  The delimiter used to delimit multiple values of the same element that are appended and made the value of a single database column

  See Also:
    Constant Field Values

### ATTRIB_DELIM

    static final java.lang.String ATTRIB_DELIM

  The parser adds the value and attributes of an element to a single element of eventBlock and uses the ATTRIB_DELIM to separate these values

  See Also:
    Constant Field Values

### DB_ATTRIB_DELIM

    static final char DB_ATTRIB_DELIM

  The values and the corresponding attributes of an element are added to a single column of the table and delimited by DB_ATTRIB_DELIM

  See Also:
    Constant Field Values

### VALUE_TRUNCATE_INDICATOR

    static final java.lang.String VALUE_TRUNCATE_INDICATOR

  Multiple values of any xml element are appended into one value when inserted into the database - if the length of the appended string exceeds the column length, the value is appended with this pattern

  See Also:
    Constant Field Values

Constructor Detail

### Constants

    public Constants()

Method Detail

### escape

    public static java.lang.String escape(java.lang.String inStr,
                                          char delimchar)

  This method is used to escape required values from strings that may contain those values. If the passed string contains the passed value then the character is reformatted into its %dd format.

  Parameters:
    `inStr` - string that might contain the delimiter
    `delimchar` - delimiter to escape
  Returns:
    The string with the delimiter escaped as in URLs
  See Also:
    `DB_ATTRIB_DELIM`, `MULTIPLE_VAL_DELIM`

### format

    public static java.lang.String format(java.util.List strings,
                                          int maxlen)

  This method is passed a list of strings and a maximum string size that must not be exceeded by the composite string.

  Parameters:
    `strings` - The list of String objects.
    `maxlen` - The maximum length of the composite string
  Returns:
    The composite string.
  Throws:
    `java.lang.ClassCastException` - Thrown if any processed item in the list is not a string object.

### format

    public static java.lang.String format(java.lang.String[] strings,
                                          int maxlen)

  This method is passed an array of strings and a maximum string size that must not be exceeded by the composite string.

  Parameters:
    `strings` - The list of String objects.
    `maxlen` - The maximum length of the composite string
  Returns:
    The composite string.
  Throws:
    `java.lang.ClassCastException` - Thrown if any processed item in the list is not a string object.

### format

    public static java.lang.String format(java.lang.String string,
                                          int maxlen)

  This method is passed a string to be truncated to the maximum string size passed.

  Parameters:
    `string` - The string object.
    `maxlen` - The maximum length of the composite string
  Returns:
    The string(truncated if necessary).

### getSeverity

    public static int getSeverity(java.lang.String sev)

  Converts the severity to an integer

  Returns:
    integer equivalent for the severity

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.