KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > mpm > SnmpMsgTranslator


1 /*
2  * @(#)file SnmpMsgTranslator.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.mpm;
12
13 import com.sun.jmx.snmp.SnmpSecurityParameters;
14 import com.sun.jmx.snmp.SnmpMsg;
15 /**
16  * The translator interface is implemented by classes dealing with a specific SNMP protocol version. SnmpMsgTranslator are used in conjonction with SnmpMsgProcessingModel implementations.
17  * <p><b>This API is a Sun Microsystems internal API and is subject
18  * to change without notice.</b></p>
19  * @since 1.5
20  */

21 public interface SnmpMsgTranslator {
22     /**
23      * Returns the request or message Id contained in the passed message. The message is a generic one that is narrowed in the object implementing this interface.
24      */

25     public int getMsgId(SnmpMsg msg);
26     /**
27      * Returns the response max message size. The message is a generic one that is narrowed in the object implementing this interface.
28      */

29     public int getMsgMaxSize(SnmpMsg msg);
30     /**
31      * Returns the message flags. The message is a generic one that is narrowed in the object implementing this interface.
32      */

33     public byte getMsgFlags(SnmpMsg msg);
34     /**
35      * Returns the message security model. The message is a generic one that is narrowed in the object implementing this interface.
36      */

37     public int getMsgSecurityModel(SnmpMsg msg);
38     /**
39      * Returns the message security level. The message is a generic one that is narrowed in the object implementing this interface.
40      */

41     public int getSecurityLevel(SnmpMsg msg);
42      /**
43      * Returns an encoded representation of security parameters contained in the passed msg. The message is a generic one that is narrowed in the object implementing this interface.
44      */

45     public byte[] getFlatSecurityParameters(SnmpMsg msg);
46     /**
47      * Returns the message security parameters. The message is a generic one that is narrowed in the object implementing this interface.
48      */

49     public SnmpSecurityParameters getSecurityParameters(SnmpMsg msg);
50     /**
51      * Returns the message context Engine Id. The message is a generic one that is narrowed in the object implementing this interface.
52      */

53     public byte[] getContextEngineId(SnmpMsg msg);
54     /**
55      * Returns the message context name. The message is a generic one that is narrowed in the object implementing this interface.
56      */

57     public byte[] getContextName(SnmpMsg msg);
58     /**
59      * Returns the raw message context name. Raw mean as it is received from the network, without translation. It can be useful when some data are piggy backed in the context name.The message is a generic one that is narrowed in the object implementing this interface.
60      */

61     public byte[] getRawContextName(SnmpMsg msg);
62     /**
63      * Returns the message accesscontext name. This access context name is used when dealing with access rights (eg: community for V1/V2 or context name for V3).The message is a generic one that is narrowed in the object implementing this interface.
64      */

65     public byte[] getAccessContext(SnmpMsg msg);
66     /**
67      * Returns the message encrypted pdu or null if no encryption. The message is a generic one that is narrowed in the object implementing this interface.
68      */

69     public byte[] getEncryptedPdu(SnmpMsg msg);
70     /**
71      * Set the context name of the passed message.
72      */

73     public void setContextName(SnmpMsg req, byte[] contextName);
74      /**
75      * Set the context engine Id of the passed message.
76      */

77     public void setContextEngineId(SnmpMsg req, byte[] contextEngineId);
78 }
79
Popular Tags