01: /*_############################################################################
02: _##
03: _## SNMP4J - SnmpEngineEvent.java
04: _##
05: _## Copyright (C) 2003-2008 Frank Fock and Jochen Katz (SNMP4J.org)
06: _##
07: _## Licensed under the Apache License, Version 2.0 (the "License");
08: _## you may not use this file except in compliance with the License.
09: _## You may obtain a copy of the License at
10: _##
11: _## http://www.apache.org/licenses/LICENSE-2.0
12: _##
13: _## Unless required by applicable law or agreed to in writing, software
14: _## distributed under the License is distributed on an "AS IS" BASIS,
15: _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: _## See the License for the specific language governing permissions and
17: _## limitations under the License.
18: _##
19: _##########################################################################*/
20:
21: package org.snmp4j.event;
22:
23: import java.util.EventObject;
24: import org.snmp4j.smi.OctetString;
25: import org.snmp4j.smi.Address;
26:
27: /**
28: * The <code>SnmpEngineEvent</code> describes events generated on behalf of
29: * the engine ID cache of the SNMPv3 message processing model (MPv3).
30: *
31: * @author Frank Fock
32: * @version 1.6
33: * @since 1.6
34: */
35: public class SnmpEngineEvent extends EventObject {
36:
37: private static final long serialVersionUID = -7287039511083410591L;
38:
39: public static final int ADDED_ENGINE_ID = 1;
40: public static final int REMOVED_ENGINE_ID = 2;
41:
42: private OctetString engineID;
43: private Address engineAddress;
44: private int type;
45:
46: public SnmpEngineEvent(Object source, int type,
47: OctetString engineID, Address engineAddress) {
48: super (source);
49: this .engineID = engineID;
50: this .type = type;
51: this .engineAddress = engineAddress;
52: }
53:
54: /**
55: * Returns the type of the engine event.
56: * @return
57: * one of the integer constants defined by this class.
58: */
59: public int getType() {
60: return type;
61: }
62:
63: /**
64: * Returns the engine ID associated with this event.
65: * @return
66: * the engine ID.
67: */
68: public OctetString getEngineID() {
69: return engineID;
70: }
71:
72: /**
73: * Returns the transport address of the engine.
74: * @return
75: * the transport address.
76: */
77: public Address getEngineAddress() {
78: return engineAddress;
79: }
80:
81: }
|