com.sun.management.snmp.mpm
Class SnmpMsgTranslatorV1V2

java.lang.Object
  extended by com.sun.management.snmp.mpm.SnmpMsgTranslatorV1V2
All Implemented Interfaces:
SnmpMsgTranslator
Direct Known Subclasses:
SnmpMsgTranslatorCs2Ctxt

public class SnmpMsgTranslatorV1V2
extends Object
implements SnmpMsgTranslator

This translator is dedicated to translate V1 V2 parameters in the context of SNMP V3 messages. It infers some parameters such as context name and context engine Id.

Since:
Java DMK 5.1

Constructor Summary
SnmpMsgTranslatorV1V2(SnmpEngine engine)
           
 
Method Summary
 byte[] getAccessContext(SnmpMsg msg)
          The access context (used in IP ACL) is the community string.
 byte[] getContextEngineId(SnmpMsg msg)
          Context engine Id is ALL THE TIME the local one.
 byte[] getContextName(SnmpMsg msg)
          A context name can be added at the end of the community string via @ separator.
 byte[] getEncryptedPdu(SnmpMsg msg)
          No encryption, returns null.
 byte[] getFlatSecurityParameters(SnmpMsg msg)
          The IP address is used as the ACL key.
 byte getMsgFlags(SnmpMsg msg)
          Returns the message flags.
 int getMsgId(SnmpMsg msg)
          Returns the request or message Id contained in the passed message.
 int getMsgMaxSize(SnmpMsg msg)
          Returns the response max message size.
 int getMsgSecurityModel(SnmpMsg msg)
          Returns the message security model.
 byte[] getRawContextName(SnmpMsg msg)
          The received community string contains : The context Name + the access context (via @ separator).
 int getSecurityLevel(SnmpMsg msg)
          Returns the message security level.
 SnmpSecurityParameters getSecurityParameters(SnmpMsg msg)
          Returns the message security parameters.
 void setContextEngineId(SnmpMsg req, byte[] contextEngineId)
          Does nothing, is used in V3 to set the context engine id after decryption.
 void setContextName(SnmpMsg req, byte[] contextName)
          Does nothing, is used in V3 to set the context name after decryption.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpMsgTranslatorV1V2

public SnmpMsgTranslatorV1V2(SnmpEngine engine)
Method Detail

getMsgId

public int getMsgId(SnmpMsg msg)
Description copied from interface: SnmpMsgTranslator
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.

Specified by:
getMsgId in interface SnmpMsgTranslator

getMsgMaxSize

public int getMsgMaxSize(SnmpMsg msg)
Description copied from interface: SnmpMsgTranslator
Returns the response max message size. The message is a generic one that is narrowed in the object implementing this interface.

Specified by:
getMsgMaxSize in interface SnmpMsgTranslator

getMsgFlags

public byte getMsgFlags(SnmpMsg msg)
Description copied from interface: SnmpMsgTranslator
Returns the message flags. The message is a generic one that is narrowed in the object implementing this interface.

Specified by:
getMsgFlags in interface SnmpMsgTranslator

getSecurityLevel

public int getSecurityLevel(SnmpMsg msg)
Description copied from interface: SnmpMsgTranslator
Returns the message security level. The message is a generic one that is narrowed in the object implementing this interface.

Specified by:
getSecurityLevel in interface SnmpMsgTranslator

getMsgSecurityModel

public int getMsgSecurityModel(SnmpMsg msg)
Description copied from interface: SnmpMsgTranslator
Returns the message security model. The message is a generic one that is narrowed in the object implementing this interface.

Specified by:
getMsgSecurityModel in interface SnmpMsgTranslator

getSecurityParameters

public SnmpSecurityParameters getSecurityParameters(SnmpMsg msg)
Description copied from interface: SnmpMsgTranslator
Returns the message security parameters. The message is a generic one that is narrowed in the object implementing this interface.

Specified by:
getSecurityParameters in interface SnmpMsgTranslator

getFlatSecurityParameters

public byte[] getFlatSecurityParameters(SnmpMsg msg)
The IP address is used as the ACL key. It is returned in this call.

Specified by:
getFlatSecurityParameters in interface SnmpMsgTranslator

getContextEngineId

public byte[] getContextEngineId(SnmpMsg msg)
Context engine Id is ALL THE TIME the local one. No proxy notion.

Specified by:
getContextEngineId in interface SnmpMsgTranslator

getRawContextName

public byte[] getRawContextName(SnmpMsg msg)
The received community string contains : The context Name + the access context (via @ separator).

Specified by:
getRawContextName in interface SnmpMsgTranslator

getContextName

public byte[] getContextName(SnmpMsg msg)
A context name can be added at the end of the community string via @ separator. If no @ is located, null is returned.

Specified by:
getContextName in interface SnmpMsgTranslator

getAccessContext

public byte[] getAccessContext(SnmpMsg msg)
The access context (used in IP ACL) is the community string. The community string or null is returned.

Specified by:
getAccessContext in interface SnmpMsgTranslator

getEncryptedPdu

public byte[] getEncryptedPdu(SnmpMsg msg)
No encryption, returns null.

Specified by:
getEncryptedPdu in interface SnmpMsgTranslator

setContextName

public void setContextName(SnmpMsg req,
                           byte[] contextName)
Does nothing, is used in V3 to set the context name after decryption.

Specified by:
setContextName in interface SnmpMsgTranslator

setContextEngineId

public void setContextEngineId(SnmpMsg req,
                               byte[] contextEngineId)
Does nothing, is used in V3 to set the context engine id after decryption.

Specified by:
setContextEngineId in interface SnmpMsgTranslator

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.