KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*_############################################################################
2   _##
3   _## SNMP4J-Agent - MOValueValidationEvent.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.smi.*;
27
28 /**
29  * The <code>MOValueValidationEvent</code> class represents a value validation
30  * request. The request's result is carries in its status member.
31  *
32  * @author Frank Fock
33  * @version 1.0
34  */

35 public class MOValueValidationEvent extends EventObject {
36
37   private Variable newValue;
38   private Variable oldValue;
39   private int validationStatus = 0;
40
41   /**
42    * Creates a new value validation request.
43    * @param source
44    * the event source (request creator).
45    * @param oldValue
46    * the old value.
47    * @param newValue
48    * the new value to validate.
49    */

50   public MOValueValidationEvent(Object JavaDoc source,
51                                 Variable oldValue, Variable newValue) {
52     super(source);
53     this.newValue = newValue;
54     this.oldValue = oldValue;
55   }
56
57   /**
58    * Gets the validation status.
59    * @return
60    * an SNMP error status or zero if validation was successful.
61    */

62   public int getValidationStatus() {
63     return validationStatus;
64   }
65
66   public Variable getNewValue() {
67     return newValue;
68   }
69
70   public Variable getOldValue() {
71     return oldValue;
72   }
73
74   /**
75    * Sets the validation status. The default status is zero.
76    * @param validationStatus
77    * a SNMP error status.
78    */

79   public void setValidationStatus(int validationStatus) {
80     this.validationStatus = validationStatus;
81   }
82
83 }
84
Popular Tags