1 23 package org.archive.uid; 24 25 import java.net.URI ; 26 import java.net.URISyntaxException ; 27 import java.util.Map ; 28 import java.util.UUID ; 29 30 42 class UUIDGenerator implements Generator { 43 private static final String SCHEME = "urn:uuid"; 44 private static final String SCHEME_COLON = SCHEME + ":"; 45 46 UUIDGenerator() { 47 super(); 48 } 49 50 public synchronized URI qualifyRecordID(URI recordId, 51 final Map <String , String > qualifiers) 52 throws URISyntaxException { 53 return getRecordID(); 54 } 55 56 private String getUUID() { 57 return UUID.randomUUID().toString(); 58 } 59 60 public URI getRecordID() throws URISyntaxException { 61 return new URI (SCHEME_COLON + getUUID()); 62 } 63 64 public URI getQualifiedRecordID( 65 final String key, final String value) 66 throws URISyntaxException { 67 return getRecordID(); 68 } 69 70 public URI getQualifiedRecordID(Map <String , String > qualifiers) 71 throws URISyntaxException { 72 return getRecordID(); 73 } 74 } | Popular Tags |