1 20 21 package org.snmp4j.event; 22 23 import java.util.EventObject ; 24 25 import org.snmp4j.PDU; 26 import org.snmp4j.smi.Address; 27 import org.snmp4j.Session; 29 30 37 public class ResponseEvent extends EventObject { 38 39 private static final long serialVersionUID = 3966730838956160070L; 40 41 private Address peerAddress; 42 private PDU request; 43 private PDU response; 44 private Object userObject; 45 private Exception error; 46 47 60 public ResponseEvent(Object source, Address peerAddress, 61 PDU request, PDU response, Object userObject) { 62 super(source); 63 setPeerAddress(peerAddress); 64 setRequest(request); 65 setResponse(response); 66 setUserObject(userObject); 67 } 68 69 85 public ResponseEvent(Object source, 86 Address peerAddress, 87 PDU request, PDU response, 88 Object userObject, 89 Exception error) { 90 this(source, peerAddress, request, response, userObject); 91 this.error = error; 92 } 93 94 99 public PDU getRequest() { 100 return request; 101 } 102 103 protected final void setPeerAddress(Address peerAddress) { 104 this.peerAddress = peerAddress; 105 } 106 107 protected final void setRequest(PDU request) { 108 this.request = request; 109 } 110 111 protected final void setResponse(PDU response) { 112 this.response = response; 113 } 114 115 121 public PDU getResponse() { 122 return response; 123 } 124 125 protected final void setUserObject(Object userObject) { 126 this.userObject = userObject; 127 } 128 129 136 public Object getUserObject() { 137 return userObject; 138 } 139 140 146 public Exception getError() { 147 return error; 148 } 149 150 158 public Address getPeerAddress() { 159 return peerAddress; 160 } 161 162 } 163 | Popular Tags |