1 10 11 package com.sun.jmx.snmp.agent; 12 13 import java.util.Enumeration ; 14 import java.util.Vector ; 15 16 17 import com.sun.jmx.snmp.SnmpPdu; 18 import com.sun.jmx.snmp.SnmpVarBind; 19 import com.sun.jmx.snmp.SnmpEngine; 20 21 33 final class SnmpMibRequestImpl implements SnmpMibRequest { 34 35 46 public SnmpMibRequestImpl(SnmpEngine engine, 47 SnmpPdu reqPdu, 48 Vector vblist, 49 int protocolVersion, 50 Object userData, 51 String principal, 52 int securityLevel, 53 int securityModel, 54 byte[] contextName, 55 byte[] accessContextName) { 56 varbinds = vblist; 57 version = protocolVersion; 58 data = userData; 59 this.reqPdu = reqPdu; 60 this.engine = engine; 61 this.principal = principal; 62 this.securityLevel = securityLevel; 63 this.securityModel = securityModel; 64 this.contextName = contextName; 65 this.accessContextName = accessContextName; 66 } 67 71 75 public SnmpEngine getEngine() { 76 return engine; 77 } 78 79 83 public String getPrincipal() { 84 return principal; 85 } 86 87 91 public int getSecurityLevel() { 92 return securityLevel; 93 } 94 98 public int getSecurityModel() { 99 return securityModel; 100 } 101 105 public byte[] getContextName() { 106 return contextName; 107 } 108 109 113 public byte[] getAccessContextName() { 114 return accessContextName; 115 } 116 117 public final SnmpPdu getPdu() { 122 return reqPdu; 123 } 124 125 public final Enumeration getElements() {return varbinds.elements();} 130 131 public final Vector getSubList() {return varbinds;} 136 137 public final int getSize() { 142 if (varbinds == null) return 0; 143 return varbinds.size(); 144 } 145 146 public final int getVersion() {return version;} 151 152 public final int getRequestPduVersion() {return reqPdu.version;} 157 158 public final Object getUserData() {return data;} 163 164 public final int getVarIndex(SnmpVarBind varbind) { 169 return varbinds.indexOf(varbind); 170 } 171 172 public void addVarBind(SnmpVarBind varbind) { 177 varbinds.addElement(varbind); 178 } 179 180 184 final void setRequestTree(SnmpRequestTree tree) {this.tree = tree;} 195 196 final SnmpRequestTree getRequestTree() {return tree;} 201 202 final Vector getVarbinds() {return varbinds;} 207 208 212 private Vector varbinds; 216 private int version; 217 private Object data; 218 private SnmpPdu reqPdu = null; 219 private SnmpRequestTree tree = null; 221 private SnmpEngine engine = null; 222 private String principal = null; 223 private int securityLevel = -1; 224 private int securityModel = -1; 225 private byte[] contextName = null; 226 private byte[] accessContextName = null; 227 } 228 | Popular Tags |