1 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 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, 44 AgentXSession pingedSession, 45 AgentXResponsePDU pingResponse){ 46 super(source); 47 this.session = pingedSession; 48 this.response = pingResponse; 49 } 50 51 public PingEvent(Object source, 52 AgentXSession pingedSession, 53 Exception error){ 54 super(source); 55 this.session = pingedSession; 56 this.error = error; 57 } 58 59 public AgentXResponsePDU getResponse() { 60 return response; 61 } 62 63 public AgentXSession getSession() { 64 return session; 65 } 66 67 public boolean isCloseSession() { 68 return closeSession; 69 } 70 71 public boolean isResetSession() { 72 return resetSession; 73 } 74 75 public Exception getError() { 76 return error; 77 } 78 79 public void setCloseSession(boolean closeSession) { 80 this.closeSession = closeSession; 81 } 82 83 public void setResetSession(boolean resetSession) { 84 this.resetSession = resetSession; 85 } 86 87 public String toString() { 88 return getClass().getName()+"[session="+session+",response="+response+ 89 ",error="+error+ 90 ",closeSession="+closeSession+",resetSession="+resetSession+"]"; 91 } 92 } 93 | Popular Tags |