KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > SnmpPduBulk


1 /*
2  * @(#)file SnmpPduBulk.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 4.17
5  * @(#)date 08/02/09
6  *
7  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
8  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
9  *
10  */

11
12
13 package com.sun.jmx.snmp;
14
15
16
17 /**
18  * Represents a <CODE>get-bulk</CODE> PDU as defined in RFC 1448.
19  * <P>
20  * You will not usually need to use this class, except if you
21  * decide to implement your own
22  * {@link com.sun.jmx.snmp.SnmpPduFactory SnmpPduFactory} object.
23  * <P>
24  * The <CODE>SnmpPduBulk</CODE> extends {@link com.sun.jmx.snmp.SnmpPduPacket SnmpPduPacket}
25  * and defines attributes specific to the <CODE>get-bulk</CODE> PDU (see RFC 1448).
26  *
27  * <p><b>This API is a Sun Microsystems internal API and is subject
28  * to change without notice.</b></p>
29  */

30
31 public class SnmpPduBulk extends SnmpPduPacket
32     implements SnmpPduBulkType {
33
34     /**
35      * The <CODE>non-repeaters</CODE> value.
36      * @serial
37      */

38     public int nonRepeaters ;
39   
40
41     /**
42      * The <CODE>max-repetitions</CODE> value.
43      * @serial
44      */

45     public int maxRepetitions ;
46
47
48     /**
49      * Builds a new <CODE>get-bulk</CODE> PDU.
50      * <BR><CODE>type</CODE> and <CODE>version</CODE> fields are initialized with
51      * {@link com.sun.jmx.snmp.SnmpDefinitions#pduGetBulkRequestPdu pduGetBulkRequestPdu}
52      * and {@link com.sun.jmx.snmp.SnmpDefinitions#snmpVersionTwo snmpVersionTwo}.
53      */

54     public SnmpPduBulk() {
55     type = pduGetBulkRequestPdu ;
56     version = snmpVersionTwo ;
57     }
58     /**
59      * Implements the <CODE>SnmpPduBulkType</CODE> interface.
60      *
61      * @since 1.5
62      */

63     public void setMaxRepetitions(int i) {
64     maxRepetitions = i;
65     }
66     /**
67      * Implements the <CODE>SnmpPduBulkType</CODE> interface.
68      *
69      * @since 1.5
70      */

71     public void setNonRepeaters(int i) {
72     nonRepeaters = i;
73     }
74     /**
75      * Implements the <CODE>SnmpPduBulkType</CODE> interface.
76      *
77      * @since 1.5
78      */

79     public int getMaxRepetitions() { return maxRepetitions; }
80     /**
81      * Implements the <CODE>SnmpPduBulkType</CODE> interface.
82      *
83      * @since 1.5
84      */

85     public int getNonRepeaters() { return nonRepeaters; }
86     /**
87      * Implements the <CODE>SnmpAckPdu</CODE> interface.
88      *
89      * @since 1.5
90      */

91     public SnmpPdu getResponsePdu() {
92     SnmpPduRequest result = new SnmpPduRequest();
93     result.address = address;
94     result.port = port;
95     result.version = version;
96     result.community = community;
97     result.type = SnmpDefinitions.pduGetResponsePdu;
98     result.requestId = requestId;
99     result.errorStatus = SnmpDefinitions.snmpRspNoError;
100     result.errorIndex = 0;
101     
102     return result;
103     }
104 }
105
106
107
108
109
Popular Tags