com.sun.management.snmp
Class SnmpStringFixed

java.lang.Object
  extended by com.sun.management.snmp.SnmpValue
      extended by com.sun.management.snmp.SnmpString
          extended by com.sun.management.snmp.SnmpStringFixed
All Implemented Interfaces:
SnmpDataTypeEnums, Serializable, Cloneable

public class SnmpStringFixed
extends SnmpString

Represents an SNMP String defined with a fixed length. The class is mainly used when dealing with table indexes for which one of the keys is defined as a String.

Since:
Java DMK 5.1
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sun.management.snmp.SnmpString
value
 
Fields inherited from interface com.sun.management.snmp.SnmpDataTypeEnums
ApplFlag, BitStringTag, BooleanTag, Counter64Tag, CounterTag, CtxtFlag, errEndOfMibViewTag, errNoSuchInstanceTag, errNoSuchObjectTag, GaugeTag, IntegerTag, IpAddressTag, NsapTag, NullTag, ObjectIdentiferTag, ObjectIdentifierTag, OctetStringTag, OpaqueTag, SequenceTag, TableTag, TimeticksTag, UintegerTag, UnknownSyntaxTag
 
Constructor Summary
SnmpStringFixed(byte[] v)
          Constructs a new SnmpStringFixed from the specified bytes array.
SnmpStringFixed(Byte[] v)
          Constructs a new SnmpStringFixed with the specified Bytes array.
SnmpStringFixed(int l, byte[] v)
          Constructs a new SnmpStringFixed from the specified bytes array with the specified length.
SnmpStringFixed(int l, Byte[] v)
          Constructs a new SnmpStringFixed from the specified Bytes array with the specified length.
SnmpStringFixed(int l, String s)
          Constructs a new SnmpStringFixed from the specified String with the specified length.
SnmpStringFixed(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 com.sun.management.snmp.SnmpString
appendToOid, BinToChar, byteValue, clone, duplicate, getTypeName, HexToChar, inetAddressValue, nextOid, toByte, toOid, toOid, toString
 
Methods inherited from class com.sun.management.snmp.SnmpValue
isEndOfMibViewValue, isNoSuchInstanceValue, isNoSuchObjectValue, toAsn1String
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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(Byte[] v)
Constructs a new SnmpStringFixed with the specified Bytes array.

Parameters:
v - The Bytes composing the fixed-string value.

SnmpStringFixed

public SnmpStringFixed(String v)
Constructs a new SnmpStringFixed from the specified String value.

Parameters:
v - The initialization value.

SnmpStringFixed

public SnmpStringFixed(int l,
                       byte[] v)
                throws 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:
IllegalArgumentException - Either the length or the byte array is not valid.

SnmpStringFixed

public SnmpStringFixed(int l,
                       Byte[] v)
                throws 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:
IllegalArgumentException - Either the length or the Byte array is not valid.

SnmpStringFixed

public SnmpStringFixed(int l,
                       String s)
                throws IllegalArgumentException
Constructs a new SnmpStringFixed from the specified String with the specified length.

Parameters:
l - The length of the fixed-string.
s - The String composing the fixed-string value.
Throws:
IllegalArgumentException - Either the length or the String is not valid.
Method Detail

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 retrieved in order to construct the OID. These elements are retrieved 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 the 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 the 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 appended.

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.