net.percederberg.mibble.snmp
Class SnmpAccess

java.lang.Object
  extended by net.percederberg.mibble.snmp.SnmpAccess

public class SnmpAccess
extends java.lang.Object

An SNMP access mode value. This class is used to encapsulate the access value constants used in several SNMP macro types. Note that due to the support for both SMIv1 and SMIv2 not all of the constants defined in this class can be present in all files. Please see the comments for each individual constant regarding the support for different SNMP versions.

Since:
2.0

Field Summary
static SnmpAccess ACCESSIBLE_FOR_NOTIFY
          The accesible for notify SNMP access mode.
static SnmpAccess NOT_ACCESSIBLE
          The not accesible SNMP access mode.
static SnmpAccess NOT_IMPLEMENTED
          The not implemented SNMP access mode.
static SnmpAccess READ_CREATE
          The read-create SNMP access mode.
static SnmpAccess READ_ONLY
          The read-only SNMP access mode.
static SnmpAccess READ_WRITE
          The read-write SNMP access mode.
static SnmpAccess WRITE_ONLY
          The write-only SNMP access mode.
 
Method Summary
 boolean canRead()
          Checks if this access mode allows reading the value.
 boolean canWrite()
          Checks if this access mode allows writing the value.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_IMPLEMENTED

public static final SnmpAccess NOT_IMPLEMENTED
The not implemented SNMP access mode. This mode is only used in SMIv2 variation declarations inside an agent capabilities declaration.


NOT_ACCESSIBLE

public static final SnmpAccess NOT_ACCESSIBLE
The not accesible SNMP access mode.


ACCESSIBLE_FOR_NOTIFY

public static final SnmpAccess ACCESSIBLE_FOR_NOTIFY
The accesible for notify SNMP access mode. This mode is only used in SMIv2.


READ_ONLY

public static final SnmpAccess READ_ONLY
The read-only SNMP access mode.


READ_WRITE

public static final SnmpAccess READ_WRITE
The read-write SNMP access mode.


READ_CREATE

public static final SnmpAccess READ_CREATE
The read-create SNMP access mode. This mode is only used in SMIv2.


WRITE_ONLY

public static final SnmpAccess WRITE_ONLY
The write-only SNMP access mode. This mode is only used in SMIv1.

Method Detail

canRead

public boolean canRead()
Checks if this access mode allows reading the value.

Returns:
true if reading is allowed, or false otherwise
Since:
2.5

canWrite

public boolean canWrite()
Checks if this access mode allows writing the value.

Returns:
true if writing is allowed, or false otherwise
Since:
2.5

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object