Package org.dspace.orcid.service.impl
Class PlainMetadataSignatureGeneratorImpl
java.lang.Object
org.dspace.orcid.service.impl.PlainMetadataSignatureGeneratorImpl
- All Implemented Interfaces:
MetadataSignatureGenerator
public class PlainMetadataSignatureGeneratorImpl
extends Object
implements MetadataSignatureGenerator
Implementation of
Each section is composed of the metadata field, the metadata value and, if present, the authority, divided by the character METADATA_SECTIONS_SEPARATOR.
The presence of the metadata field allows to have different signatures for metadata with the same values but referring to different fields, while the authority allows to distinguish metadata that refer to different entities, even if they have the same value. Finally, the various sections of the signature are sorted by metadata field so that the order of the input metadata values does not affect the signature.
MetadataSignatureGenerator that composes a
signature made up of a section for each metadata value, divided by the
character SIGNATURE_SECTIONS_SEPARATOR. Each section is composed of the metadata field, the metadata value and, if present, the authority, divided by the character METADATA_SECTIONS_SEPARATOR.
The presence of the metadata field allows to have different signatures for metadata with the same values but referring to different fields, while the authority allows to distinguish metadata that refer to different entities, even if they have the same value. Finally, the various sections of the signature are sorted by metadata field so that the order of the input metadata values does not affect the signature.
- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindBySignature(Context context, Item item, String signature) Returns the metadata values traceable by the given item related with the given signature.generate(Context context, List<MetadataValue> metadataValues) Generate a signature related to the given metadata values.
-
Constructor Details
-
PlainMetadataSignatureGeneratorImpl
public PlainMetadataSignatureGeneratorImpl()
-
-
Method Details
-
generate
Description copied from interface:MetadataSignatureGeneratorGenerate a signature related to the given metadata values.- Specified by:
generatein interfaceMetadataSignatureGenerator- Parameters:
context- the DSpace contextmetadataValues- the metadata values to sign- Returns:
- the generated signature
-
findBySignature
Description copied from interface:MetadataSignatureGeneratorReturns the metadata values traceable by the given item related with the given signature.- Specified by:
findBySignaturein interfaceMetadataSignatureGenerator- Parameters:
context- the DSpace contextitem- the itemsignature- the metadata signature- Returns:
- the founded metadata
-