Package org.opennms.netmgt.dao.hibernate
Class IfLabelDaoImpl
- java.lang.Object
-
- org.opennms.netmgt.dao.util.AbstractIfLabel
-
- org.opennms.netmgt.dao.hibernate.IfLabelDaoImpl
-
- All Implemented Interfaces:
IfLabel
public class IfLabelDaoImpl extends AbstractIfLabel implements IfLabel
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
-
-
Field Summary
-
Fields inherited from interface org.opennms.netmgt.dao.api.IfLabel
NO_IFLABEL
-
-
Constructor Summary
Constructors Constructor Description IfLabelDaoImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetIfLabel(int nodeId, InetAddress ipAddr)getIfLabelStringgetIfLabelfromIfIndex(int nodeId, InetAddress ipAddr, int ifIndex)getIfLabelfromIfIndexStringgetIfLabelfromSnmpIfIndex(int nodeId, int ifIndex)Return the ifLabel as a string for the given node and ifIndex.static IfLabelgetInstance()Map<String,String>getInterfaceInfoFromIfLabel(int nodeId, String ifLabel)Return a map of useful SNMP information for the interface specified by the nodeId and ifLabel.voidsetSnmpInterfaceDao(SnmpInterfaceDao snmpInterfaceDao)-
Methods inherited from class org.opennms.netmgt.dao.util.AbstractIfLabel
getIfLabel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.dao.api.IfLabel
getIfLabel
-
-
-
-
Method Detail
-
getInstance
public static IfLabel getInstance()
-
getInterfaceInfoFromIfLabel
public Map<String,String> getInterfaceInfoFromIfLabel(int nodeId, String ifLabel)
Return a map of useful SNMP information for the interface specified by the nodeId and ifLabel. Essentially a "decoding" algorithm for the ifLabel.- Specified by:
getInterfaceInfoFromIfLabelin interfaceIfLabel- 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:
SQLException- if error occurs accessing the database.
-
getIfLabel
public String getIfLabel(int nodeId, InetAddress ipAddr)
getIfLabel
- Specified by:
getIfLabelin interfaceIfLabel- Parameters:
nodeId- a int.ipAddr- aStringobject.- Returns:
- a
Stringobject.
-
getIfLabelfromIfIndex
public String getIfLabelfromIfIndex(int nodeId, InetAddress ipAddr, int ifIndex)
getIfLabelfromIfIndex
- Specified by:
getIfLabelfromIfIndexin interfaceIfLabel- Parameters:
nodeId- a int.ipAddr- aStringobject.ifIndex- a int.- Returns:
- a
Stringobject.
-
getIfLabelfromSnmpIfIndex
public String getIfLabelfromSnmpIfIndex(int nodeId, int ifIndex)
Return the ifLabel as a string for the given node and ifIndex. Intended for use with non-ip interfaces.- Specified by:
getIfLabelfromSnmpIfIndexin interfaceIfLabel- Parameters:
nodeId- a int.ifIndex- a int.- Returns:
- String
-
setSnmpInterfaceDao
public void setSnmpInterfaceDao(SnmpInterfaceDao snmpInterfaceDao)
- Specified by:
setSnmpInterfaceDaoin interfaceIfLabel
-
-