public class MetadataEntry extends Object implements Serializable
Constructor and Description |
---|
MetadataEntry(String url,
String mimeType,
String data)
Constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData() |
static List<MetadataEntry> |
getMetadataFromDisk(File sourceDir)
Retrieve a list of serialized metadata entries on disk.
|
String |
getMimeType() |
String |
getURL() |
boolean |
isDuplicateReductionMetadataEntry()
Checks, if this is a duplicate reduction MetadataEntry.
|
static MetadataEntry |
makeAliasMetadataEntry(List<AliasInfo> aliases,
Long origHarvestDefinitionID,
int harvestNum,
Long jobId)
Generate a MetadataEntry from a list of AliasInfo objects (VERSION 2) Expired aliases is skipped by this method.
|
static MetadataEntry |
makeDuplicateReductionMetadataEntry(List<Long> jobIDsForDuplicateReduction,
Long origHarvestDefinitionID,
int harvestNum,
Long jobId)
Generate a MetadataEntry from a list of job ids for duplicate reduction.
|
static void |
storeMetadataToDisk(List<MetadataEntry> metadata,
File destinationDir)
Store a list of metadata entries to disk.
|
String |
toString() |
public MetadataEntry(String url, String mimeType, String data)
url
- the URL assigned to this metadata (needed for it to be searchable)mimeType
- the mimeType for this metadata (normally text/plain or text/xml)data
- the metadata itselfArgumentNotValid
- if arguments are null or empty strings, or if argument url is not valid URL or if
argument mimeType is not valid MimeTypepublic static MetadataEntry makeAliasMetadataEntry(List<AliasInfo> aliases, Long origHarvestDefinitionID, int harvestNum, Long jobId)
aliases
- the list of aliases (possibly empty)origHarvestDefinitionID
- The harvestdefinition that is behind the job with the given jobIdharvestNum
- The number of the harvest that the job with the given jobid belongs tojobId
- The id of the Job, which this metadata belongs topublic static MetadataEntry makeDuplicateReductionMetadataEntry(List<Long> jobIDsForDuplicateReduction, Long origHarvestDefinitionID, int harvestNum, Long jobId)
jobIDsForDuplicateReduction
- the list of jobids (possibly empty)origHarvestDefinitionID
- The harvestdefinition that is behind the job with the given jobIdharvestNum
- The number of the harvest that the job with the given jobid belongs tojobId
- The id of the Job, which this metadata belongs topublic byte[] getData()
public String getMimeType()
public boolean isDuplicateReductionMetadataEntry()
public static void storeMetadataToDisk(List<MetadataEntry> metadata, File destinationDir)
metadata
- the given metadatadestinationDir
- the directory to store the metadata.public static List<MetadataEntry> getMetadataFromDisk(File sourceDir)
sourceDir
- the directory where the metadata is stored.Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.