01: /*_############################################################################
02: _##
03: _## SNMP4J-Agent - MOValueValidationEvent.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (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.agent.mo;
22:
23: import java.util.*;
24:
25: import org.snmp4j.smi.*;
26:
27: /**
28: * The <code>MOValueValidationEvent</code> class represents a value validation
29: * request. The request's result is carries in its status member.
30: *
31: * @author Frank Fock
32: * @version 1.0
33: */
34: public class MOValueValidationEvent extends EventObject {
35:
36: private Variable newValue;
37: private Variable oldValue;
38: private int validationStatus = 0;
39:
40: /**
41: * Creates a new value validation request.
42: * @param source
43: * the event source (request creator).
44: * @param oldValue
45: * the old value.
46: * @param newValue
47: * the new value to validate.
48: */
49: public MOValueValidationEvent(Object source, Variable oldValue,
50: Variable newValue) {
51: super (source);
52: this .newValue = newValue;
53: this .oldValue = oldValue;
54: }
55:
56: /**
57: * Gets the validation status.
58: * @return
59: * an SNMP error status or zero if validation was successful.
60: */
61: public int getValidationStatus() {
62: return validationStatus;
63: }
64:
65: public Variable getNewValue() {
66: return newValue;
67: }
68:
69: public Variable getOldValue() {
70: return oldValue;
71: }
72:
73: /**
74: * Sets the validation status. The default status is zero.
75: * @param validationStatus
76: * a SNMP error status.
77: */
78: public void setValidationStatus(int validationStatus) {
79: this.validationStatus = validationStatus;
80: }
81:
82: }
|