KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > mp > StatusInformation


1 /*_############################################################################
2   _##
3   _## SNMP4J - StatusInformation.java
4   _##
5   _## Copyright 2003-2007 Frank Fock and Jochen Katz (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 package org.snmp4j.mp;
22
23 import org.snmp4j.smi.VariableBinding;
24 import org.snmp4j.smi.Integer32;
25 import java.io.Serializable JavaDoc;
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 JavaDoc {
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,
47                            byte[] contextEngineID,
48                            Integer32 securityLevel) {
49     this.errorIndication = errorIndication;
50     this.contextName = contextName;
51     this.contextEngineID = contextEngineID;
52     this.securityLevel = securityLevel;
53   }
54
55   public VariableBinding getErrorIndication() {
56     return errorIndication;
57   }
58   public void setErrorIndication(VariableBinding errorIndication) {
59     this.errorIndication = errorIndication;
60   }
61   public void setContextName(byte[] contextName) {
62     this.contextName = contextName;
63   }
64   public byte[] getContextName() {
65     return contextName;
66   }
67   public void setContextEngineID(byte[] contextEngineID) {
68     this.contextEngineID = contextEngineID;
69   }
70   public byte[] getContextEngineID() {
71     return contextEngineID;
72   }
73   public void setSecurityLevel(org.snmp4j.smi.Integer32 securityLevel) {
74     this.securityLevel = securityLevel;
75   }
76   public org.snmp4j.smi.Integer32 getSecurityLevel() {
77     return securityLevel;
78   }
79
80   public String JavaDoc toString() {
81     if (errorIndication == null) {
82       return "noError";
83     }
84     return errorIndication.toString();
85   }
86 }
87
88
Popular Tags