KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > internal > SnmpIncomingResponse


1 /*
2  * @(#)file SnmpIncomingResponse.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 1.16
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.internal;
12
13 import java.net.InetAddress JavaDoc;
14 import com.sun.jmx.snmp.SnmpPduFactory;
15 import com.sun.jmx.snmp.SnmpSecurityParameters;
16 import com.sun.jmx.snmp.SnmpSecurityException;
17 import com.sun.jmx.snmp.SnmpTooBigException;
18 import com.sun.jmx.snmp.SnmpStatusException;
19 import com.sun.jmx.snmp.SnmpPdu;
20 import com.sun.jmx.snmp.SnmpMsg;
21
22 import com.sun.jmx.snmp.internal.SnmpSecurityCache;
23 import com.sun.jmx.snmp.SnmpBadSecurityLevelException;
24 /**
25  * <P> An <CODE>SnmpIncomingResponse</CODE> handles the unmarshalling of the received response.</P>
26  * <p><b>This API is a Sun Microsystems internal API and is subject
27  * to change without notice.</b></p>
28  * @since 1.5
29  */

30
31 public interface SnmpIncomingResponse {
32     /**
33      * Returns the source address.
34      * @return The source address.
35      */

36     public InetAddress JavaDoc getAddress();
37
38     /**
39      * Returns the source port.
40      * @return The source port.
41      */

42     public int getPort();
43
44     /**
45      * Gets the incoming response security parameters.
46      * @return The security parameters.
47      **/

48     public SnmpSecurityParameters getSecurityParameters();
49     /**
50      * Call this method in order to reuse <CODE>SnmpOutgoingRequest</CODE> cache.
51      * @param cache The security cache.
52      */

53     public void setSecurityCache(SnmpSecurityCache cache);
54     /**
55      * Gets the incoming response security level. This level is defined in
56      * {@link com.sun.jmx.snmp.SnmpEngine SnmpEngine}.
57      * @return The security level.
58      */

59     public int getSecurityLevel();
60     /**
61      * Gets the incoming response security model.
62      * @return The security model.
63      */

64     public int getSecurityModel();
65     /**
66      * Gets the incoming response context name.
67      * @return The context name.
68      */

69     public byte[] getContextName();
70     
71     /**
72      * Decodes the specified bytes and initializes itself with the received
73      * response.
74      *
75      * @param inputBytes The bytes to be decoded.
76      *
77      * @exception SnmpStatusException If the specified bytes are not a valid encoding.
78      */

79     public SnmpMsg decodeMessage(byte[] inputBytes,
80                  int byteCount,
81                  InetAddress JavaDoc address,
82                  int port)
83         throws SnmpStatusException, SnmpSecurityException;
84    
85     /**
86      * Gets the request PDU encoded in the received response.
87      * <P>
88      * This method decodes the data field and returns the resulting PDU.
89      *
90      * @return The resulting PDU.
91      * @exception SnmpStatusException If the encoding is not valid.
92      */

93     public SnmpPdu decodeSnmpPdu()
94     throws SnmpStatusException;
95
96     /**
97      * Returns the response request Id.
98      * @param data The flat message.
99      * @return The request Id.
100      */

101     public int getRequestId(byte[] data) throws SnmpStatusException;
102
103     /**
104      * Returns a stringified form of the message to send.
105      * @return The message state string.
106      */

107     public String JavaDoc printMessage();
108 }
109
Popular Tags