KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > mo > MOChangeEvent


1 /*_############################################################################
2   _##
3   _## SNMP4J-Agent - MOChangeEvent.java
4   _##
5   _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
6   _##
7   _## Licensed under the Apache License, Version 2.0 (the "License");
8   _## you may not use this file except in compliance with the License.
9   _## 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
22 package org.snmp4j.agent.mo;
23
24 import java.util.*;
25
26 import org.snmp4j.agent.*;
27 import org.snmp4j.smi.*;
28
29 /**
30  * The <code>MOChangeEvent</code> describes the change of a single value of
31  * a <code>ManagedObject</code>.
32  *
33  * @author Frank Fock
34  * @version 1.0
35  */

36 public class MOChangeEvent extends DeniableEventObject {
37
38   private static final long serialVersionUID = 2377168127200875177L;
39
40   private ManagedObject changedObject;
41   private OID oid;
42   private Variable oldValue;
43   private Variable newValue;
44
45   /**
46    * Creates a deniable <code>MOChangeEvent</code> object based on the changed
47    * managed object, the instance OID of the changed value, with old and new
48    * value.
49    * @param source
50    * the event source.
51    * @param changedObject
52    * the <code>ManagedObject</code> whose value is changed.
53    * @param oid
54    * the instance OID of the changed instance.
55    * @param oldValue
56    * the old value.
57    * @param newValue
58    * the new value.
59    */

60   public MOChangeEvent(Object JavaDoc source, ManagedObject changedObject,
61                        OID oid, Variable oldValue, Variable newValue) {
62     this(source, changedObject, oid, oldValue, newValue, true);
63   }
64
65   /**
66    * Creates a <code>MOChangeEvent</code> object based on the changed managed
67    * object, the instance OID of the changed value, with old and new value.
68    * @param source
69    * the event source.
70    * @param changedObject
71    * the <code>ManagedObject</code> whose value is changed.
72    * @param oid
73    * the instance OID of the changed instance.
74    * @param oldValue
75    * the old value.
76    * @param newValue
77    * the new value.
78    * @param deniable
79    * indicates whether the event can be canceled through setting its
80    * denyReason member to a SNMP error status.
81    * @since 1.1
82    */

83   public MOChangeEvent(Object JavaDoc source, ManagedObject changedObject,
84                        OID oid, Variable oldValue, Variable newValue,
85                        boolean deniable) {
86     super(source, deniable);
87     this.changedObject = changedObject;
88     this.oid = oid;
89     this.oldValue = oldValue;
90     this.newValue = newValue;
91   }
92
93   public ManagedObject getChangedObject() {
94     return changedObject;
95   }
96
97   public OID getOID() {
98     return oid;
99   }
100
101   public Variable getOldValue() {
102     return oldValue;
103   }
104
105   public Variable getNewValue() {
106     return newValue;
107   }
108 }
109
Popular Tags