Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/jmx/snmp/SnmpScopedPduRequest.java
38924 views
/*1* Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/24package com.sun.jmx.snmp;25/**26* Is used to represent <CODE>get</CODE>, <CODE>get-next</CODE>, <CODE>set</CODE>, <CODE>response</CODE> SNMP V3 scoped PDUs.27*28* <p><b>This API is a Sun Microsystems internal API and is subject29* to change without notice.</b></p>30* @since 1.531*/32public class SnmpScopedPduRequest extends SnmpScopedPduPacket33implements SnmpPduRequestType {34private static final long serialVersionUID = 6463060973056773680L;3536int errorStatus=0 ;3738int errorIndex=0 ;3940/**41* Error index setter. Remember that SNMP indices start from 1.42* Thus the corresponding <CODE>SnmpVarBind</CODE> is43* <CODE>varBindList[errorIndex-1]</CODE>.44* @param i Error index.45*/46public void setErrorIndex(int i) {47errorIndex = i;48}49/**50* Error status setter. Statuses are defined in51* {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.52* @param s Error status.53*/54public void setErrorStatus(int s) {55errorStatus = s;56}5758/**59* Error index getter. Remember that SNMP indices start from 1.60* Thus the corresponding <CODE>SnmpVarBind</CODE> is61* <CODE>varBindList[errorIndex-1]</CODE>.62* @return Error index.63*/64public int getErrorIndex() { return errorIndex; }65/**66* Error status getter. Statuses are defined in67* {@link com.sun.jmx.snmp.SnmpDefinitions SnmpDefinitions}.68* @return Error status.69*/70public int getErrorStatus() { return errorStatus; }7172/**73* Generates the pdu to use for response.74* @return Response pdu.75*/76public SnmpPdu getResponsePdu() {77SnmpScopedPduRequest result = new SnmpScopedPduRequest();78result.address = address ;79result.port = port ;80result.version = version ;81result.requestId = requestId;82result.msgId = msgId;83result.msgMaxSize = msgMaxSize;84result.msgFlags = msgFlags;85result.msgSecurityModel = msgSecurityModel;86result.contextEngineId = contextEngineId;87result.contextName = contextName;88result.securityParameters = securityParameters;89result.type = pduGetResponsePdu ;90result.errorStatus = SnmpDefinitions.snmpRspNoError ;91result.errorIndex = 0 ;92return result;93}94}959697