|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.harvester.harvesting.metadata.MetadataEntry
public class MetadataEntry
Class used to carry metadata in DoOneCrawl messages, including the URL and mimetype necessary to write the metadata to metadata (W)ARC files.
Constructor Summary | |
---|---|
MetadataEntry(java.lang.String url,
java.lang.String mimeType,
java.lang.String data)
Constructor for this class. |
Method Summary | |
---|---|
byte[] |
getData()
|
static java.util.List<MetadataEntry> |
getMetadataFromDisk(java.io.File sourceDir)
Retrieve a list of serialized metadata entries on disk. |
java.lang.String |
getMimeType()
|
java.lang.String |
getURL()
|
boolean |
isDuplicateReductionMetadataEntry()
Checks, if this is a duplicate reduction MetadataEntry. |
static MetadataEntry |
makeAliasMetadataEntry(java.util.List<AliasInfo> aliases,
java.lang.Long origHarvestDefinitionID,
int harvestNum,
java.lang.Long jobId)
Generate a MetadataEntry from a list of AliasInfo objects (VERSION 2) Expired aliases is skipped by this method. |
static MetadataEntry |
makeDuplicateReductionMetadataEntry(java.util.List<java.lang.Long> jobIDsForDuplicateReduction,
java.lang.Long origHarvestDefinitionID,
int harvestNum,
java.lang.Long jobId)
Generate a MetadataEntry from a list of job ids for duplicate reduction. |
static void |
storeMetadataToDisk(java.util.List<MetadataEntry> metadata,
java.io.File destinationDir)
Store a list of metadata entries to disk. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MetadataEntry(java.lang.String url, java.lang.String mimeType, java.lang.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 itself
ArgumentNotValid
- if arguments are null or empty strings,
or if argument url is not valid URL
or if argument mimeType is not valid MimeTypeMethod Detail |
---|
public static MetadataEntry makeAliasMetadataEntry(java.util.List<AliasInfo> aliases, java.lang.Long origHarvestDefinitionID, int harvestNum, java.lang.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 to
public static MetadataEntry makeDuplicateReductionMetadataEntry(java.util.List<java.lang.Long> jobIDsForDuplicateReduction, java.lang.Long origHarvestDefinitionID, int harvestNum, java.lang.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 to
public byte[] getData()
public java.lang.String getMimeType()
public java.lang.String getURL()
public boolean isDuplicateReductionMetadataEntry()
public java.lang.String toString()
toString
in class java.lang.Object
public static void storeMetadataToDisk(java.util.List<MetadataEntry> metadata, java.io.File destinationDir)
metadata
- the given metadatadestinationDir
- the directory to store the metadata.public static java.util.List<MetadataEntry> getMetadataFromDisk(java.io.File sourceDir)
sourceDir
- the directory where the metadata is stored.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |