Class UUIDGenerator
java.lang.Object
org.archive.uid.UUIDGenerator
- All Implemented Interfaces:
RecordIDGenerator
Generates UUIDs, using
java.util.UUID, formatted as URNs from the UUID
namespace [See RFC4122].
Here is an examples of the type of ID it makes:
urn:uuid:0161811f-5da6-4c6e-9808-a2fab97114cf. Always makes a
new identifier even when passed qualifiers.- Version:
- $Revision$ $Date$
- Author:
- stack
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetQualifiedRecordID(String key, String value) getQualifiedRecordID(Map<String, String> qualifiers) qualifyRecordID(URI recordId, Map<String, String> qualifiers) Append (or if already present, update) qualifiers to passedrecordId.
-
Constructor Details
-
UUIDGenerator
public UUIDGenerator()
-
-
Method Details
-
qualifyRecordID
Description copied from interface:RecordIDGeneratorAppend (or if already present, update) qualifiers to passedrecordId. Use with caution. Guard against turning up a result that already exists. Use when writing a group of records inside a single transaction. How qualifiers are appended/updated varies with URI scheme. Its allowed that an invocation of this method does nought but callRecordIDGenerator.getRecordID(), returning a new URI unrelated to the passed recordId and passed qualifier.- Specified by:
qualifyRecordIDin interfaceRecordIDGenerator- Parameters:
recordId- URI to append qualifier to.qualifiers- Map of qualifier values keyed by qualifier name.- Returns:
- New URI based off passed
uriand passed qualifier.
-
getRecordID
- Specified by:
getRecordIDin interfaceRecordIDGenerator- Returns:
- A URI that can serve as a record-id.
-
getQualifiedRecordID
- Specified by:
getQualifiedRecordIDin interfaceRecordIDGenerator- Parameters:
key- Name of qualifiervalue- Value of qualifier- Returns:
- A URI qualified with passed
qualifiersthat can serve as a record-id, or, a new, unique record-id without qualifiers (if qualifiers not easily implemented using passed URI scheme).
-
getQualifiedRecordID
- Specified by:
getQualifiedRecordIDin interfaceRecordIDGenerator- Parameters:
qualifiers- Qualifiers to add.- Returns:
- A URI qualified with passed
qualifiersthat can serve as a record-id, or, a new, unique record-id without qualifiers (if qualifiers not easily implemented using passed URI scheme).
-