Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/jmx/snmp/SnmpPduBulk.java
38924 views
/*1* Copyright (c) 1998, 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*/242526package com.sun.jmx.snmp;27282930/**31* Represents a <CODE>get-bulk</CODE> PDU as defined in RFC 1448.32* <P>33* You will not usually need to use this class, except if you34* decide to implement your own35* {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} object.36* <P>37* The <CODE>SnmpPduBulk</CODE> extends {@link com.sun.jmx.snmp.SnmpPduPacket SnmpPduPacket}38* and defines attributes specific to the <CODE>get-bulk</CODE> PDU (see RFC 1448).39*40* <p><b>This API is a Sun Microsystems internal API and is subject41* to change without notice.</b></p>42*/4344public class SnmpPduBulk extends SnmpPduPacket45implements SnmpPduBulkType {46private static final long serialVersionUID = -7431306775883371046L;4748/**49* The <CODE>non-repeaters</CODE> value.50* @serial51*/52public int nonRepeaters ;535455/**56* The <CODE>max-repetitions</CODE> value.57* @serial58*/59public int maxRepetitions ;606162/**63* Builds a new <CODE>get-bulk</CODE> PDU.64* <BR><CODE>type</CODE> and <CODE>version</CODE> fields are initialized with65* {@link com.sun.jmx.snmp.SnmpDefinitions#pduGetBulkRequestPdu pduGetBulkRequestPdu}66* and {@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionTwo snmpVersionTwo}.67*/68public SnmpPduBulk() {69type = pduGetBulkRequestPdu ;70version = snmpVersionTwo ;71}72/**73* Implements the <CODE>SnmpPduBulkType</CODE> interface.74*75* @since 1.576*/77public void setMaxRepetitions(int i) {78maxRepetitions = i;79}80/**81* Implements the <CODE>SnmpPduBulkType</CODE> interface.82*83* @since 1.584*/85public void setNonRepeaters(int i) {86nonRepeaters = i;87}88/**89* Implements the <CODE>SnmpPduBulkType</CODE> interface.90*91* @since 1.592*/93public int getMaxRepetitions() { return maxRepetitions; }94/**95* Implements the <CODE>SnmpPduBulkType</CODE> interface.96*97* @since 1.598*/99public int getNonRepeaters() { return nonRepeaters; }100/**101* Implements the <CODE>SnmpAckPdu</CODE> interface.102*103* @since 1.5104*/105public SnmpPdu getResponsePdu() {106SnmpPduRequest result = new SnmpPduRequest();107result.address = address;108result.port = port;109result.version = version;110result.community = community;111result.type = SnmpDefinitions.pduGetResponsePdu;112result.requestId = requestId;113result.errorStatus = SnmpDefinitions.snmpRspNoError;114result.errorIndex = 0;115116return result;117}118}119120121