public class UUIDGenerator extends Object implements RecordIDGenerator
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.| Constructor and Description |
|---|
UUIDGenerator() |
| Modifier and Type | Method and Description |
|---|---|
URI |
getQualifiedRecordID(Map<String,String> qualifiers) |
URI |
getQualifiedRecordID(String key,
String value) |
URI |
getRecordID() |
URI |
qualifyRecordID(URI recordId,
Map<String,String> qualifiers)
Append (or if already present, update) qualifiers to passed
recordId. |
public URI qualifyRecordID(URI recordId, Map<String,String> qualifiers)
RecordIDGeneratorrecordId. 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 call
RecordIDGenerator.getRecordID(), returning a new URI unrelated to the passed
recordId and passed qualifier.qualifyRecordID in interface RecordIDGeneratorrecordId - URI to append qualifier to.qualifiers - Map of qualifier values keyed by qualifier name.uri and passed qualifier.public URI getRecordID()
getRecordID in interface RecordIDGeneratorpublic URI getQualifiedRecordID(String key, String value)
getQualifiedRecordID in interface RecordIDGeneratorkey - Name of qualifiervalue - Value of qualifierqualifiers that can
serve as a record-id, or, a new, unique record-id without qualifiers
(if qualifiers not easily implemented using passed URI scheme).public URI getQualifiedRecordID(Map<String,String> qualifiers)
getQualifiedRecordID in interface RecordIDGeneratorqualifiers - Qualifiers to add.qualifiers that can
serve as a record-id, or, a new, unique record-id without qualifiers
(if qualifiers not easily implemented using passed URI scheme).Copyright © 2015 The International Internet Preservation Consortium. All Rights Reserved.