Class SedaUtils
- java.lang.Object
-
- fr.gouv.vitam.worker.common.utils.SedaUtils
-
public class SedaUtils extends java.lang.Object
SedaUtils to read or split element from SEDA
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SedaUtils.CheckSedaValidationStatus
Check Seda Validation status values
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INVALID_DATAOBJECT_VERSION
static java.lang.String
NAMESPACE_URI
static java.lang.String
NB_AU_EXISTING
nbAUExisting: number of the AU already existingstatic java.lang.String
SEDA_VITAM_XSD_FILE
static java.lang.String
SEDA_XSD_VERSION
static java.lang.String
VALID_DATAOBJECT_VERSION
static java.lang.String
XSI_URI
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SedaUtils.CheckSedaValidationStatus
checkSedaValidation(WorkerParameters params, ItemStatus itemStatus)
The method is used to validate SEDA by XSDjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>
checkSupportedDataObjectVersion(WorkerParameters params)
check if the version list of the manifest.xml in workspace is validjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>
compareVersionList(javax.xml.stream.XMLEventReader eventReader)
compare if the version list of manifest.xml is included in or equal to the version list of version.conflong
computeTotalSizeOfObjectsInManifest(WorkerParameters params)
Compute the total size of objects listed in the manifest.xml fileExtractUriResponse
getAllDigitalObjectUriFromManifest()
java.util.Map<java.lang.String,java.lang.String>
getBinaryDataObjectIdToGroupId()
java.util.Map<java.lang.String,java.lang.String>
getBinaryDataObjectIdToGuid()
SedaUtilInfo
getDataObjectInfo(javax.xml.stream.XMLEventReader evenReader)
java.util.Map<java.lang.String,java.lang.String>
getMandatoryValues(WorkerParameters params)
get Message Identifier from sedajava.util.Map<java.lang.String,java.util.List<java.lang.String>>
getObjectGroupIdToBinaryDataObjectId()
java.util.Map<java.lang.String,java.lang.String>
getObjectGroupIdToGuid()
java.util.Map<java.lang.String,java.lang.String>
getUnitIdToGroupId()
java.util.Map<java.lang.String,java.lang.String>
getUnitIdToGuid()
java.util.Map<java.lang.String,java.util.List<DataObjectInfo>>
manifestVersionList(javax.xml.stream.XMLEventReader evenReader)
-
-
-
Field Detail
-
NAMESPACE_URI
public static final java.lang.String NAMESPACE_URI
- See Also:
- Constant Field Values
-
XSI_URI
public static final java.lang.String XSI_URI
- See Also:
- Constant Field Values
-
SEDA_VITAM_XSD_FILE
public static final java.lang.String SEDA_VITAM_XSD_FILE
- See Also:
- Constant Field Values
-
SEDA_XSD_VERSION
public static final java.lang.String SEDA_XSD_VERSION
- See Also:
- Constant Field Values
-
NB_AU_EXISTING
public static final java.lang.String NB_AU_EXISTING
nbAUExisting: number of the AU already existing- See Also:
- Constant Field Values
-
INVALID_DATAOBJECT_VERSION
public static final java.lang.String INVALID_DATAOBJECT_VERSION
- See Also:
- Constant Field Values
-
VALID_DATAOBJECT_VERSION
public static final java.lang.String VALID_DATAOBJECT_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SedaUtils
protected SedaUtils(HandlerIO handlerIO)
-
-
Method Detail
-
getBinaryDataObjectIdToGuid
public java.util.Map<java.lang.String,java.lang.String> getBinaryDataObjectIdToGuid()
- Returns:
- A map reflects BinaryDataObject and File(GUID)
-
getObjectGroupIdToBinaryDataObjectId
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getObjectGroupIdToBinaryDataObjectId()
- Returns:
- A map reflects relation ObjectGroupId and BinaryDataObjectId
-
getObjectGroupIdToGuid
public java.util.Map<java.lang.String,java.lang.String> getObjectGroupIdToGuid()
- Returns:
- A map reflects ObjectGroup and File(GUID)
-
getUnitIdToGuid
public java.util.Map<java.lang.String,java.lang.String> getUnitIdToGuid()
- Returns:
- A map reflects Unit and File(GUID)
-
getBinaryDataObjectIdToGroupId
public java.util.Map<java.lang.String,java.lang.String> getBinaryDataObjectIdToGroupId()
- Returns:
- A map reflects BinaryDataObject and ObjectGroup
-
getUnitIdToGroupId
public java.util.Map<java.lang.String,java.lang.String> getUnitIdToGroupId()
- Returns:
- A map reflects Unit and ObjectGroup
-
getMandatoryValues
public java.util.Map<java.lang.String,java.lang.String> getMandatoryValues(WorkerParameters params) throws ProcessingException
get Message Identifier from seda- Parameters:
params
- parameters of workspace server- Returns:
- message id
- Throws:
ProcessingException
- throw when can't read or extract message id from SEDA
-
checkSedaValidation
public SedaUtils.CheckSedaValidationStatus checkSedaValidation(WorkerParameters params, ItemStatus itemStatus)
The method is used to validate SEDA by XSD- Parameters:
params
- worker parameter- Returns:
- a status representing the validation of the file
-
getAllDigitalObjectUriFromManifest
public ExtractUriResponse getAllDigitalObjectUriFromManifest() throws ProcessingException
- Returns:
- ExtractUriResponse - Object ExtractUriResponse contains listURI, listMessages and value boolean(error).
- Throws:
ProcessingException
- - throw when error in execution.
-
checkSupportedDataObjectVersion
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> checkSupportedDataObjectVersion(WorkerParameters params) throws ProcessingException
check if the version list of the manifest.xml in workspace is valid- Parameters:
params
- worker parameter- Returns:
- map containing unsupported version
- Throws:
ProcessingException
- throws when error occurs
-
getDataObjectInfo
public SedaUtilInfo getDataObjectInfo(javax.xml.stream.XMLEventReader evenReader) throws ProcessingException
- Parameters:
evenReader
- of seda- Returns:
- Seda Info object
- Throws:
ProcessingException
- if cannot get BinaryObject info
-
manifestVersionList
public java.util.Map<java.lang.String,java.util.List<DataObjectInfo>> manifestVersionList(javax.xml.stream.XMLEventReader evenReader) throws ProcessingException
- Parameters:
evenReader
- XMLEventReader for the file manifest.xml- Returns:
- List of version for file manifest.xml
- Throws:
ProcessingException
- when error in execution
-
compareVersionList
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> compareVersionList(javax.xml.stream.XMLEventReader eventReader) throws ProcessingException
compare if the version list of manifest.xml is included in or equal to the version list of version.conf- Parameters:
eventReader
- xml event reader- Returns:
- map containing the error code and the unsupported version
- Throws:
ProcessingException
- when error in execution
-
computeTotalSizeOfObjectsInManifest
public long computeTotalSizeOfObjectsInManifest(WorkerParameters params) throws ProcessingException
Compute the total size of objects listed in the manifest.xml file- Parameters:
params
- worker parameters- Returns:
- the computed size of all BinaryObjects
- Throws:
ProcessingException
- when error in getting binary object info
-
-