org.snmp4j.agent.mo
Interface MOFactory

All Superinterfaces:
MOTableRowFactory
All Known Subinterfaces:
LinkedMOFactory
All Known Implementing Classes:
DefaultMOFactory, SimMOFactory

public interface MOFactory
extends MOTableRowFactory

The MOFactory interface provides factory methods for creating all types of managed objects known by SNMP4J-Agent. By using this factory instead of creating the managed objects and related objects directly, one can easily install a sort of aspect oriented layer into the managed object instrumentation.

Version:
1.1
Author:
Frank Fock

Method Summary
 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.
 MOAccess createAccess(int moAccess)
          Creates an MOAccess instance from an access specification constant that is the result of a bitwise OR of any of the constants defined by MOAccess.
 MOColumn createColumn(int columnID, int syntax, MOAccess access)
          Creates a columnar object by supplying column ID, syntax, and maximum access.
 MOColumn createColumn(int columnID, int syntax, MOAccess access, java.lang.String tcModuleName, java.lang.String textualConvention)
          Creates a columnar object by supplying column ID, syntax, and maximum access.
 MOColumn createColumn(int columnID, int syntax, MOAccess access, org.snmp4j.smi.Variable defaultValue, boolean mutableInService)
          Creates a columnar object by supplying column ID, syntax, and maximum access.
 MOColumn createColumn(int columnID, int syntax, MOAccess access, org.snmp4j.smi.Variable defaultValue, boolean mutableInService, java.lang.String tcModuleName, java.lang.String textualConvention)
          Creates a columnar object by supplying column ID, syntax, and maximum access.
 MOTableIndex createIndex(MOTableSubIndex[] subIndexes, boolean impliedLength)
          Creates an index definition from the supplied sub-index definitions without index validation.
 MOTableIndex createIndex(MOTableSubIndex[] subIndexes, boolean impliedLength, MOTableIndexValidator validator)
          Creates an index definition from the supplied sub-index definitions with index validation according to the supplied validator.
 MOScalar createScalar(org.snmp4j.smi.OID id, MOAccess access, org.snmp4j.smi.Variable value)
          Creates a scalar object from a OID, maximum access, and value.
 MOScalar createScalar(org.snmp4j.smi.OID id, MOAccess access, org.snmp4j.smi.Variable value, java.lang.String tcModuleName, java.lang.String textualConvention)
          Creates a scalar object from a OID, maximum access, and value.
 MOTableSubIndex createSubIndex(org.snmp4j.smi.OID oid, int smiSyntax)
          Creates a sub-index definition.
 MOTableSubIndex createSubIndex(org.snmp4j.smi.OID oid, int smiSyntax, int minLength, int maxLength)
          Creates a sub-index definition.
 MOTable createTable(org.snmp4j.smi.OID oid, MOTableIndex indexDef, MOColumn[] columns)
          Creates a MOTable instance for the supplied OID, index definition, and columns with the DefaultMOMutableTableModel as table model.
 MOTable createTable(org.snmp4j.smi.OID oid, MOTableIndex indexDef, MOColumn[] columns, MOTableModel model)
          Creates a MOTable instance for the supplied OID, index definition, columns, and table model.
 MOTableModel createTableModel(org.snmp4j.smi.OID tableOID, MOTableIndex indexDef, MOColumn[] columns)
          Creates a table model (by default a DefaultMOMutableTableModel).
 MOTableRelation createTableRelation(MOTable baseTable, MOTable dependentTable)
          Creates a relation between two tables.
 TextualConvention 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.
 void removeTextualConvention(TextualConvention tc)
          Removes the supplied textual convention from the supported TCs by this ManagedObject factory.
 
Methods inherited from interface org.snmp4j.agent.mo.MOTableRowFactory
createRow, freeRow
 

Method Detail

addTextualConvention

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.

Parameters:
tc - a TextualConvention instance.

removeTextualConvention

void removeTextualConvention(TextualConvention tc)
Removes the supplied textual convention from the supported TCs by this ManagedObject factory.

Parameters:
tc - a TextualConvention instance.

getTextualConvention

TextualConvention 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.

Parameters:
moduleName - the name of the MIB module that defines the TC.
name - the object name of the TC.
Returns:
the TextualConvention that matches the given values, or null if such a TC is not registered with this factory.

createAccess

MOAccess createAccess(int moAccess)
Creates an MOAccess instance from an access specification constant that is the result of a bitwise OR of any of the constants defined by MOAccess.

Parameters:
moAccess - any bitwise OR combined constant from MOAccess.
Returns:
a MOAccess instance.

createTable

MOTable createTable(org.snmp4j.smi.OID oid,
                    MOTableIndex indexDef,
                    MOColumn[] columns)
Creates a MOTable instance for the supplied OID, index definition, and columns with the DefaultMOMutableTableModel as table model.

Parameters:
oid - the OID of the table entry (thus table OID + ".1").
indexDef - the index defintion of the table.
columns - the columns for the new table as an array of MOColumn instances.
Returns:
a MOTable instance.

createTable

MOTable createTable(org.snmp4j.smi.OID oid,
                    MOTableIndex indexDef,
                    MOColumn[] columns,
                    MOTableModel model)
Creates a MOTable instance for the supplied OID, index definition, columns, and table model.

Parameters:
oid - the OID of the table entry (thus table OID + ".1").
indexDef - the index defintion of the table.
columns - the columns for the new table as an array of MOColumn instances.
model - the table model to use for the table.
Returns:
a MOTable instance.

createIndex

MOTableIndex createIndex(MOTableSubIndex[] subIndexes,
                         boolean impliedLength)
Creates an index definition from the supplied sub-index definitions without index validation.

Parameters:
subIndexes - an array of MOTableSubIndex instances defining the sub- index values of this index.
impliedLength - indicates whether the last variable length sub-index value has an implied length or not (default is false).
Returns:
MOTableIndex a MOTableIndex instance.

createIndex

MOTableIndex createIndex(MOTableSubIndex[] subIndexes,
                         boolean impliedLength,
                         MOTableIndexValidator validator)
Creates an index definition from the supplied sub-index definitions with index validation according to the supplied validator.

Parameters:
subIndexes - an array of MOTableSubIndex instances defining the sub- index values of this index.
impliedLength - indicates whether the last variable length sub-index value has an implied length or not (default is false).
validator - an index validator to check index values.
Returns:
MOTableIndex a MOTableIndex instance.

createSubIndex

MOTableSubIndex createSubIndex(org.snmp4j.smi.OID oid,
                               int smiSyntax)
Creates a sub-index definition.

Parameters:
oid - the object identifier of the OBJECT-TYPE that defines this sub-index or null if that information is not available. An non null is required for AgentX shared tables.
smiSyntax - the SMI syntax as defined by SMIConstants.
Returns:
a MOTableSubIndex instance.
Since:
1.1

createSubIndex

MOTableSubIndex createSubIndex(org.snmp4j.smi.OID oid,
                               int smiSyntax,
                               int minLength,
                               int maxLength)
Creates a sub-index definition.

Parameters:
oid - the object identifier of the OBJECT-TYPE that defines this sub-index or null if that information is not available. An non null is required for AgentX shared tables.
smiSyntax - the SMI syntax as defined by SMIConstants.
minLength - the minimum length in sub-identifiers (without length sub-id) of the sub-index.
maxLength - the maximum length in sub-identifiers (without length sub-id) of the sub-index.
Returns:
a MOTableSubIndex instance.
Since:
1.1

createColumn

MOColumn createColumn(int columnID,
                      int syntax,
                      MOAccess access)
Creates a columnar object by supplying column ID, syntax, and maximum access. Use this method for columns not based on a textual convention.

Parameters:
columnID - the column ID of the column. The column ID is the last sub-identifier of a column definition. It is NOT the index of the column.
syntax - the SMI syntax of the column as defined by SMIConstants.
access - the maximum access supported by this column.
Returns:
a MOColumn instance.

createColumn

MOColumn createColumn(int columnID,
                      int syntax,
                      MOAccess access,
                      java.lang.String tcModuleName,
                      java.lang.String textualConvention)
Creates a columnar object by supplying column ID, syntax, and maximum access. Use this method for columns based on the textual convention.

Parameters:
columnID - the column ID of the column. The column ID is the last sub-identifier of a column definition. It is NOT the index of the column.
syntax - the (effective) SMI syntax of the column as defined by SMIConstants.
access - the maximum access supported by this column.
tcModuleName - the MIB module name that defines the textual conventions.
textualConvention - the object name of the textual convention on which this column is based.
Returns:
a MOColumn instance.

createColumn

MOColumn createColumn(int columnID,
                      int syntax,
                      MOAccess access,
                      org.snmp4j.smi.Variable defaultValue,
                      boolean mutableInService)
Creates a columnar object by supplying column ID, syntax, and maximum access. Use this method for columns based on the textual convention.

Parameters:
columnID - the column ID of the column. The column ID is the last sub-identifier of a column definition. It is NOT the index of the column.
syntax - the (effective) SMI syntax of the column as defined by SMIConstants.
access - the maximum access supported by this column.
defaultValue - the default value defined by the DEFVAL clause for this column.
mutableInService - if true this object may be changed while it is active (inService), otherwise such an attempt will be rejected with a inconsistentValue error.
Returns:
a MOColumn instance.

createColumn

MOColumn createColumn(int columnID,
                      int syntax,
                      MOAccess access,
                      org.snmp4j.smi.Variable defaultValue,
                      boolean mutableInService,
                      java.lang.String tcModuleName,
                      java.lang.String textualConvention)
Creates a columnar object by supplying column ID, syntax, and maximum access. Use this method for columns based on the textual convention.

Parameters:
columnID - the column ID of the column. The column ID is the last sub-identifier of a column definition. It is NOT the index of the column.
syntax - the (effective) SMI syntax of the column as defined by SMIConstants.
access - the maximum access supported by this column.
defaultValue - the default value defined by the DEFVAL clause for this column.
mutableInService - if true this object may be changed while it is active (inService), otherwise such an attempt will be rejected with a inconsistentValue error.
tcModuleName - the MIB module name that defines the textual conventions.
textualConvention - the object name of the textual convention on which this column is based.
Returns:
a MOColumn instance.

createTableModel

MOTableModel createTableModel(org.snmp4j.smi.OID tableOID,
                              MOTableIndex indexDef,
                              MOColumn[] columns)
Creates a table model (by default a DefaultMOMutableTableModel).

Parameters:
tableOID - the table's OID for which this model is created.
indexDef - the index definition for the table.
columns - the columns defined for the table.
Returns:
a MOTableModel instance.
Since:
1.1

createScalar

MOScalar createScalar(org.snmp4j.smi.OID id,
                      MOAccess access,
                      org.snmp4j.smi.Variable value)
Creates a scalar object from a OID, maximum access, and value.

Parameters:
id - the OID of the scalar (including the .0 suffix).
access - the maximum access supported by this scalar.
value - the (initial) value of the scalar.
Returns:
a MOScalar instance.

createScalar

MOScalar createScalar(org.snmp4j.smi.OID id,
                      MOAccess access,
                      org.snmp4j.smi.Variable value,
                      java.lang.String tcModuleName,
                      java.lang.String textualConvention)
Creates a scalar object from a OID, maximum access, and value.

Parameters:
id - the OID of the scalar (including the .0 suffix).
access - the maximum access supported by this scalar.
value - the (initial) value of the scalar.
tcModuleName - the MIB module name that defines the textual conventions.
textualConvention - the object name of the textual convention on which this scalar is based.
Returns:
a MOScalar instance.

createTableRelation

MOTableRelation createTableRelation(MOTable baseTable,
                                    MOTable dependentTable)
Creates a relation between two tables. Related tables share one or more sub-indexes beginning with the first sub-index.

Parameters:
baseTable - the base table.
dependentTable - the dependent or augmenting table.
Returns:
a MOTableRelation instance relating the supplied tables.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.