jdk/src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java
author chegar
Sun, 17 Aug 2014 15:54:13 +0100
changeset 25859 3317bb8137f4
parent 23010 jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java@6dadb192ad81
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 14677
diff changeset
     2
 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.jmx.snmp.agent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.Enumeration;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import com.sun.jmx.snmp.SnmpPdu;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import com.sun.jmx.snmp.SnmpVarBind;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import com.sun.jmx.snmp.SnmpEngine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * This class implements the SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * It represents the part of a SNMP request that involves a specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * MIB. One instance of this class will be created for every MIB
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * involved in a SNMP request, and will be passed to the SnmpMibAgent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * in charge of handling that MIB.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * Instances of this class are allocated by the SNMP engine. You will
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * never need to use this class directly. You will only access
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * instances of this class through their SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
final class SnmpMibRequestImpl implements SnmpMibRequest {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * @param engine The local engine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * @param reqPdu The received pdu.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * @param vblist The vector of SnmpVarBind objects in which the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     *        MIB concerned by this request is involved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * @param protocolVersion  The protocol version of the SNMP request.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * @param userData     User allocated contextual data. This object must
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     *        be allocated on a per SNMP request basis through the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *        SnmpUserDataFactory registered with the SnmpAdaptorServer,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     *        and is handed back to the user through SnmpMibRequest objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    public SnmpMibRequestImpl(SnmpEngine engine,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
                              SnmpPdu reqPdu,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
                              Vector<SnmpVarBind> vblist,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
                              int protocolVersion,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
                              Object userData,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                              String principal,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                              int securityLevel,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                              int securityModel,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
                              byte[] contextName,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                              byte[] accessContextName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        varbinds   = vblist;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        version    = protocolVersion;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        data       = userData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        this.reqPdu = reqPdu;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        this.engine = engine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        this.principal = principal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        this.securityLevel = securityLevel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        this.securityModel = securityModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        this.contextName = contextName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        this.accessContextName = accessContextName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    // PUBLIC METHODS from SnmpMibRequest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * Returns the local engine. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * @return the local engine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
    90
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public SnmpEngine getEngine() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        return engine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * Gets the incoming request principal. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @return The request principal.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     **/
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
    99
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public String getPrincipal() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        return principal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * Gets the incoming request security level. This level is defined in {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @return The security level.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     */
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   108
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    public int getSecurityLevel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        return securityLevel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * Gets the incoming request security model. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise -1 is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * @return The security model.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     */
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   116
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    public int getSecurityModel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        return securityModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * Gets the incoming request context name. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * @return The context name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   124
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    public byte[] getContextName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        return contextName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * Gets the incoming request context name used by Access Control Model in order to allow or deny the access to OIDs. This parameter is returned only if <CODE> SnmpV3AdaptorServer </CODE> is the adaptor receiving this request. Otherwise null is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @return The checked context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     */
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   133
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    public byte[] getAccessContextName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        return accessContextName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   142
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    public final SnmpPdu getPdu() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        return reqPdu;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   151
    @Override
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   152
    public final Enumeration<SnmpVarBind> getElements()  {return varbinds.elements();}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   158
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public final Vector<SnmpVarBind> getSubList()  {return varbinds;}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   165
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    public final int getSize()  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        if (varbinds == null) return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        return varbinds.size();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   175
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public final int         getVersion()  {return version;}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   182
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    public final int         getRequestPduVersion()  {return reqPdu.version;}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   189
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    public final Object      getUserData() {return data;}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   196
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public final int getVarIndex(SnmpVarBind varbind) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        return varbinds.indexOf(varbind);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    // Implements the method defined in SnmpMibRequest interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    // See SnmpMibRequest for the java doc.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   205
    @Override
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    public void addVarBind(SnmpVarBind varbind) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        varbinds.addElement(varbind);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    // PACKAGE METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    // Allow to pass the request tree built during the check() phase
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    // to the set() method. Note: the if the tree is `null', then the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    // set() method will rebuild a new tree identical to the tree built
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    // in the check() method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    // Passing this tree in the SnmpMibRequestImpl object allows to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    // optimize the SET requests.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    final void setRequestTree(SnmpRequestTree tree) {this.tree = tree;}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    // Returns the SnmpRequestTree object built in the first operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    // phase for two-phase SNMP requests (like SET).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    final SnmpRequestTree getRequestTree() {return tree;}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    // Returns the underlying vector of SNMP varbinds (used for algorithm
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    // optimization).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    // -------------------------------------------------------------------
14677
1607f4cfc506 8003476: Cleanup warnings in com.sun.jmx.snmp code
dfuchs
parents: 5506
diff changeset
   236
    final Vector<SnmpVarBind> getVarbinds() {return varbinds;}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    // Private variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    // -------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    // Ideally these variables should be declared final but it makes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    // the jdk1.1.x compiler complain (seems to be a compiler bug, jdk1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    // is OK).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    private Vector<SnmpVarBind> varbinds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    private int    version;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    private Object data;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    private SnmpPdu reqPdu = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    // Non final variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    private SnmpRequestTree tree = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    private SnmpEngine engine = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    private String principal = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    private int securityLevel = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    private int securityModel = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    private byte[] contextName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    private byte[] accessContextName = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
}