LinkedMOFactory
, MOFactory
, MOTableRowFactory<DefaultMOMutableRow2PC>
SimMOFactory
public class DefaultMOFactory extends java.lang.Object implements MOFactory, LinkedMOFactory, MOTableRowFactory<DefaultMOMutableRow2PC>
DefaultMOFactory
is the default factory for creating
ManagedObjects. The default factory creates columnar and scalar objects
based on SNMPv2-TC textual conventions with appropriate constraints.
Other textual conventions can be added too.Modifier | Constructor | Description |
---|---|---|
protected |
DefaultMOFactory() |
Modifier and Type | Method | Description |
---|---|---|
static void |
addSNMPv2TCs(MOFactory factory) |
Adds support for SNMPv2TC textual conventions to the supplied ManagedObject
factory.
|
void |
addTextualConvention(TextualConvention tc) |
Adds a textual convention to this factory which can then be used by the
factory to create appropriate value constraints for columnar and scalar
managed objects.
|
DefaultMOMutableRow2PC |
createRow(org.snmp4j.smi.OID index,
org.snmp4j.smi.Variable[] values) |
Creates a new
MOTableRow row instance and returns it. |
void |
freeRow(DefaultMOMutableRow2PC row) |
Frees resources associated with the supplied row which is to be deleted.
|
static MOFactory |
getInstance() |
Returns the factory singleton with default support for SNMPv2-TC textual
conventions.
|
java.lang.Object |
getLink(org.snmp4j.smi.OID oid) |
Gets the link for the given object ID or any sub-OID prefix thereof.
|
<V extends org.snmp4j.smi.Variable> |
getTextualConvention(java.lang.String moduleName,
java.lang.String name) |
Gets the textual convention described by the TC's name and the MIB module
name of the MIB module specifying the TC.
|
protected java.util.Map<? extends java.lang.String,? extends java.util.Map<java.lang.String,TextualConvention>> |
getTextualConventions() |
|
protected void |
initLinkMap() |
|
void |
removeTextualConvention(TextualConvention tc) |
Removes the supplied textual convention from the supported TCs by this
ManagedObject factory.
|
static void |
setInstance(MOFactory factory) |
Sets the singleton factory.
|
void |
setLink(org.snmp4j.smi.OID oid,
java.lang.Object instrumentationHelperObject) |
Set a link between the supplied object ID of a managed object class (or
a set of managed object classes if the OID refers to a MIB sub-tree) to
the given helper object.
|
createAccess, createColumn, createColumn, createColumn, createColumn, createIndex, createIndex, createScalar, createScalar, createSubIndex, createSubIndex, createTable, createTable, createTableModel, createTableRelation, getSysUpTime
public static MOFactory getInstance()
public static void setInstance(MOFactory factory)
factory
- a MOFactory instance.public static void addSNMPv2TCs(MOFactory factory)
factory
- a MOFactory instance.protected java.util.Map<? extends java.lang.String,? extends java.util.Map<java.lang.String,TextualConvention>> getTextualConventions()
public void addTextualConvention(TextualConvention tc)
addTextualConvention
in interface MOFactory
tc
- a TextualConvention instance.public void removeTextualConvention(TextualConvention tc)
MOFactory
removeTextualConvention
in interface MOFactory
tc
- a TextualConvention instance.public <V extends org.snmp4j.smi.Variable> TextualConvention<V> getTextualConvention(java.lang.String moduleName, java.lang.String name)
MOFactory
getTextualConvention
in interface MOFactory
V
- the Variable
type that is the base type of the returned textual convention.moduleName
- the name of the MIB module that defines the TC.name
- the object name of the TC.TextualConvention
that matches the given values, or
null
if such a TC is not registered with this factory.public DefaultMOMutableRow2PC createRow(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] values) throws java.lang.UnsupportedOperationException
MOTableRowFactory
MOTableRow
row instance and returns it.createRow
in interface MOTableRowFactory<DefaultMOMutableRow2PC>
index
- the index OID for the new row.values
- the values to be contained in the new row.MOTableRow
.java.lang.UnsupportedOperationException
- if the specified row cannot be created.public void freeRow(DefaultMOMutableRow2PC row)
MOTableRowFactory
freeRow
in interface MOTableRowFactory<DefaultMOMutableRow2PC>
row
- a MOTableRow that has been created using this factory and is now to
be deleted (removed from the associated table).public void setLink(org.snmp4j.smi.OID oid, java.lang.Object instrumentationHelperObject)
LinkedMOFactory
setLink
in interface LinkedMOFactory
oid
- an OID of a managed object class or sub-tree.instrumentationHelperObject
- an object that helps the factory or the objects created on its behalf
to instrument the those objects.LinkedMOFactory.getLink(OID oid)
public java.lang.Object getLink(org.snmp4j.smi.OID oid)
LinkedMOFactory
getLink
in interface LinkedMOFactory
oid
- the oid of the managed object class (prefix) for which to returned the
linked instrumentation helper class.null
if no such link exists.protected void initLinkMap()
Copyright © 2018 SNMP4J.org. All rights reserved.