/** * Adds a new MIB in the SNMP MIB handler. * This method is to be called to set a specific agent to a specific OID. * This can be useful when dealing with MIB overlapping. * Some OID can be implemented in more than one MIB. In this case, * the OID nearer agent will be used on SNMP operations. * * @param mib The MIB to add. * @param oids The set of OIDs this agent implements. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. * * @since 1.5 */ @Override public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids) throws IllegalArgumentException { if (mib == null) { throw new IllegalArgumentException() ; } //If null oid array, just add it to the mib. if(oids == null) return addMib(mib); if(!mibs.contains(mib)) mibs.addElement(mib); for (int i = 0; i < oids.length; i++) { root.register(mib, oids[i].longValue()); } return this; }
/** * Adds a new MIB in the SNMP MIB handler. * This method is to be called to set a specific agent to a specific OID. * This can be useful when dealing with MIB overlapping. * Some OID can be implemented in more than one MIB. In this case, * the OID nearer agent will be used on SNMP operations. * * @param mib The MIB to add. * @param oids The set of OIDs this agent implements. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. * * @since 1.5 */ public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids) throws IllegalArgumentException { if (mib == null) { throw new IllegalArgumentException() ; } //If null oid array, just add it to the mib. if(oids == null) return addMib(mib); if(!mibs.contains(mib)) mibs.addElement(mib); for (int i = 0; i < oids.length; i++) { root.register(mib, oids[i].longValue()); } return this; }
/** * Adds a new MIB in the SNMP MIB handler. * * @param mib The MIB to add. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. */ @Override public SnmpMibHandler addMib(SnmpMibAgent mib) throws IllegalArgumentException { if (mib == null) { throw new IllegalArgumentException() ; } if(!mibs.contains(mib)) mibs.addElement(mib); root.register(mib); return this; }
/** * Adds a new MIB in the SNMP MIB handler. * * @param mib The MIB to add. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. */ public SnmpMibHandler addMib(SnmpMibAgent mib) throws IllegalArgumentException { if (mib == null) { throw new IllegalArgumentException() ; } if(!mibs.contains(mib)) mibs.addElement(mib); root.register(mib); return this; }
/** * Adds a new MIB in the SNMP MIB handler. In SNMP V1 and V2 the * <CODE>contextName</CODE> is useless and this method * is equivalent to <CODE>addMib(SnmpMibAgent mib, SnmpOid[] oids)</CODE>. * * @param mib The MIB to add. * @param contextName The MIB context. If null is passed, will be * registered in the default context. * @param oids The set of OIDs this agent implements. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. * * @since 1.5 */ @Override public SnmpMibHandler addMib(SnmpMibAgent mib, String contextName, SnmpOid[] oids) throws IllegalArgumentException { return addMib(mib, oids); }
/** * Adds a new MIB in the SNMP MIB handler. In SNMP V1 and V2 the * <CODE>contextName</CODE> is useless and this method * is equivalent to <CODE>addMib(SnmpMibAgent mib, SnmpOid[] oids)</CODE>. * * @param mib The MIB to add. * @param contextName The MIB context. If null is passed, will be * registered in the default context. * @param oids The set of OIDs this agent implements. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. * * @since 1.5 */ public SnmpMibHandler addMib(SnmpMibAgent mib, String contextName, SnmpOid[] oids) throws IllegalArgumentException { return addMib(mib, oids); }
/** * Adds a new MIB in the SNMP MIB handler. In SNMP V1 and V2 the * <CODE>contextName</CODE> is useless and this method * is equivalent to <CODE>addMib(SnmpMibAgent mib)</CODE>. * * @param mib The MIB to add. * @param contextName The MIB context name. * @return A reference on the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. * * @since 1.5 */ @Override public SnmpMibHandler addMib(SnmpMibAgent mib, String contextName) throws IllegalArgumentException { return addMib(mib); }
/** * Adds a new MIB in the SNMP MIB handler. * This method is called automatically by {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptor(SnmpMibHandler)} * and {@link com.sun.jmx.snmp.agent.SnmpMibAgent#setSnmpAdaptorName(ObjectName)} * and should not be called directly. * * @param mib The MIB to add. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. */ public SnmpMibHandler addMib(SnmpMibAgent mib) throws IllegalArgumentException;
/** * Adds a new MIB in the SNMP MIB handler. * * @param mib The MIB to add. * @param oids The set of OIDs this agent implements. * * @return A reference to the SNMP MIB handler. * * @exception IllegalArgumentException If the parameter is null. * * @since 1.5 */ public SnmpMibHandler addMib(SnmpMibAgent mib, SnmpOid[] oids) throws IllegalArgumentException;