Package org.opennms.netmgt.events.api
Class EventDatabaseConstants
- java.lang.Object
-
- org.opennms.netmgt.events.api.EventConstants
-
- org.opennms.netmgt.events.api.EventDatabaseConstants
-
public class EventDatabaseConstants extends EventConstants
This class contains the constants and methods related to inserting events into the database- Author:
- Sowmya Kumaraswamy
-
-
Field Summary
Fields Modifier and Type Field Description 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 valuesstatic 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_DELIMstatic 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 columnstatic 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 '= ' strings 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-
Fields inherited from class org.opennms.netmgt.events.api.EventConstants
ABSOLUTE_CHANGE_THRESHOLD_EVENT_UEI, ACKNOWLEDGE_EVENT_UEI, ADD_NODE_EVENT_UEI, APPLICATION_CHANGED_EVENT_UEI, APPLICATION_CREATED_EVENT_UEI, APPLICATION_DELETED_EVENT_UEI, ASSET_INFO_CHANGED_EVENT_UEI, BMP_PEER_DOWN, BMP_PEER_UP, BUSINESS_SERVICE_DELETED_EVENT_UEI, BUSINESS_SERVICE_GRAPH_INVALIDATED, BUSINESS_SERVICE_OPERATIONAL_STATUS_CHANGED_UEI, BUSINESS_SERVICE_PROBLEM_RESOLVED_UEI, BUSINESS_SERVICE_PROBLEM_UEI, CONFIGURE_SNMP_EVENT_UEI, DATA_COLLECTION_FAILED_EVENT_UEI, DATA_COLLECTION_SUCCEEDED_EVENT_UEI, DELETE_INTERFACE_EVENT_UEI, DELETE_NODE_EVENT_UEI, DELETE_SERVICE_EVENT_UEI, DISC_PAUSE_EVENT_UEI, DISC_RESUME_EVENT_UEI, DISCOVERYCONFIG_CHANGED_EVENT_UEI, DROOLS_ENGINE_ENCOUNTERED_EXCEPTION, DUP_NODE_DELETED_EVENT_UEI, EVENTSCONFIG_CHANGED_EVENT_UEI, FORCE_RESCAN_EVENT_UEI, HARDWARE_INVENTORY_FAILED_UEI, HARDWARE_INVENTORY_SUCCESSFUL_UEI, HIGH_THRESHOLD_EVENT_UEI, HIGH_THRESHOLD_REARM_EVENT_UEI, IMPORT_FAILED_UEI, IMPORT_STARTED_UEI, IMPORT_SUCCESSFUL_UEI, INTERFACE_DELETED_EVENT_UEI, INTERFACE_DOWN_EVENT_UEI, INTERFACE_REPARENTED_EVENT_UEI, INTERFACE_UP_EVENT_UEI, KSC_REPORT_UPDATED_UEI, LOCATION_MONITOR_CONNECTION_ADDRESS_CHANGED_UEI, LOCATION_MONITOR_DISCONNECTED_UEI, LOCATION_MONITOR_PAUSED_UEI, LOCATION_MONITOR_RECONNECTED_UEI, LOCATION_MONITOR_REGISTERED_UEI, LOCATION_MONITOR_STARTED_UEI, LOCATION_MONITOR_STOPPED_UEI, LOW_THRESHOLD_EVENT_UEI, LOW_THRESHOLD_REARM_EVENT_UEI, MONITORING_SYSTEM_ADDED_UEI, MONITORING_SYSTEM_DELETED_UEI, MONITORING_SYSTEM_LOCATION_CHANGED_UEI, NEW_SUSPECT_INTERFACE_EVENT_UEI, NODE_ADDED_EVENT_UEI, NODE_CATEGORY_MEMBERSHIP_CHANGED_EVENT_UEI, NODE_CONFIG_CHANGE_UEI, NODE_DELETED_EVENT_UEI, NODE_DOWN_EVENT_UEI, NODE_GAINED_INTERFACE_EVENT_UEI, NODE_GAINED_SERVICE_EVENT_UEI, NODE_INFO_CHANGED_EVENT_UEI, NODE_LABEL_CHANGED_EVENT_UEI, NODE_LOCATION_CHANGED_EVENT_UEI, NODE_LOST_SERVICE_EVENT_UEI, NODE_REGAINED_SERVICE_EVENT_UEI, NODE_UP_EVENT_UEI, NODE_UPDATED_EVENT_UEI, NOTIFICATION_WITHOUT_USERS, OID_SNMP_IFINDEX, OUTAGE_CREATED_EVENT_UEI, OUTAGE_RESOLVED_EVENT_UEI, PARAM_MONITORING_SYSTEM_ID, PARAM_MONITORING_SYSTEM_LOCATION, PARAM_MONITORING_SYSTEM_PREV_LOCATION, PARAM_MONITORING_SYSTEM_TYPE, PARAM_REPORT_GRAPH_COUNT, PARAM_REPORT_TITLE, PARAM_TOPOLOGY_NAMESPACE, PARM_ACTION, PARM_ALARM_ID, PARM_ALARM_REDUCTION_KEY, PARM_ALARM_UEI, PARM_APPLICATION_ID, PARM_APPLICATION_NAME, PARM_BUSINESS_SERVICE_ID, PARM_BUSINESS_SERVICE_NAME, PARM_CAT_LABEL, PARM_CATEGORIES_ADDED, PARM_CATEGORIES_DELETED, PARM_COMMUNITY_STRING, PARM_CONFIG_FILE_NAME, PARM_CRITICAL_PATH_IP, PARM_CRITICAL_PATH_NOTICE_SUPRESSED, PARM_CRITICAL_PATH_SVC, PARM_DAEMON_NAME, PARM_DPNAME, PARM_ENDPOINT1, PARM_ENDPOINT2, PARM_FAILURE_MESSAGE, PARM_FILES_TO_PROMOTE, PARM_FIRST_IP_ADDRESS, PARM_FOREIGN_ID, PARM_FOREIGN_SOURCE, PARM_IGNORE_UNMANAGED, PARM_IMPORT_RESCAN_EXISTING, PARM_IMPORT_RESOURCE, PARM_IMPORT_STATS, PARM_INTERFACE, PARM_IP_HOSTNAME, PARM_LAST_IP_ADDRESS, PARM_LOCATION, PARM_LOCATION_MONITOR_ID, PARM_LOSTSERVICE_REASON, PARM_METHOD, PARM_NEW_IFINDEX, PARM_NEW_NODE_LABEL, PARM_NEW_NODE_LABEL_SOURCE, PARM_NEW_NODEID, PARM_NEW_PRIMARY_SNMP_ADDRESS, PARM_NEW_SEVERITY_ID, PARM_NEW_SEVERITY_LABEL, PARM_NODE_CURRENT_LOCATION, PARM_NODE_DOMAIN_NAME, PARM_NODE_LABEL, PARM_NODE_LABEL_SOURCE, PARM_NODE_NETBIOS_NAME, PARM_NODE_OPERATING_SYSTEM, PARM_NODE_PREV_LOCATION, PARM_NODE_SYSCONTACT, PARM_NODE_SYSDESCRIPTION, PARM_NODE_SYSLOCATION, PARM_NODE_SYSNAME, PARM_NODE_SYSOID, PARM_OLD_IFINDEX, PARM_OLD_IP_HOSTNAME, PARM_OLD_NODE_LABEL, PARM_OLD_NODE_LABEL_SOURCE, PARM_OLD_NODEID, PARM_OLD_PRIMARY_SNMP_ADDRESS, PARM_PASSIVE_IPADDR, PARM_PASSIVE_NODE_LABEL, PARM_PASSIVE_REASON_CODE, PARM_PASSIVE_SERVICE_NAME, PARM_PASSIVE_SERVICE_STATUS, PARM_PASSWD, PARM_PORT, PARM_PREV_SEVERITY_ID, PARM_PREV_SEVERITY_LABEL, PARM_QUALIFIER, PARM_REASON, PARM_REPORT_NAME, PARM_RESCAN_EXISTING, PARM_RETRY_COUNT, PARM_SERVICE_STATUS, PARM_SNMP_AUTH_PASSPHRASE, PARM_SNMP_AUTH_PROTOCOL, PARM_SNMP_CONTEXT_ENGINE_ID, PARM_SNMP_CONTEXT_NAME, PARM_SNMP_ENGINE_ID, PARM_SNMP_ENTERPRISE_ID, PARM_SNMP_INTERFACE_ALIAS, PARM_SNMP_INTERFACE_DESC, PARM_SNMP_INTERFACE_IFINDEX, PARM_SNMP_INTERFACE_IP, PARM_SNMP_INTERFACE_MASK, PARM_SNMP_INTERFACE_NAME, PARM_SNMP_LOCATION, PARM_SNMP_MAX_REPETITIONS, PARM_SNMP_MAX_REQUEST_SIZE, PARM_SNMP_MAX_VARS_PER_PDU, PARM_SNMP_PRIVACY_PASSPHRASE, PARM_SNMP_PRIVACY_PROTOCOL, PARM_SNMP_PROXY_HOST, PARM_SNMP_READ_COMMUNITY_STRING, PARM_SNMP_SECURITY_LEVEL, PARM_SNMP_SECURITY_NAME, PARM_SNMP_WRITE_COMMUNITY_STRING, PARM_TIMEOUT, PARM_TRANSACTION_NO, PARM_TROUBLE_TICKET, PARM_TTL, PARM_URL, PARM_USER, PARM_VALUE_PATHOUTAGE, PARM_VERSION, PATH_OUTAGE_EVENT_UEI, PERSPECTIVE_NODE_LOST_SERVICE_UEI, PERSPECTIVE_NODE_REGAINED_SERVICE_UEI, POSTGRES_DATE_FORMAT, PRIMARY_SNMP_INTERFACE_CHANGED_EVENT_UEI, PROMOTE_QUEUE_DATA_UEI, PROVISION_SCAN_ABORTED_UEI, PROVISION_SCAN_COMPLETE_UEI, PROVISION_SCHEDULED_NODE_SCAN_STARTED, PROVISIONING_ADAPTER_FAILED, RANCID_DOWNLOAD_FAILURE_UEI, RANCID_DOWNLOAD_SUCCESS_UEI, RANCID_GROUP_PROCESSING_COMPLETED_UEI, REARMING_ABSOLUTE_CHANGE_EXCEEDED_EVENT_UEI, REARMING_ABSOLUTE_CHANGE_REARM_EVENT_UEI, REINITIALIZE_PRIMARY_SNMP_INTERFACE_EVENT_UEI, RELATIVE_CHANGE_THRESHOLD_EVENT_UEI, RELOAD_DAEMON_CONFIG_FAILED_UEI, RELOAD_DAEMON_CONFIG_SUCCESSFUL_UEI, RELOAD_DAEMON_CONFIG_UEI, RELOAD_IMPORT_UEI, RELOAD_TOPOLOGY_UEI, RELOAD_VACUUMD_CONFIG_UEI, REMOTE_SUCCESSFUL_SCAN_REPORT_UEI, REMOTE_UNSUCCESSFUL_SCAN_REPORT_UEI, REPORT_DELIVERY_FAILED_UEI, REPORT_RUN_FAILED_UEI, REPORTD_RUN_REPORT, RESCAN_COMPLETED_EVENT_UEI, RESUME_POLLING_SERVICE_EVENT_UEI, RTC_SUBSCRIBE_EVENT_UEI, RTC_UNSUBSCRIBE_EVENT_UEI, SCHEDOUTAGES_CHANGED_EVENT_UEI, SERVICE_DELETED_EVENT_UEI, SERVICE_RESPONSIVE_EVENT_UEI, SERVICE_UNMANAGED_EVENT_UEI, SERVICE_UNRESPONSIVE_EVENT_UEI, SITUATION_EVENT_UEI, SNMP_INTERFACE_ADMIN_DOWN_EVENT_UEI, SNMP_INTERFACE_ADMIN_UP_EVENT_UEI, SNMP_INTERFACE_OPER_DORMANT_EVENT_UEI, SNMP_INTERFACE_OPER_DOWN_EVENT_UEI, SNMP_INTERFACE_OPER_LOWER_LAYER_DOWN_EVENT_UEI, SNMP_INTERFACE_OPER_NOT_PRESENT_EVENT_UEI, SNMP_INTERFACE_OPER_TESTING_EVENT_UEI, SNMP_INTERFACE_OPER_UNKNOWN_EVENT_UEI, SNMP_INTERFACE_OPER_UP_EVENT_UEI, SNMPPOLLERCONFIG_CHANGED_EVENT_UEI, STATE_ON, SUSPEND_POLLING_SERVICE_EVENT_UEI, THRESHOLDCONFIG_CHANGED_EVENT_UEI, TL1_AUTONOMOUS_MESSAGE_UEI, TOPOLOGY_LINK_DOWN_EVENT_UEI, TOPOLOGY_LINK_UP_EVENT_UEI, TROUBLETICKET_CANCEL_UEI, TROUBLETICKET_CLOSE_UEI, TROUBLETICKET_CREATE_UEI, TROUBLETICKET_UPDATE_UEI, TYPE_INT, TYPE_SNMP_COUNTER32, TYPE_SNMP_COUNTER64, TYPE_SNMP_GAUGE32, TYPE_SNMP_INT32, TYPE_SNMP_IPADDRESS, TYPE_SNMP_NULL, TYPE_SNMP_OBJECT_IDENTIFIER, TYPE_SNMP_OCTET_STRING, TYPE_SNMP_OPAQUE, TYPE_SNMP_SEQUENCE, TYPE_SNMP_TIMETICKS, TYPE_STRING, XML_ENCODING_BASE64, XML_ENCODING_MAC_ADDRESS, XML_ENCODING_TEXT
-
-
Constructor Summary
Constructors Constructor Description EventDatabaseConstants()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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 origString, int maxlen)
This method is passed a string to be truncated to the maximum string size passed.static java.lang.String
format(java.util.List<java.lang.String> 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.-
Methods inherited from class org.opennms.netmgt.events.api.EventConstants
formatToString, getValueAsString, parseToDate, toHexString, toString
-
-
-
-
Field Detail
-
NAME_VAL_DELIM
public 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 '= ' strings - See Also:
- Constant Field Values
-
MULTIPLE_VAL_DELIM
public 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
public 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
public 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
public 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
-
-
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 delimiterdelimchar
- delimiter to escape- Returns:
- The string with the delimiter escaped as in URLs
- See Also:
DB_ATTRIB_DELIM
,MULTIPLE_VAL_DELIM
,DB_ATTRIB_DELIM
,MULTIPLE_VAL_DELIM
-
format
public static java.lang.String format(java.util.List<java.lang.String> 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 origString, int maxlen)
This method is passed a string to be truncated to the maximum string size passed.- Parameters:
maxlen
- The maximum length of the composite stringorigString
- aString
object.- Returns:
- The string(truncated if necessary).
-
-