Class JsmiMibParser
- java.lang.Object
-
- org.opennms.features.mibcompiler.services.JsmiMibParser
-
- All Implemented Interfaces:
java.io.Serializable
,MibParser
public class JsmiMibParser extends java.lang.Object implements MibParser, java.io.Serializable
JSMIParser implementation of the interface MibParser.- Author:
- Alejandro Galue
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JsmiMibParser()
Instantiates a new JLIBSMI MIB parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Events
convertMibToEvents(org.jsmiparser.smi.SmiModule module, java.lang.String ueibase)
Convert MIB to events.DatacollectionGroup
getDataCollection()
Gets the data collection.Events
getEvents(java.lang.String ueibase)
Gets the event list.java.lang.String
getFormattedErrors()
Gets the formatted errors.protected Group
getGroup(DatacollectionGroup data, java.lang.String groupName, java.lang.String resourceType)
Gets the group.java.lang.String
getMibName()
Gets the MIB name.java.util.List<java.lang.String>
getMissingDependencies()
Gets the missing dependencies.java.util.List<PrefabGraph>
getPrefabGraphs()
Gets the prefab graph templates.protected Event
getTrapEvent(org.jsmiparser.smi.Notification trap, java.lang.String ueibase)
Gets the trap event.protected java.lang.String
getTrapEventDescr(org.jsmiparser.smi.Notification trap)
Gets the trap event description.protected java.lang.String
getTrapEventLabel(org.jsmiparser.smi.Notification trap)
Gets the trap event label.protected Logmsg
getTrapEventLogmsg(org.jsmiparser.smi.Notification trap)
Gets the trap event LogMsg.protected java.lang.String
getTrapEventUEI(org.jsmiparser.smi.Notification trap, java.lang.String ueibase)
Gets the trap event UEI.protected java.util.List<Varbindsdecode>
getTrapVarbindsDecode(org.jsmiparser.smi.Notification trap)
Gets the trap varbinds decode.boolean
parseMib(java.io.File mibFile)
Parses the MIB.void
setMibDirectory(java.io.File mibDirectory)
Sets the MIB directory.
-
-
-
Method Detail
-
setMibDirectory
public void setMibDirectory(java.io.File mibDirectory)
Description copied from interface:MibParser
Sets the MIB directory.- Specified by:
setMibDirectory
in interfaceMibParser
- Parameters:
mibDirectory
- the MIB directory
-
parseMib
public boolean parseMib(java.io.File mibFile)
Description copied from interface:MibParser
Parses the MIB.
-
getFormattedErrors
public java.lang.String getFormattedErrors()
Description copied from interface:MibParser
Gets the formatted errors.- Specified by:
getFormattedErrors
in interfaceMibParser
- Returns:
- the formatted errors
-
getMissingDependencies
public java.util.List<java.lang.String> getMissingDependencies()
Description copied from interface:MibParser
Gets the missing dependencies.- Specified by:
getMissingDependencies
in interfaceMibParser
- Returns:
- the missing dependencies
-
getMibName
public java.lang.String getMibName()
Description copied from interface:MibParser
Gets the MIB name.- Specified by:
getMibName
in interfaceMibParser
- Returns:
- the MIB name.
-
getEvents
public Events getEvents(java.lang.String ueibase)
Description copied from interface:MibParser
Gets the event list.
-
getDataCollection
public DatacollectionGroup getDataCollection()
Description copied from interface:MibParser
Gets the data collection.- Specified by:
getDataCollection
in interfaceMibParser
- Returns:
- the data collection group
-
getPrefabGraphs
public java.util.List<PrefabGraph> getPrefabGraphs()
Description copied from interface:MibParser
Gets the prefab graph templates.- Specified by:
getPrefabGraphs
in interfaceMibParser
- Returns:
- the prefab graph templates.
-
getGroup
protected Group getGroup(DatacollectionGroup data, java.lang.String groupName, java.lang.String resourceType)
Gets the group.- Parameters:
data
- the data collection group objectgroupName
- the group nameresourceType
- the resource type- Returns:
- the group
-
convertMibToEvents
protected Events convertMibToEvents(org.jsmiparser.smi.SmiModule module, java.lang.String ueibase)
Convert MIB to events.- Parameters:
module
- the module objectueibase
- the UEI base- Returns:
- the events
-
getTrapEvent
protected Event getTrapEvent(org.jsmiparser.smi.Notification trap, java.lang.String ueibase)
Gets the trap event.- Parameters:
trap
- the trap objectueibase
- the UEI base- Returns:
- the trap event
-
getTrapEventUEI
protected java.lang.String getTrapEventUEI(org.jsmiparser.smi.Notification trap, java.lang.String ueibase)
Gets the trap event UEI.- Parameters:
trap
- the trap objectueibase
- the UEI base- Returns:
- the trap event UEI
-
getTrapEventLabel
protected java.lang.String getTrapEventLabel(org.jsmiparser.smi.Notification trap)
Gets the trap event label.- Parameters:
trap
- the trap object- Returns:
- the trap event label
-
getTrapEventLogmsg
protected Logmsg getTrapEventLogmsg(org.jsmiparser.smi.Notification trap)
Gets the trap event LogMsg.- Parameters:
trap
- the trap object- Returns:
- the trap event LogMsg
-
getTrapEventDescr
protected java.lang.String getTrapEventDescr(org.jsmiparser.smi.Notification trap)
Gets the trap event description.- Parameters:
trap
- the trap object- Returns:
- the trap event description
-
getTrapVarbindsDecode
protected java.util.List<Varbindsdecode> getTrapVarbindsDecode(org.jsmiparser.smi.Notification trap)
Gets the trap varbinds decode.- Parameters:
trap
- the trap object- Returns:
- the trap varbinds decode
-
-