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 GeneratorFactory

    java.lang.Object
      org.archive.uid.GeneratorFactory

All Implemented Interfaces:
  Generator

    public class GeneratorFactory

extends java.lang.Object
implements Generator

Factory that generates uids. Singleton. Default implementation is `UUIDGenerator`. To change, specify alternate implementation of `Generator` with `SYSTEM_PROPERTY_GENERATOR_KEY` system property.

Version:
  $Revision: 4417 $ $Date: 2006-08-02 01:12:00 +0000 (Wed, 02 Aug 2006) $
Author:
  stack

Field Summary
`java.lang.String` | `SYSTEM_PROPERTY_GENERATOR_KEY`

Method Summary
`static GeneratorFactory` | `getFactory()`
`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 uri, 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`

Field Detail

### SYSTEM_PROPERTY_GENERATOR_KEY

    public final java.lang.String SYSTEM_PROPERTY_GENERATOR_KEY

Method Detail

### 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.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`

### 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`

### qualifyRecordID

    public java.net.URI qualifyRecordID(java.net.URI uri,
                                        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:
    `uri` - 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.

### getFactory

    public static GeneratorFactory getFactory()

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.