01: /*_############################################################################
02: _##
03: _## SNMP4J-AgentX - PingEvent.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
06: _##
07: _## This program is free software; you can redistribute it and/or modify
08: _## it under the terms of the GNU General Public License version 2 as
09: _## published by the Free Software Foundation.
10: _##
11: _## This program is distributed in the hope that it will be useful,
12: _## but WITHOUT ANY WARRANTY; without even the implied warranty of
13: _## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: _## GNU General Public License for more details.
15: _##
16: _## You should have received a copy of the GNU General Public License
17: _## along with this program; if not, write to the Free Software
18: _## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19: _## MA 02110-1301 USA
20: _##
21: _##########################################################################*/
22:
23: package org.snmp4j.agent.agentx.event;
24:
25: import java.util.EventObject;
26:
27: import org.snmp4j.agent.agentx.AgentXResponsePDU;
28: import org.snmp4j.agent.agentx.AgentXSession;
29:
30: /**
31: * The <code>PingEvent</code> object describes an AgentX ping result.
32: * @author Frank Fock
33: * @version 1.0
34: */
35: public class PingEvent extends EventObject {
36:
37: private AgentXSession session;
38: private AgentXResponsePDU response;
39: private boolean closeSession;
40: private boolean resetSession;
41: private Exception error;
42:
43: public PingEvent(Object source, AgentXSession pingedSession,
44: AgentXResponsePDU pingResponse) {
45: super (source);
46: this .session = pingedSession;
47: this .response = pingResponse;
48: }
49:
50: public PingEvent(Object source, AgentXSession pingedSession,
51: Exception error) {
52: super (source);
53: this .session = pingedSession;
54: this .error = error;
55: }
56:
57: public AgentXResponsePDU getResponse() {
58: return response;
59: }
60:
61: public AgentXSession getSession() {
62: return session;
63: }
64:
65: public boolean isCloseSession() {
66: return closeSession;
67: }
68:
69: public boolean isResetSession() {
70: return resetSession;
71: }
72:
73: public Exception getError() {
74: return error;
75: }
76:
77: public void setCloseSession(boolean closeSession) {
78: this .closeSession = closeSession;
79: }
80:
81: public void setResetSession(boolean resetSession) {
82: this .resetSession = resetSession;
83: }
84:
85: public String toString() {
86: return getClass().getName() + "[session=" + session
87: + ",response=" + response + ",error=" + error
88: + ",closeSession=" + closeSession + ",resetSession="
89: + resetSession + "]";
90: }
91: }
|