/** * <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); }
/** * Gets the counter support singleton. * @return * the <code>CounterSupport</code> instance. */ public static CounterSupport getInstance() { if (instance == null) { instance = new CounterSupport(); } return instance; }
/** * Fire a counter incrementation event. * @param e CounterEvent */ protected void fireIncrementCounter(CounterEvent e) { if (counterSupport != null) { counterSupport.fireIncrementCounter(e); } }
public TSM(OctetString localEngineID, boolean usePrefix) { this.counterSupport = CounterSupport.getInstance(); this.localEngineID = localEngineID; this.usePrefix = usePrefix; }
protected void linkCounterListener() { agent.removeCounterListener(snmpv2MIB); agent.addCounterListener(snmpv2MIB); usm.getCounterSupport().removeCounterListener(snmpv2MIB); usm.getCounterSupport().addCounterListener(snmpv2MIB); }
/** * 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(); }
public TSM(OctetString localEngineID, boolean usePrefix) { this.counterSupport = CounterSupport.getInstance(); this.localEngineID = localEngineID; this.usePrefix = usePrefix; }
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())); }
/** * 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(); }
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; } } }
/** * Creates a DTLS transport mapping that binds to the given address * (interface) on the local host. * * @param securityCallback a security name callback to resolve X509 certificates to tmSecurityNames. * @param serverAddress the UdpAddress instance that describes the server address to listen * on incoming connection requests. * @throws IOException if the given address cannot be bound. */ public DTLSTM(TlsTmSecurityCallback<X509Certificate> securityCallback, UdpAddress serverAddress) throws IOException { this(securityCallback, serverAddress, CounterSupport.getInstance()); }
/** * Fire a counter incrementation event. * @param e CounterEvent */ protected void fireIncrementCounter(CounterEvent e) { if (counterSupport != null) { counterSupport.fireIncrementCounter(e); } }
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()); } } }
mpv3.getCounterSupport().addCounterListener(snmpMpdMib); agent.addCounterListener(snmpv2MIB); agent.addCounterListener(snmpMpdMib); snmpTargetMIB, snmpNotificationMIB, snmpCommunityMIB); snmpv2MIB.setNotificationOriginator(agent); usm.getCounterSupport().addCounterListener(snmpv2MIB);
/** * Gets the counter support singleton. * * @return the <code>CounterSupport</code> instance. */ public static CounterSupport getInstance() { if (instance == null) { instance = new CounterSupport(); } return instance; }
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; } } }
public DefaultSshTransportMapping(SshTransportAdapter transportAdapter) { this.transportAdapter = transportAdapter; this.counterSupport = CounterSupport.getInstance(); }
/** * Fire a counter incrementation event. * @param e CounterEvent */ protected void fireIncrementCounter(CounterEvent e) { if (counterSupport != null) { counterSupport.fireIncrementCounter(e); } }
/** * Gets the counter support singleton. * @return * the <code>CounterSupport</code> instance. */ public static CounterSupport getInstance() { if (instance == null) { instance = new CounterSupport(); } return instance; }
CounterSupport.getInstance().addCounterListener(new DefaultCounterListener()); Variable var = new OctetString(value); VariableBinding vb = new VariableBinding(new OID(this.oid),var);