Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.co.westhawk.snmp.stack
Interface SnmpContextv3Face

All Superinterfaces:
  SnmpContextBasisFace

All Known Implementing Classes:
  SnmpContextv3Basis, SnmpContextv3Pool

public interface SnmpContextv3Face
extends SnmpContextBasisFace

This interface contains the SNMP context interface that is needed by every PDU to send a SNMP v3 request. See SNMP-USER-BASED-SM-MIB, RFC 3411.

Version:
  $Revision: 3.18 $ $Date: 2006/03/23 14:54:10 $
Author:
  Birgit Arkesteijn

Field Summary
`static java.lang.String` | `Default_ContextName` The default Context Name.
`static java.lang.String` | `Default_UserName` The default value for the (security) user name.
`static int` | `MD5_PROTOCOL` The MD5 protocol type.
`static java.lang.String[]` | `ProtocolNames` The array with the String represensations of the protocols.
`static int` | `SHA1_PROTOCOL` The SHA-1 protocol type.
`static int` | `SNMPv1_Security_Model` The SNMPv1 security model.
`static int` | `SNMPv2c_Security_Model` The SNMPv2c security model.
`static int` | `USM_Security_Model` The USM security model.
`static java.lang.String` | `version_id`

Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
`DEFAULT_PORT, KVM_SOCKET, MAXPDU, MSS, NETSCAPE_SOCKET, STANDARD_SOCKET, TCP_SOCKET`

Method Summary
`boolean` | `addDiscoveryPdu(DiscoveryPdu pdu)` Adds a discovery PDU.
`byte[]` | `encodeDiscoveryPacket(byte msg_type, int rId, int errstat, int errind, java.util.Enumeration ve, java.lang.Object obj)` Encodes a discovery PDU.
`int` | `getAuthenticationProtocol()` Returns the protocol to be used for authentication.
`byte[]` | `getContextEngineId()` Returns the contextEngineID.
`java.lang.String` | `getContextName()` Returns the contextName.
`java.lang.String` | `getUserAuthenticationPassword()` Returns the user authentication password.
`java.lang.String` | `getUserName()` Returns the username.
`java.lang.String` | `getUserPrivacyPassword()` Returns the user privacy password.
`UsmAgent` | `getUsmAgent()` Returns the UsmAgent.
`boolean` | `isUseAuthentication()` Returns if authentication is used or not.
`boolean` | `isUsePrivacy()` Returns if privacy is used or not.
`void` | `setAuthenticationProtocol(int protocol)` Sets the protocol to be used for authentication.
`void` | `setContextEngineId(byte[] newContextEngineId)` Sets the contextEngineID.
`void` | `setContextName(java.lang.String newContextName)` Sets the contextName.
`void` | `setUseAuthentication(boolean newUseAuthentication)` Sets whether authentication has to be used.
`void` | `setUsePrivacy(boolean newUsePrivacy)` Sets whether privacy has to be used.
`void` | `setUserAuthenticationPassword(java.lang.String newUserAuthPassword)` Sets the user authentication password.
`void` | `setUserName(java.lang.String newUserName)` Sets the username.
`void` | `setUserPrivacyPassword(java.lang.String newUserAuthPassword)` Sets the user privacy password.
`void` | `setUsmAgent(UsmAgent agent)` Sets the UsmAgent, needed when this stack is used as authoritative SNMP engine.

Methods inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
`addPdu, addRequestPduListener, addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, clone, destroy, encodePacket, getBindAddress, getHashKey, getHost, getPort, getReceivedFromHostAddress, getSendToHostAddress, getTypeSocket, getVersion, isDestroyed, processIncomingPdu, removePdu, removeRequestPduListener, removeRequestPduListener, removeRequestPduListener, removeTrapListener, removeTrapListener, removeTrapListener, sendPacket`

Field Detail

### version_id

    public static final java.lang.String version_id

See Also:
  Constant Field Values

### SNMPv1_Security_Model

    public static final int SNMPv1_Security_Model

  The SNMPv1 security model. This has value 1. The stack does not implement this security model.

  See Also:
    Constant Field Values

### SNMPv2c_Security_Model

    public static final int SNMPv2c_Security_Model

  The SNMPv2c security model. This has value 2. The stack does not implement this security model.

  See Also:
    Constant Field Values

### USM_Security_Model

    public static final int USM_Security_Model

  The USM security model. This has value 3. This stack only implements this security model!

  See Also:
    Constant Field Values

### MD5_PROTOCOL

    public static final int MD5_PROTOCOL

  The MD5 protocol type.

  See Also:
    Constant Field Values

### SHA1_PROTOCOL

    public static final int SHA1_PROTOCOL

  The SHA-1 protocol type.

  See Also:
    Constant Field Values

### Default_UserName

    public static final java.lang.String Default_UserName

  The default value for the (security) user name. This is "initial".

  See Also:
    Constant Field Values

### Default_ContextName

    public static final java.lang.String Default_ContextName

  The default Context Name. This is the zero length string, i.e. "".

  See Also:
    Constant Field Values

### ProtocolNames

    public static final java.lang.String[] ProtocolNames

  The array with the String represensations of the protocols.

Method Detail

### getUserName

    public java.lang.String getUserName()

  Returns the username.

  Returns:
    the username

### setUserName

    public void setUserName(java.lang.String newUserName)

  Sets the username. This username will be used for all PDUs sent with this context. The username corresponds to the 'msgUserName' in SNMP-USER-BASED-SM-MIB. The default value is "initial".

  Parameters:
    `newUserName` - The new username

### isUseAuthentication

    public boolean isUseAuthentication()

  Returns if authentication is used or not. By default no authentication will be used.

  Returns:
    true if authentication is used, false if not

### setUseAuthentication

    public void setUseAuthentication(boolean newUseAuthentication)

  Sets whether authentication has to be used. By default no authentication will be used.

  Parameters:
    `newUseAuthentication` - The use of authentication

### getUserAuthenticationPassword

    public java.lang.String getUserAuthenticationPassword()

  Returns the user authentication password. This password will be transformed into the user authentication secret key.

  Returns:
    The user authentication password

### setUserAuthenticationPassword

    public void setUserAuthenticationPassword(java.lang.String newUserAuthPassword)
                                       throws java.lang.IllegalArgumentException

  Sets the user authentication password. This password will be transformed into the user authentication secret key. A user MUST set this password.

  Parameters:
    `newUserAuthPassword` - The user authentication password
    `java.lang.IllegalArgumentException`

### setAuthenticationProtocol

    public void setAuthenticationProtocol(int protocol)
                                   throws java.lang.IllegalArgumentException

  Sets the protocol to be used for authentication. This can either be MD5 or SHA-1. By default MD5 will be used.

  Parameters:
    `protocol` - The authentication protocol to be used
    `java.lang.IllegalArgumentException`
  See Also:
    `MD5_PROTOCOL`, `SHA1_PROTOCOL`

### getAuthenticationProtocol

    public int getAuthenticationProtocol()

  Returns the protocol to be used for authentication. This can either be MD5 or SHA-1. By default MD5 will be used.

  Returns:
    The authentication protocol to be used
  See Also:
    `MD5_PROTOCOL`, `SHA1_PROTOCOL`

### isUsePrivacy

    public boolean isUsePrivacy()

  Returns if privacy is used or not. By default no privacy will be used.

  Returns:
    true if privacy is used, false if not

### setUsePrivacy

    public void setUsePrivacy(boolean newUsePrivacy)

  Sets whether privacy has to be used. By default no privacy will be used.

  Parameters:
    `newUsePrivacy` - The use of privacy

### getUserPrivacyPassword

    public java.lang.String getUserPrivacyPassword()

  Returns the user privacy password. This password will be transformed into the user privacy secret key.

  Returns:
    The user privacy password

### setUserPrivacyPassword

    public void setUserPrivacyPassword(java.lang.String newUserAuthPassword)
                                throws java.lang.IllegalArgumentException

  Sets the user privacy password. This password will be transformed into the user privacy secret key. A user MUST set this password.

  Parameters:
    `newUserAuthPassword` - The user privacy password
    `java.lang.IllegalArgumentException`

### setContextEngineId

    public void setContextEngineId(byte[] newContextEngineId)
                            throws java.lang.IllegalArgumentException

  Sets the contextEngineID. See RFC 3411. A contextEngineID uniquely identifies an SNMP entity that may realize an instance of a context with a particular contextName.

  Note, when the stack is an authoritative engine, this parameter should equal the UsmAgent.getSnmpEngineId(). See the StackUsage documentation for an explanation.

  If the contextEngineID is of length zero, the encoder will use the (discovered) snmpEngineId.

  Parameters:
    `newContextEngineId` - The contextEngineID
    `java.lang.IllegalArgumentException`
  See Also:
    `UsmAgent.getSnmpEngineId()`

### getContextEngineId

    public byte[] getContextEngineId()

  Returns the contextEngineID.

  Returns:
    The contextEngineID

### setContextName

    public void setContextName(java.lang.String newContextName)

  Sets the contextName. See RFC 3411. A contextName is used to name a context. Each contextName MUST be unique within an SNMP entity. By default this is "".

  Parameters:
    `newContextName` - The contextName
  See Also:
    `Default_ContextName`

### getContextName

    public java.lang.String getContextName()

  Returns the contextName.

  Returns:
    The contextName

### addDiscoveryPdu

    public boolean addDiscoveryPdu(DiscoveryPdu pdu)
                            throws java.io.IOException,
                                   PduException

  Adds a discovery PDU. This is for internal use only and should NOT be called by the developer. This is called by the the PDU itself and is added to the interface to cover the different kind of Contexts.

  Parameters:
    `pdu` - the discovery PDU
  Returns:
    PDU is succesful added
    `java.io.IOException`
    `PduException`

### encodeDiscoveryPacket

    public byte[] encodeDiscoveryPacket(byte msg_type,
                                        int rId,
                                        int errstat,
                                        int errind,
                                        java.util.Enumeration ve,
                                        java.lang.Object obj)
                                 throws java.io.IOException,
                                        EncodingException

  Encodes a discovery PDU. This is for internal use only and should NOT be called by the developer. This is called by the the PDU itself and is added to the interface to cover the different kind of Contexts.

  Returns:
    The encoded packet
    `java.io.IOException`
    `EncodingException`

### setUsmAgent

    public void setUsmAgent(UsmAgent agent)

  Sets the UsmAgent, needed when this stack is used as authoritative SNMP engine. This interface provides authentiation details, like its clock and its Engine ID.

  Parameters:
    `agent` - The USM authoritative interface
  Since:
    4_14

### getUsmAgent

    public UsmAgent getUsmAgent()

  Returns the UsmAgent.

  Since:
    4_14
  See Also:
    `setUsmAgent(uk.co.westhawk.snmp.stack.UsmAgent)`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SNMP Stack 5_1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD