Novell exteNd
Director 5.2 API

com.sssw.fw.util
Class EboUUID

java.lang.Object
 |
 +--com.sssw.fw.util.EboUUID
All Implemented Interfaces:
Serializable

public class EboUUID
extends Object
implements Serializable

Universally Unique Identifier

See Also:
Serialized Form

Constructor Summary
EboUUID(long hiTag, long loTag)
          Constructor
 
Method Summary
 boolean equals(Object obj)
          Compare the argument to this UUID.
static EboUUID generate()
          Generate a new Universally Unique Identifier For Netware, uses Netware's native uuid generation api.
static EboUUID generateUUIDFromByteArray(byte[] bytes)
          Generate the UUID from its byte array representation
static EboUUID generateUUIDFromEncodedString(String uidStr)
          Deprecated.  
static EboUUID generateUUIDFromString(String uidStr)
          Generate the UUID from its String representation
 long highValue()
          Get the high order value
static byte hiNibble(byte b)
          Get the high nibble (4 most significant bits) as a byte value
static boolean isUniversallyUnique()
          Get the boolean indicating if the UUIDs being returned are truely universally unigue.
static byte loNibble(byte b)
          Get the low nibble (4 least significant bits) as a byte value
 long lowValue()
          Get the low order value
static byte setHiNibble(byte dest, int b)
          Set the hi nibble of the destination with the 2nd rightmost nibble value of source
static byte setLoNibble(byte dest, int b)
          Set the lo nibble of the destination with the low nibble value of source
 byte[] toByteArray()
          Transform the internal representation into an array of 16 bytes
 String toPrintableString()
          Create a human readable string that is the ascii representation of the UUID value.
static String toPrintableString(byte[] bytes)
          Generate the human readable String value for the UUID byte array.
 String toString()
          Get the String representation of this UUID
static String toString(byte[] bytes)
          Generate the String value for the UUID byte array.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EboUUID

public EboUUID(long hiTag,
               long loTag)
Constructor
Method Detail

isUniversallyUnique

public static final boolean isUniversallyUnique()
Get the boolean indicating if the UUIDs being returned are truely universally unigue.
Returns:
g_universallyUnique boolean

loNibble

public static final byte loNibble(byte b)
Get the low nibble (4 least significant bits) as a byte value
Parameters:
b - source byte to extract low nibble from
Returns:
low nibble as a byte value

hiNibble

public static final byte hiNibble(byte b)
Get the high nibble (4 most significant bits) as a byte value
Parameters:
b - source byte to extract high nibble from
Returns:
high nibble as a byte value (right shifted to lsbytes)

setLoNibble

public static final byte setLoNibble(byte dest,
                                     int b)
Set the lo nibble of the destination with the low nibble value of source
Parameters:
dest - destination of set operation
b - source of low nibble value
Returns:
destination set with new lo nibble

setHiNibble

public static final byte setHiNibble(byte dest,
                                     int b)
Set the hi nibble of the destination with the 2nd rightmost nibble value of source
Parameters:
dest - destination of set operation
b - source of nibble value
Returns:
destination set with new hi nibble

toPrintableString

public static String toPrintableString(byte[] bytes)
Generate the human readable String value for the UUID byte array. The string consists of eight hexadecimal digits followed by a hyphen, then three groups of four hexadecimal digits each followed by a hyphen, then twelve hexadecimal digits. Example - 6B29FC40-CA47-1067-B31D-00DD010662DA
Parameters:
bytes - array of 16 bytes
Returns:
String representation of byte array as Hex digits

toString

public static String toString(byte[] bytes)
Generate the String value for the UUID byte array. The string consists of the 32 hex digits that make up the byte array.
Parameters:
bytes - array of 16 bytes
Returns:
String representation of byte array as Hex digits

generateUUIDFromString

public static EboUUID generateUUIDFromString(String uidStr)
                                      throws Exception
Generate the UUID from its String representation
Returns:
UUID object

generateUUIDFromEncodedString

public static EboUUID generateUUIDFromEncodedString(String uidStr)
                                             throws Exception
Deprecated.  

Generate the UUID from its Encodedd String representation
Returns:
UUID object

generateUUIDFromByteArray

public static EboUUID generateUUIDFromByteArray(byte[] bytes)
                                         throws Exception
Generate the UUID from its byte array representation
Returns:
UUID object

generate

public static EboUUID generate()
Generate a new Universally Unique Identifier For Netware, uses Netware's native uuid generation api. For other platforms uses a combination of ethernet address, current time and random bytes to generate a universally unique identifier.
Returns:
new Universally Unique Identifier value

toByteArray

public byte[] toByteArray()
Transform the internal representation into an array of 16 bytes
Returns:
byte array of 16 bytes

toString

public String toString()
Get the String representation of this UUID
Overrides:
toString in class Object
Returns:
String representation

toPrintableString

public String toPrintableString()
Create a human readable string that is the ascii representation of the UUID value.
Returns:
String representing the Compressed com.sssw.rt.form of the UUID

highValue

public long highValue()
Get the high order value
Returns:
high order value of UUID

lowValue

public long lowValue()
Get the low order value
Returns:
low order value of UUID

equals

public boolean equals(Object obj)
Compare the argument to this UUID. Return true if highValue and lowValue values are equal, otherwise false.
Overrides:
equals in class Object
Parameters:
obj - Object which is castable to an EboUUID. If a cast class exception occurs, false is returned.
Returns:
boolean true if equal, otherwise false

Novell exteNd
Director 5.2 API