com.sun.jaw.snmp.common
Class SnmpStringFixed
java.lang.Object
|
+--com.sun.jaw.snmp.common.SnmpValue
|
+--com.sun.jaw.snmp.common.SnmpString
|
+--com.sun.jaw.snmp.common.SnmpStringFixed
- public class SnmpStringFixed
- extends SnmpString
The SnmpStringFixed
class represents an SNMP String
defined with a fixed length.
The class is mainly used when dealing with table indexes for which one of the key
is defined as a String
.
- See Also:
- Serialized Form
Constructor Summary |
SnmpStringFixed(byte[] v)
Constructs a new SnmpStringFixed from the specified bytes array. |
SnmpStringFixed(java.lang.Byte[] v)
Constructs a new SnmpStringFixed with the specified Bytes array. |
SnmpStringFixed(int l,
java.lang.Byte[] v)
Constructs a new SnmpStringFixed from the specified Bytes array
with the specified length. |
SnmpStringFixed(java.lang.String v)
Constructs a new SnmpStringFixed from the specified String value. |
Method Summary |
static void |
appendToOid(int l,
SnmpOid source,
SnmpOid dest)
Appends an SnmpOid representing an SnmpStringFixed to another oid. |
static int |
nextOid(int l,
long[] index,
int start)
Scans an index oid, skip the string value and returns the position
of the next value. |
static SnmpOid |
toOid(int l,
long[] index,
int start)
Extracts the fixed-string from an index oid and returns its
value converted as an SnmpOid . |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
SnmpStringFixed
public SnmpStringFixed(byte[] v)
- Constructs a new
SnmpStringFixed
from the specified bytes array.
- Parameters:
v
- The bytes composing the fixed-string value.
SnmpStringFixed
public SnmpStringFixed(java.lang.Byte[] v)
- Constructs a new
SnmpStringFixed
with the specified Bytes
array.
- Parameters:
v
- The Bytes
composing the fixed-string value.
SnmpStringFixed
public SnmpStringFixed(java.lang.String v)
- Constructs a new
SnmpStringFixed
from the specified String
value.
- Parameters:
v
- The initialization value.
SnmpStringFixed
public SnmpStringFixed(int l,
java.lang.Byte[] v)
throws java.lang.IllegalArgumentException
- Constructs a new
SnmpStringFixed
from the specified Bytes
array
with the specified length.
- Parameters:
l
- The length of the fixed-string.v
- The Bytes
composing the fixed-string value.- Throws:
- java.lang.IllegalArgumentException - Either the length or the Byte array are not valid.
toOid
public static SnmpOid toOid(int l,
long[] index,
int start)
throws SnmpStatusException
- Extracts the fixed-string from an index oid and returns its
value converted as an
SnmpOid
.
- Parameters:
l
- The number of successive array elements to be retreived
in order to construct the oid.
These elements are retreived starting at the start
position.index
- The index array.start
- The position in the index array.- Returns:
- The oid representing the fixed-string value.
- Throws:
- SnmpStatusException - There is no string value
available at start position.
nextOid
public static int nextOid(int l,
long[] index,
int start)
throws SnmpStatusException
- Scans an index oid, skip the string value and returns the position
of the next value.
- Parameters:
l
- The number of successive array elements to be passed
in order to get the position of the next value.
These elements are passed starting at the start
position.index
- The index array.start
- The position in the index array.- Returns:
- The position of the next value.
- Throws:
- SnmpStatusException - There is no string value
available at start position.
appendToOid
public static void appendToOid(int l,
SnmpOid source,
SnmpOid dest)
- Appends an
SnmpOid
representing an SnmpStringFixed
to another oid.
- Parameters:
l
- Unused.source
- An oid representing an SnmpStringFixed
value.dest
- Where source should be appened.