Class UUIDGenerator
java.lang.Object
org.apache.activemq.artemis.utils.UUIDGenerator
-
Method Summary
Modifier and TypeMethodDescriptionfromJavaUUID(UUID uuid) byte[]generateTimeBasedUUID(byte[] byteAddr) static byte[]If running java 6 or above, returnsNetworkInterface.getHardwareAddress(), else returnnull.static UUIDGeneratorMethod used for accessing the singleton generator instance.Method for getting the shared random number generator used for generating the UUIDs.static byte[]getZeroPaddedSixBytes(byte[] bytes)
-
Method Details
-
getInstance
Method used for accessing the singleton generator instance.- Returns:
- Instance of UUID Generator
-
getRandomNumberGenerator
Method for getting the shared random number generator used for generating the UUIDs. This way the initialization cost is only taken once; access need not be synchronized (or in cases where it has to, SecureRandom takes care of it); it might even be good for getting really 'random' stuff to get shared access..- Returns:
- A Random number generator
-
generateTimeBasedUUID
-
fromJavaUUID
-
generateDummyAddress
public byte[] generateDummyAddress() -
getHardwareAddress
public static byte[] getHardwareAddress()If running java 6 or above, returnsNetworkInterface.getHardwareAddress(), else returnnull. The first hardware address is returned when iterating all the NetworkInterfaces- Returns:
- A byte array containing the hardware address
-
generateSimpleStringUUID
-
generateUUID
-
generateStringUUID
-
getZeroPaddedSixBytes
public static byte[] getZeroPaddedSixBytes(byte[] bytes)
-