org.deegree.metadata.persistence.iso.parsing
Class IdUtils

java.lang.Object
  extended by org.deegree.metadata.persistence.iso.parsing.IdUtils

public class IdUtils
extends java.lang.Object

ParsingUtils

Version:
$Revision: 27995 $, $Date: 2010-11-10 20:02:35 +0100 (Mi, 10. Nov 2010) $
Author:
Steffen Thomas, last edited by: $Author: sthomas $

Method Summary
 boolean checkUUIDCompliance(java.lang.String uuid)
           
 java.lang.String generateUUID()
          Method to generate via the Java UUID-API a UUID if there is no identifier available.
static IdUtils newInstance(java.sql.Connection conn)
           
 java.lang.String proveIdExistence(java.lang.String identifier)
          Proves the availability of the identifier in backend.
 java.lang.String proveIdExistence(java.lang.String[] identifier)
          Proves the availability of the identifier in the backend.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static IdUtils newInstance(java.sql.Connection conn)

generateUUID

public java.lang.String generateUUID()
                              throws MetadataInspectorException
Method to generate via the Java UUID-API a UUID if there is no identifier available.
If the generated ID begins with a number then this is replaced with a random letter from the ASCII table. This has to be done because the id attribute in the xml does not support any number at the beginning of an uuid. The uppercase letters are in range from 65 to 90 whereas the lowercase letters are from 97 to 122. After the generation there is a check if (in spite of the nearly impossibility) this uuid exists in the database already.

Returns:
a uuid that is unique in the backend.
Throws:
MetadataStoreException
MetadataInspectorException

proveIdExistence

public java.lang.String proveIdExistence(java.lang.String[] identifier)
                                  throws MetadataStoreException
Proves the availability of the identifier in the backend.

Parameters:
identifier - that is proved, not null.
Returns:
the identifier that is a duplicate of one identifier in backend, or null if the metadata with the identifier is not stored so far.
Throws:
MetadataStoreException

proveIdExistence

public java.lang.String proveIdExistence(java.lang.String identifier)
                                  throws MetadataStoreException
Proves the availability of the identifier in backend.

Parameters:
identifier - that is proved, not null.
Returns:
the identifier that is a duplicate of one identifier in backend, or null if the metadata with the identifier is not stored so far.
Throws:
MetadataStoreException

checkUUIDCompliance

public boolean checkUUIDCompliance(java.lang.String uuid)


Copyright © 2011. All Rights Reserved.