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 ofMetadataSignatureGeneratorthat 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 Constructor Description PlainMetadataSignatureGeneratorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<MetadataValue>findBySignature(Context context, Item item, String signature)Returns the metadata values traceable by the given item related with the given signature.Stringgenerate(Context context, List<MetadataValue> metadataValues)Generate a signature related to the given metadata values.
-
-
-
Method Detail
-
generate
public String generate(Context context, List<MetadataValue> metadataValues)
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
public List<MetadataValue> findBySignature(Context context, Item item, String signature)
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
-
-