org.opennms.netmgt.utils
Class IfLabel
java.lang.Object
org.opennms.netmgt.utils.IfLabel
- public class IfLabel
- extends java.lang.Object
A convenience class for methods to encode/decode ifLabel descriptions for
storing SNMP data in an RRD file.
- Author:
- Mike Davidson , Lawrence Karnowski , Seth Leger , OpenNMS
Field Summary |
protected static org.apache.log4j.Category |
log
|
Method Summary |
static java.lang.String |
getIfLabel(int nodeId,
java.lang.String ipAddr)
|
static java.lang.String |
getIfLabel(java.lang.String name,
java.lang.String descr,
java.lang.String physAddr)
|
static java.lang.String |
getIfLabelfromIfIndex(int nodeId,
java.lang.String ipAddr,
java.lang.String ifIndex)
|
static java.lang.String[] |
getIfLabels(int nodeId)
Get the interface labels for each interface on a given node. |
static java.util.Map |
getInterfaceInfoFromIfLabel(java.sql.Connection conn,
int nodeId,
java.lang.String ifLabel)
Return a map of useful SNMP information for the interface specified by
the nodeId and ifLabel. |
static java.util.Map |
getInterfaceInfoFromIfLabel(int nodeId,
java.lang.String ifLabel)
Return a map of useful SNMP information for the interface specified by
the nodeId and ifLabel. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.apache.log4j.Category log
IfLabel
public IfLabel()
getInterfaceInfoFromIfLabel
public static java.util.Map getInterfaceInfoFromIfLabel(java.sql.Connection conn,
int nodeId,
java.lang.String ifLabel)
throws java.sql.SQLException
- Return a map of useful SNMP information for the interface specified by
the nodeId and ifLabel. Essentially a "decoding" algorithm for the
ifLabel.
- Parameters:
conn
- Database connectionnodeId
- Node idifLabel
- Interface label of format: -
- Returns:
- Map of SNMP info keyed by 'snmpInterface' table column names for
the interface specified by nodeId and ifLabel args.
- Throws:
java.sql.SQLException
- if error occurs accessing the database.
getInterfaceInfoFromIfLabel
public static java.util.Map getInterfaceInfoFromIfLabel(int nodeId,
java.lang.String ifLabel)
throws java.sql.SQLException
- Return a map of useful SNMP information for the interface specified by
the nodeId and ifLabel. Essentially a "decoding" algorithm for the
ifLabel.
Overloaded method which first obtains a database connection from the
vault.
- Parameters:
nodeId
- Node idifLabel
- Interface label of format: -
- Returns:
- Map of SNMP info keyed by 'snmpInterface' table column names for
the interface specified by nodeId and ifLabel args.
- Throws:
java.sql.SQLException
- if error occurs accessing the database.
getIfLabels
public static java.lang.String[] getIfLabels(int nodeId)
throws java.sql.SQLException
- Get the interface labels for each interface on a given node.
- Throws:
java.sql.SQLException
getIfLabel
public static java.lang.String getIfLabel(int nodeId,
java.lang.String ipAddr)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getIfLabelfromIfIndex
public static java.lang.String getIfLabelfromIfIndex(int nodeId,
java.lang.String ipAddr,
java.lang.String ifIndex)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getIfLabel
public static java.lang.String getIfLabel(java.lang.String name,
java.lang.String descr,
java.lang.String physAddr)
Generated by eevans on May 29 2005 2015.