Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/jmx/snmp/SnmpScopedPduBulk.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* Represents a <CODE>get-bulk</CODE> PDU as defined in RFC 1448.27* <P>28* <P>29* The <CODE>SnmpSocpedPduBulk</CODE> extends {@link com.sun.jmx.snmp.SnmpScopedPduPacket SnmpScopedPduPacket}30* and defines attributes specific to the <CODE>get-bulk</CODE> PDU (see RFC 1448).31*32* <p><b>This API is a Sun Microsystems internal API and is subject33* to change without notice.</b></p>34* @since 1.535*/3637public class SnmpScopedPduBulk extends SnmpScopedPduPacket38implements SnmpPduBulkType {39private static final long serialVersionUID = -1648623646227038885L;4041/**42* The <CODE>non-repeaters</CODE> value.43* @serial44*/45int nonRepeaters;464748/**49* The <CODE>max-repetitions</CODE> value.50* @serial51*/52int maxRepetitions;5354public SnmpScopedPduBulk() {55type = pduGetBulkRequestPdu;56version = snmpVersionThree;57}5859/**60* The <CODE>max-repetitions</CODE> setter.61* @param max Maximum repetition.62*/63public void setMaxRepetitions(int max) {64maxRepetitions = max;65}6667/**68* The <CODE>non-repeaters</CODE> setter.69* @param nr Non repeaters.70*/71public void setNonRepeaters(int nr) {72nonRepeaters = nr;73}7475/**76* The <CODE>max-repetitions</CODE> getter.77* @return Maximum repetition.78*/79public int getMaxRepetitions() { return maxRepetitions; }8081/**82* The <CODE>non-repeaters</CODE> getter.83* @return Non repeaters.84*/85public int getNonRepeaters() { return nonRepeaters; }8687/**88* Generates the pdu to use for response.89* @return Response pdu.90*/91public SnmpPdu getResponsePdu() {92SnmpScopedPduRequest result = new SnmpScopedPduRequest();93result.address = address ;94result.port = port ;95result.version = version ;96result.requestId = requestId;97result.msgId = msgId;98result.msgMaxSize = msgMaxSize;99result.msgFlags = msgFlags;100result.msgSecurityModel = msgSecurityModel;101result.contextEngineId = contextEngineId;102result.contextName = contextName;103result.securityParameters = securityParameters;104result.type = pduGetResponsePdu ;105result.errorStatus = SnmpDefinitions.snmpRspNoError ;106result.errorIndex = 0 ;107return result;108}109}110111112