01: /*_############################################################################
02: _##
03: _## SNMP4J - StatusInformation.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.mp;
22:
23: import org.snmp4j.smi.VariableBinding;
24: import org.snmp4j.smi.Integer32;
25: import java.io.Serializable;
26:
27: /**
28: * The <code>StatusInformation</code> class represents status information
29: * of a SNMPv3 message that is needed to return a report message.
30: * @author Frank Fock
31: * @version 1.0
32: */
33: public class StatusInformation implements Serializable {
34:
35: private static final long serialVersionUID = 9053403603288070071L;
36:
37: private VariableBinding errorIndication;
38: private byte[] contextName;
39: private byte[] contextEngineID;
40: private Integer32 securityLevel;
41:
42: public StatusInformation() {
43: }
44:
45: public StatusInformation(VariableBinding errorIndication,
46: byte[] contextName, byte[] contextEngineID,
47: Integer32 securityLevel) {
48: this .errorIndication = errorIndication;
49: this .contextName = contextName;
50: this .contextEngineID = contextEngineID;
51: this .securityLevel = securityLevel;
52: }
53:
54: public VariableBinding getErrorIndication() {
55: return errorIndication;
56: }
57:
58: public void setErrorIndication(VariableBinding errorIndication) {
59: this .errorIndication = errorIndication;
60: }
61:
62: public void setContextName(byte[] contextName) {
63: this .contextName = contextName;
64: }
65:
66: public byte[] getContextName() {
67: return contextName;
68: }
69:
70: public void setContextEngineID(byte[] contextEngineID) {
71: this .contextEngineID = contextEngineID;
72: }
73:
74: public byte[] getContextEngineID() {
75: return contextEngineID;
76: }
77:
78: public void setSecurityLevel(org.snmp4j.smi.Integer32 securityLevel) {
79: this .securityLevel = securityLevel;
80: }
81:
82: public org.snmp4j.smi.Integer32 getSecurityLevel() {
83: return securityLevel;
84: }
85:
86: public String toString() {
87: if (errorIndication == null) {
88: return "noError";
89: }
90: return errorIndication.toString();
91: }
92: }
|