Package fr.gouv.vitam.common.guid
Class GUIDFactory
- java.lang.Object
-
- fr.gouv.vitam.common.guid.GUIDFactory
-
public final class GUIDFactory extends java.lang.Object
GUID Factory
Usage:
One should use the appropriate helper according to the type of the object for the GUID.
For instance: for a Unit newUnitGUID(tenantId);
No one should not in general use directly newGUID helpers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getKeysize()
static int
getKeysizeBase32()
static boolean
isWorm(GUID uuid)
static GUID
newAccessionRegisterDetailGUID(int tenantId)
Create an accession register detail GUIDstatic GUID
newAccessionRegisterSummaryGUID(int tenantId)
Create a Accession register summary GUIDstatic GUID
newAccessionRegisterSymbolicGUID(int tenantId)
Create a Accession register summary GUIDstatic GUID
newAgencyGUID(int tenantId)
Create a Agencies GUIDstatic GUID
newContextGUID()
Create a Context GUIDstatic GUID
newContractGUID(int tenantId)
Create a contract GUIDstatic GUID
newEventGUID(int tenantId)
Create a Operation Id GUIDstatic GUID
newEventGUID(GUID logbookGUID)
Create an Event GUID (within Operation or Lifecycle Logbooks)static GUID
newGUID()
Usable for internal GUID with default tenantId (0) and objectType (0)static GUID
newManifestGUID(int tenantId)
Create a Manifest GUID (SEDA)static GUID
newObjectGroupGUID(int tenantId)
Create a ObjectGroup GUIDstatic GUID
newObjectGroupGUID(GUID unitParentGUID)
Create a ObjectGroup GUIDstatic GUID
newObjectGUID(int tenantId)
Create a Object GUIDstatic GUID
newObjectGUID(GUID objectGroupParentGUID)
Create a Object GUIDstatic GUID
newOntologyGUID(int tenantId)
Create an ontology GUIDstatic GUID
newOperationLogbookGUID(int tenantId)
Create a Operation Logbook GUIDstatic GUID
newProfileGUID(int tenantId)
Create a Profile GUIDstatic GUID
newRequestIdGUID(int tenantId)
Create a Request Id GUID (X-CID)static GUID
newStorageOperationGUID(int tenantId, boolean worm)
Create a Storage Operation GUIDstatic GUID
newUnitGUID(int tenantId)
Create a Unit GUIDstatic GUID
newWriteLogbookGUID(int tenantId)
Create a Write Logbook GUID
-
-
-
Method Detail
-
newGUID
public static final GUID newGUID()
Usable for internal GUID with default tenantId (0) and objectType (0)- Returns:
- a new GUID
-
newUnitGUID
public static final GUID newUnitGUID(int tenantId)
Create a Unit GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newObjectGroupGUID
public static final GUID newObjectGroupGUID(int tenantId)
Create a ObjectGroup GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newObjectGroupGUID
public static final GUID newObjectGroupGUID(GUID unitParentGUID)
Create a ObjectGroup GUID- Parameters:
unitParentGUID
- GUID of parent Unit- Returns:
- a new GUID
-
newObjectGUID
public static final GUID newObjectGUID(int tenantId)
Create a Object GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newObjectGUID
public static final GUID newObjectGUID(GUID objectGroupParentGUID)
Create a Object GUID- Parameters:
objectGroupParentGUID
- GUID of parent ObjectGroup- Returns:
- a new GUID
-
newOperationLogbookGUID
public static final GUID newOperationLogbookGUID(int tenantId)
Create a Operation Logbook GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newWriteLogbookGUID
public static final GUID newWriteLogbookGUID(int tenantId)
Create a Write Logbook GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newStorageOperationGUID
public static final GUID newStorageOperationGUID(int tenantId, boolean worm)
Create a Storage Operation GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1worm
-- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newEventGUID
public static final GUID newEventGUID(int tenantId)
Create a Operation Id GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newEventGUID
public static final GUID newEventGUID(GUID logbookGUID)
Create an Event GUID (within Operation or Lifecycle Logbooks)- Parameters:
logbookGUID
- GUID of corresponding Logbook- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newRequestIdGUID
public static final GUID newRequestIdGUID(int tenantId)
Create a Request Id GUID (X-CID)- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newManifestGUID
public static final GUID newManifestGUID(int tenantId)
Create a Manifest GUID (SEDA)- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newAccessionRegisterSummaryGUID
public static final GUID newAccessionRegisterSummaryGUID(int tenantId)
Create a Accession register summary GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newAccessionRegisterSymbolicGUID
public static final GUID newAccessionRegisterSymbolicGUID(int tenantId)
Create a Accession register summary GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newContractGUID
public static final GUID newContractGUID(int tenantId)
Create a contract GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newProfileGUID
public static final GUID newProfileGUID(int tenantId)
Create a Profile GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newOntologyGUID
public static final GUID newOntologyGUID(int tenantId)
Create an ontology GUID- Parameters:
tenantId
- tenant id between 0 and 2^30-1- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newContextGUID
public static final GUID newContextGUID()
Create a Context GUID- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newAgencyGUID
public static final GUID newAgencyGUID(int tenantId)
Create a Agencies GUID- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
newAccessionRegisterDetailGUID
public static final GUID newAccessionRegisterDetailGUID(int tenantId)
Create an accession register detail GUID- Returns:
- a new GUID
- Throws:
java.lang.IllegalArgumentException
- if any of the argument are out of range
-
isWorm
public static final boolean isWorm(GUID uuid)
- Parameters:
uuid
-- Returns:
- True if the given GUID is using a WORM media
-
getKeysize
public static final int getKeysize()
- Returns:
- the size of the key in bytes
-
getKeysizeBase32
public static final int getKeysizeBase32()
- Returns:
- the size of the key using Base32 format in bytes
-
-