KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)file SnmpScopedPduBulk.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.14
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 package com.sun.jmx.snmp;
12 /**
13  * Represents a <CODE>get-bulk</CODE> PDU as defined in RFC 1448.
14  * <P>
15  * <P>
16  * The <CODE>SnmpSocpedPduBulk</CODE> extends {@link com.sun.jmx.snmp.SnmpScopedPduPacket SnmpScopedPduPacket}
17  * and defines attributes specific to the <CODE>get-bulk</CODE> PDU (see RFC 1448).
18  *
19  * <p><b>This API is a Sun Microsystems internal API and is subject
20  * to change without notice.</b></p>
21  * @since 1.5
22  */

23
24 public class SnmpScopedPduBulk extends SnmpScopedPduPacket
25     implements SnmpPduBulkType {
26
27     /**
28      * The <CODE>non-repeaters</CODE> value.
29      * @serial
30      */

31     int nonRepeaters;
32   
33
34     /**
35      * The <CODE>max-repetitions</CODE> value.
36      * @serial
37      */

38     int maxRepetitions;
39
40     public SnmpScopedPduBulk() {
41     type = pduGetBulkRequestPdu;
42     version = snmpVersionThree;
43     }
44
45     /**
46      * The <CODE>max-repetitions</CODE> setter.
47      * @param max Maximum repetition.
48      */

49     public void setMaxRepetitions(int max) {
50     maxRepetitions = max;
51     }
52
53     /**
54      * The <CODE>non-repeaters</CODE> setter.
55      * @param nr Non repeaters.
56      */

57     public void setNonRepeaters(int nr) {
58     nonRepeaters = nr;
59     }
60
61     /**
62      * The <CODE>max-repetitions</CODE> getter.
63      * @return Maximum repetition.
64      */

65     public int getMaxRepetitions() { return maxRepetitions; }
66
67     /**
68      * The <CODE>non-repeaters</CODE> getter.
69      * @return Non repeaters.
70      */

71     public int getNonRepeaters() { return nonRepeaters; }
72     
73     /**
74      * Generates the pdu to use for response.
75      * @return Response pdu.
76      */

77     public SnmpPdu getResponsePdu() {
78     SnmpScopedPduRequest result = new SnmpScopedPduRequest();
79     result.address = address ;
80     result.port = port ;
81     result.version = version ;
82     result.requestId = requestId;
83     result.msgId = msgId;
84     result.msgMaxSize = msgMaxSize;
85     result.msgFlags = msgFlags;
86     result.msgSecurityModel = msgSecurityModel;
87     result.contextEngineId = contextEngineId;
88     result.contextName = contextName;
89     result.securityParameters = securityParameters;
90     result.type = pduGetResponsePdu ;
91     result.errorStatus = SnmpDefinitions.snmpRspNoError ;
92     result.errorIndex = 0 ;
93     return result;
94     }
95 }
96
Popular Tags