/** * Creates a USM MIB implementation connected to the supplied USM. The MIB * contents will reflect any changes to the USM after completion of this * constructor if you register this object as {@link UsmUserListener} to the * USM! * @param usm * a User-based Security Model. * @param securityProtocols * the supported <code>SecurityProtocols</code>. */ public UsmMIB(USM usm, SecurityProtocols securityProtocols) { this.usm = usm; this.securityProtocols = securityProtocols; usm.getCounterSupport().addCounterListener(this); createUsmStats(); createUsmUser(); }
/** * Creates a USM MIB implementation connected to the supplied USM. The MIB * contents will reflect any changes to the USM after completion of this * constructor if you register this object as {@link UsmUserListener} to the * USM! * @param usm * a User-based Security Model. * @param securityProtocols * the supported <code>SecurityProtocols</code>. */ public UsmMIB(USM usm, SecurityProtocols securityProtocols) { this.usm = usm; this.securityProtocols = securityProtocols; usm.getCounterSupport().addCounterListener(this); createUsmStats(); createUsmUser(); }
/** * <p>fillTreeFromSNMP.</p> * * @param root a {@link net.itransformers.snmp2xml4j.snmptoolkit.Node} object. * @throws java.io.IOException if any. */ protected void fillTreeFromSNMP(Node root) throws IOException { CounterSupport.getInstance().addCounterListener(new DefaultCounterListener()); // AbstractTransportMapping transport = new DefaultUdpTransportMapping(localAddress); // TableUtils tutils = new TableUtils(snmp, pduFactory); fillTreeFromSNMP(root, tutils); }
protected void linkCounterListener() { agent.removeCounterListener(snmpv2MIB); agent.addCounterListener(snmpv2MIB); usm.getCounterSupport().removeCounterListener(snmpv2MIB); usm.getCounterSupport().addCounterListener(snmpv2MIB); }
public void setTsm(TSM tsm) { if (this.tsm != null) { this.tsm.getCounterSupport().removeCounterListener(counterListener); } this.tsm = tsm; this.tsm.getCounterSupport().addCounterListener(counterListener); tsm.setUsePrefix(TruthValueTC.getBooleanValue(snmpTsmConfigurationUsePrefix.getValue())); }
public SnmpRequest(String[] args) { // Set the default counter listener to return proper USM and MP error // counters. CounterSupport.getInstance().addCounterListener(new DefaultCounterListener()); vbs.add(new VariableBinding(new OID("1.3.6"))); int paramStart = parseArgs(args); if (paramStart >= args.length) { printUsage(); System.exit(1); } else if (operation != SNAPSHOT_DUMP) { checkOptions(); address = getAddress(args[paramStart++]); Vector<VariableBinding> vbs = getVariableBindings(args, paramStart); checkTrapVariables(vbs); if (vbs.size() > 0) { this.vbs = vbs; } } }
public SnmpRequest(String[] args) { // Set the default counter listener to return proper USM and MP error // counters. CounterSupport.getInstance().addCounterListener(new DefaultCounterListener()); vbs.add(new VariableBinding(new OID("1.3.6"))); int paramStart = parseArgs(args); if (paramStart >= args.length) { printUsage(); System.exit(1); } else if (operation != SNAPSHOT_DUMP) { checkOptions(); address = getAddress(args[paramStart++]); Vector vbs = getVariableBindings(args, paramStart); checkTrapVariables(vbs); if (vbs.size() > 0) { this.vbs = vbs; } } }
protected void linkCounterListener() { agent.removeCounterListener(snmpv2MIB); agent.addCounterListener(snmpv2MIB); usm.getCounterSupport().removeCounterListener(snmpv2MIB); usm.getCounterSupport().addCounterListener(snmpv2MIB); agent.removeCounterListener(snmpMpdMib); agent.addCounterListener(snmpMpdMib); MPv3 mpv3 = (MPv3) dispatcher.getMessageProcessingModel(MPv3.ID); if ((mpv3 != null) && (mpv3.getCounterSupport() != null)) { mpv3.getCounterSupport().removeCounterListener(snmpMpdMib); mpv3.getCounterSupport().addCounterListener(snmpMpdMib); } dispatcher.removeCounterListener(snmpMpdMib); dispatcher.addCounterListener(snmpMpdMib); for (TransportMapping tm : dispatcher.getTransportMappings()) { if (tm instanceof TLSTM) { TLSTM tlstm = (TLSTM) tm; tlstm.getCounterSupport().removeCounterListener(tlsTmMib.getCounterListener()); tlstm.getCounterSupport().addCounterListener(tlsTmMib.getCounterListener()); } } }
CounterSupport.getInstance().addCounterListener(new DefaultCounterListener()); Variable var = new OctetString(value); VariableBinding vb = new VariableBinding(new OID(this.oid),var);
CounterSupport.getInstance().addCounterListener(new DefaultCounterListener()); Variable var = new OctetString(value); VariableBinding vb = new VariableBinding(new OID(this.oid),var);
CounterSupport.getInstance().addCounterListener(new DefaultCounterListener()); SnmpCommandMessageDispatcher bmd = new SnmpCommandMessageDispatcher();
mpv3.getCounterSupport().addCounterListener(snmpMpdMib); agent.addCounterListener(snmpv2MIB); agent.addCounterListener(snmpMpdMib); snmpTargetMIB, snmpNotificationMIB, snmpCommunityMIB); snmpv2MIB.setNotificationOriginator(agent); usm.getCounterSupport().addCounterListener(snmpv2MIB);