Package org.eclipse.ecf.core.identity
Class GUID
- java.lang.Object
- 
- org.eclipse.ecf.core.identity.BaseID
- 
- org.eclipse.ecf.core.identity.StringID
- 
- org.eclipse.ecf.core.identity.GUID
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable,- Principal,- org.eclipse.core.runtime.IAdaptable,- ID
 
 public class GUID extends StringID Globally unique ID implementation class. UsesSecureRandomto create a unique number of given byte length. Default byte length for secure number is 20 bytes. Default algorithm used for creating a SecureRandom instance is SHA1PRNG.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classGUID.GUIDNamespace- 
Nested classes/interfaces inherited from class org.eclipse.ecf.core.identity.StringIDStringID.StringIDNamespace
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static intDEFAULT_BYTE_LENGTHprotected static SecureRandomrandomstatic StringSR_DEFAULT_ALGOstatic StringSR_DEFAULT_PROVIDER
 - 
Constructor SummaryConstructors Modifier Constructor Description GUID()protectedGUID(Namespace n)protectedGUID(Namespace n, int byteLength)protectedGUID(Namespace n, String value)protectedGUID(Namespace n, String algo, String provider, int byteLength)Protected constructor for factory-based construction
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static SecureRandomgetRandom(String algo, String provider)Get SecureRandom instance for creation of random number.protected static voidinitializeRandom(String algo, String provider)StringtoString()- 
Methods inherited from class org.eclipse.ecf.core.identity.StringIDcompareTo, equals, getName, getNamespace, hashCode, namespaceCompareTo, namespaceEquals, namespaceGetName, namespaceHashCode, setEmptyNamespace, toExternalForm
 - 
Methods inherited from class org.eclipse.ecf.core.identity.BaseIDgetAdapter, namespaceToExternalForm
 
- 
 
- 
- 
- 
Field Detail- 
SR_DEFAULT_ALGOpublic static final String SR_DEFAULT_ALGO 
 - 
SR_DEFAULT_PROVIDERpublic static final String SR_DEFAULT_PROVIDER 
 - 
DEFAULT_BYTE_LENGTHpublic static final int DEFAULT_BYTE_LENGTH - See Also:
- Constant Field Values
 
 - 
randomprotected static transient SecureRandom random 
 
- 
 - 
Constructor Detail- 
GUIDpublic GUID() - Since:
- 3.9
 
 - 
GUIDprotected GUID(Namespace n, String algo, String provider, int byteLength) throws IDCreateException Protected constructor for factory-based construction- Parameters:
- n- the Namespace this identity will belong to
- provider- the name of the algorithm to use. See- SecureRandom
- byteLength- the length of the target number (in bytes)
- Throws:
- IDCreateException
 
 - 
GUIDprotected GUID(Namespace n, int byteLength) throws IDCreateException - Throws:
- IDCreateException
 
 - 
GUIDprotected GUID(Namespace n) throws IDCreateException - Throws:
- IDCreateException
 
 
- 
 - 
Method Detail- 
getRandomprotected static SecureRandom getRandom(String algo, String provider) throws Exception Get SecureRandom instance for creation of random number.- Parameters:
- algo- the String algorithm specification (e.g. "SHA1PRNG") for creation of the SecureRandom instance
- provider- the provider of the implementation of the given algorighm (e.g. "SUN")
- Returns:
- SecureRandom
- Throws:
- Exception- thrown if SecureRandom instance cannot be created/accessed
 
 - 
initializeRandomprotected static void initializeRandom(String algo, String provider) throws Exception - Throws:
- Exception
 
 
- 
 
-