Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.archive.uid
Class UUIDGenerator

    java.lang.Object
      org.archive.uid.UUIDGenerator

All Implemented Interfaces:
  Generator

     class UUIDGenerator

extends java.lang.Object
implements Generator

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: 4607 $ $Date: 2006-09-07 20:23:51 +0000 (Thu, 07 Sep 2006) $
Author:
  stack
See Also:
  RFC4122

Constructor Summary
`UUIDGenerator()`

Method Summary
`java.net.URI` | `getQualifiedRecordID(java.util.Map<java.lang.String,java.lang.String> qualifiers)`
`java.net.URI` | `getQualifiedRecordID(java.lang.String key, java.lang.String value)`
`java.net.URI` | `getRecordID()`
`java.net.URI` | `qualifyRecordID(java.net.URI recordId, java.util.Map<java.lang.String,java.lang.String> qualifiers)` Append (or if already present, update) qualifiers to passed `recordId`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### UUIDGenerator

    UUIDGenerator()

Method Detail

### qualifyRecordID

    public java.net.URI qualifyRecordID(java.net.URI recordId,
                                        java.util.Map<java.lang.String,java.lang.String> qualifiers)
                                 throws java.net.URISyntaxException

  Description copied from interface: `Generator`
  Append (or if already present, update) qualifiers to passed `recordId`. 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 `Generator.getRecordID()`, returning a new URI unrelated to the passed recordId and passed qualifier.

  Specified by:
    `qualifyRecordID` in interface `Generator`
  Parameters:
    `recordId` - URI to append qualifier to.
    `qualifiers` - Map of qualifier values keyed by qualifier name.
  Returns:
    New URI based off passed `uri` and passed qualifier.
  Throws:
    `java.net.URISyntaxException` - if probably constructing URI OR if the resultant UUID does not differ from the one passed.

### getRecordID

    public java.net.URI getRecordID()
                             throws java.net.URISyntaxException

  Specified by:
    `getRecordID` in interface `Generator`
  Returns:
    A URI that can serve as a record-id.
  Throws:
    `java.net.URISyntaxException`

### getQualifiedRecordID

    public java.net.URI getQualifiedRecordID(java.lang.String key,
                                             java.lang.String value)
                                      throws java.net.URISyntaxException

  Specified by:
    `getQualifiedRecordID` in interface `Generator`
  Parameters:
    `key` - Name of qualifier
    `value` - Value of qualifier
  Returns:
    A URI qualified with passed `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).
  Throws:
    `java.net.URISyntaxException`

### getQualifiedRecordID

    public java.net.URI getQualifiedRecordID(java.util.Map<java.lang.String,java.lang.String> qualifiers)
                                      throws java.net.URISyntaxException

  Specified by:
    `getQualifiedRecordID` in interface `Generator`
  Parameters:
    `qualifiers` - Qualifiers to add.
  Returns:
    A URI qualified with passed `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).
  Throws:
    `java.net.URISyntaxException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Internet Archive. All Rights Reserved.