Class AbstractUUIDGenerator
java.lang.Object
org.datanucleus.store.valuegenerator.AbstractGenerator<String>
org.datanucleus.store.valuegenerator.AbstractUUIDGenerator
- All Implemented Interfaces:
ValueGenerator<String>
- Direct Known Subclasses:
UUIDHexGenerator
,UUIDStringGenerator
Value generator for a UUID format. To be extended by implementations giving the UUID in particular forms.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static short
(package private) static final int
IP Address of local machine.(package private) static final int
Unique value across JVMs on this machine.Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, name, storeMgr
Fields inherited from interface org.datanucleus.store.valuegenerator.ValueGenerator
PROPERTY_CATALOG_NAME, PROPERTY_CLASS_NAME, PROPERTY_COLUMN_NAME, PROPERTY_FIELD_NAME, PROPERTY_KEY_CACHE_SIZE, PROPERTY_KEY_DATABASE_CACHE_SIZE, PROPERTY_KEY_INITIAL_VALUE, PROPERTY_KEY_MAX_VALUE, PROPERTY_KEY_MIN_VALUE, PROPERTY_ROOT_CLASS_NAME, PROPERTY_SCHEMA_NAME, PROPERTY_SEQUENCE_NAME, PROPERTY_SEQUENCETABLE_CATALOG, PROPERTY_SEQUENCETABLE_NAME_COLUMN, PROPERTY_SEQUENCETABLE_NEXTVAL_COLUMN, PROPERTY_SEQUENCETABLE_SCHEMA, PROPERTY_SEQUENCETABLE_TABLE, PROPERTY_TABLE_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected short
getCount()
Simple counter for identities.protected abstract String
Create an identifier in the required UUID format required.private static int
getIntFromByteArray
(byte[] bytes) Utility to convert a byte array to an int.static Class
Accessor for the storage class for values generated with this generator.protected ValueGenerationBlock
<String> reserveBlock
(long size) Method to reserve "size" values to the block.Methods inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocate, current, currentValue, getName, next, nextValue, obtainGenerationBlock, obtainGenerationBlock, reserveBlock
-
Field Details
-
IP_ADDRESS
static final int IP_ADDRESSIP Address of local machine. -
JVM_UNIQUE
static final int JVM_UNIQUEUnique value across JVMs on this machine. -
counter
static short counter
-
-
Constructor Details
-
AbstractUUIDGenerator
Constructor.- Parameters:
storeMgr
- StoreManagername
- Symbolic name for this generator
-
-
Method Details
-
getStorageClass
Accessor for the storage class for values generated with this generator.- Returns:
- Storage class (in this case String.class)
-
reserveBlock
Method to reserve "size" values to the block.- Specified by:
reserveBlock
in classAbstractGenerator<String>
- Parameters:
size
- The block size- Returns:
- The reserved block
-
getIdentifier
Create an identifier in the required UUID format required.- Returns:
- The identifier
-
getCount
protected short getCount()Simple counter for identities.- Returns:
- The next count value
-
getIntFromByteArray
private static int getIntFromByteArray(byte[] bytes) Utility to convert a byte array to an int.- Parameters:
bytes
- The byte array- Returns:
- The int
-