Package org.opennms.netmgt.dao.util
Class SnmpInfo
- java.lang.Object
-
- org.opennms.netmgt.dao.util.SnmpInfo
-
public abstract class SnmpInfo extends java.lang.Object
This class is used to format the Snmp block into an appropiate string for storage in the event data storage.- Author:
- Brian Weaver , OpenNMS
-
-
Constructor Summary
Constructors Constructor Description SnmpInfo()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Snmp
createSnmp(java.lang.String eventSnmp)
Tries to create Snmp Object from formatted eventSnmp String.static java.lang.String
format(Snmp info, int maxlen)
Converts the SNMP information from the event into a string that can be stored into the database.
-
-
-
Method Detail
-
format
public static java.lang.String format(Snmp info, int maxlen)
Converts the SNMP information from the event into a string that can be stored into the database. The information is formatted in by separating the of the textual fields with a delimiter character (a comma ',').
If the enterprise id text information is not present then the string will have only two commas. An extra comma is not added to signify the missing field.
- Parameters:
info
- aSnmp
object.maxlen
- a int.- Returns:
- The smnpblock as a string
- See Also:
EventDatabaseConstants.DB_ATTRIB_DELIM
,EventDatabaseConstants.escape(java.lang.String, char)
,EventDatabaseConstants.DB_ATTRIB_DELIM
,EventDatabaseConstants.escape(java.lang.String, char)
-
createSnmp
public static Snmp createSnmp(java.lang.String eventSnmp)
Tries to create Snmp Object from formatted eventSnmp String.- Parameters:
eventSnmp
- formatted snmp string that has all the @Snmp fields.- Returns:
- snmp Snmp object created or null if it can't be created.
-
-