Class DefaultMOFactory

    • Constructor Detail

      • DefaultMOFactory

        protected DefaultMOFactory()
    • Method Detail

      • getInstance

        public static MOFactory getInstance()
        Returns the factory singleton with default support for SNMPv2-TC textual conventions.
        Returns:
        a MOFactory instance.
      • setInstance

        public static void setInstance​(MOFactory factory)
        Sets the singleton factory.
        Parameters:
        factory - a MOFactory instance.
      • addSNMPv2TCs

        public static void addSNMPv2TCs​(MOFactory factory)
        Adds support for SNMPv2TC textual conventions to the supplied ManagedObject factory.
        Parameters:
        factory - a MOFactory instance.
      • getTextualConventions

        protected java.util.Map<? extends java.lang.String,? extends java.util.Map<java.lang.String,TextualConvention>> getTextualConventions()
      • addTextualConvention

        public 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.
        Specified by:
        addTextualConvention in interface MOFactory
        Parameters:
        tc - a TextualConvention instance.
      • removeTextualConvention

        public void removeTextualConvention​(TextualConvention tc)
        Description copied from interface: MOFactory
        Removes the supplied textual convention from the supported TCs by this ManagedObject factory.
        Specified by:
        removeTextualConvention in interface MOFactory
        Parameters:
        tc - a TextualConvention instance.
      • getTextualConvention

        public <V extends org.snmp4j.smi.Variable> TextualConvention<V> getTextualConvention​(java.lang.String moduleName,
                                                                                             java.lang.String name)
        Description copied from interface: MOFactory
        Gets the textual convention described by the TC's name and the MIB module name of the MIB module specifying the TC.
        Specified by:
        getTextualConvention in interface MOFactory
        Type Parameters:
        V - the Variable type that is the base type of the returned textual convention.
        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.
      • createRow

        public DefaultMOMutableRow2PC createRow​(org.snmp4j.smi.OID index,
                                                org.snmp4j.smi.Variable[] values)
                                         throws java.lang.UnsupportedOperationException
        Description copied from interface: MOTableRowFactory
        Creates a new MOTableRow row instance and returns it.
        Specified by:
        createRow in interface MOTableRowFactory<DefaultMOMutableRow2PC>
        Parameters:
        index - the index OID for the new row.
        values - the values to be contained in the new row.
        Returns:
        the created MOTableRow.
        Throws:
        java.lang.UnsupportedOperationException - if the specified row cannot be created.
      • setLink

        public void setLink​(org.snmp4j.smi.OID oid,
                            java.lang.Object instrumentationHelperObject)
        Description copied from interface: LinkedMOFactory
        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.
        Specified by:
        setLink in interface LinkedMOFactory
        Parameters:
        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.
        See Also:
        LinkedMOFactory.getLink(OID oid)
      • getLink

        public java.lang.Object getLink​(org.snmp4j.smi.OID oid)
        Description copied from interface: LinkedMOFactory
        Gets the link for the given object ID or any sub-OID prefix thereof.
        Specified by:
        getLink in interface LinkedMOFactory
        Parameters:
        oid - the oid of the managed object class (prefix) for which to returned the linked instrumentation helper class.
        Returns:
        an instrumentation helper object (for example an URI) or null if no such link exists.
      • initLinkMap

        protected void initLinkMap()