Package org.snmp4j.agent.agentx.event

Examples of org.snmp4j.agent.agentx.event.PingEvent


          for (Iterator cit = getContexts().iterator(); cit.hasNext(); ) {
            OctetString context = (OctetString) cit.next();
            AgentXPingPDU ping = new AgentXPingPDU(context);
            ping.setSessionAttributes(session);
            ping.setTransactionID(getNextTransactionID());
            PingEvent pingEvent;
            try {
              AgentXResponseEvent resp =
                  agentX.send(ping, session.createAgentXTarget(),
                              session.getPeer().getTransport());
              pingEvent = new PingEvent(this, session,
                                        resp.getResponse());
            }
            catch (IOException ex) {
              pingEvent = new PingEvent(this, session, ex);
            }
            firePinged(pingEvent);
            if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("Fired ping event " + pingEvent);
            }
            if (pingEvent.isCloseSession() || pingEvent.isResetSession()) {
              try {
                closeSession(session.getSessionID(),
                             AgentXProtocol.REASON_TIMEOUTS);
                if (pingEvent.isResetSession()) {
                  reopenSession(session);
                }
              }
              catch (IOException ex1) {
              }
View Full Code Here

TOP

Related Classes of org.snmp4j.agent.agentx.event.PingEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.