Class LastModifiedMetadataChecksummer
- All Implemented Interfaces:
IMetadataChecksummer,IXMLConfigurable
Default implementation of IMetadataChecksummer for the
Norconex HTTP Collector which simply
returns the exact value of the "Last-Modified" HTTP header field, or
null if not present.
You have the option to keep the checksum as a document metadata field.
When AbstractMetadataChecksummer.setKeep(boolean) is true, the checksum will be
stored in the target field name specified. If you do not specify any,
it stores it under the metadata field name
CrawlDocMetadata.CHECKSUM_METADATA.
To use different fields (one or several) to constitute a checksum,
you can instead use the GenericMetadataChecksummer.
XML configuration usage:
<metadataChecksummer
class="com.norconex.collector.http.checksum.impl.LastModifiedMetadataChecksummer"
keep="[false|true]"
toField="(field to store checksum)"/>
XML usage example:
<metadataChecksummer
keep="true"
toField="metaChecksum"/>
The above example will store the last modified date used for checksum purposes in a field called "metaChecksum".
Since 2.0.0, a self-closing
<metadataChecksummer/> tag without any attributes
is used to disable checksum generation.
- Since:
- 2.2.0
- Author:
- Pascal Essiembre
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdoCreateMetaChecksum(Properties metadata) booleaninthashCode()booleanDeprecated.protected voidprotected voidsaveChecksummerToXML(XML xml) voidsetDisabled(boolean disabled) Deprecated.Since 2.0.0, not having a checksummer defined or setting one explicitly tonulleffectively disable it.toString()Methods inherited from class com.norconex.collector.core.checksum.AbstractMetadataChecksummer
createMetadataChecksum, getOnSet, getTargetField, getToField, isKeep, loadFromXML, saveToXML, setKeep, setOnSet, setTargetField, setToField
-
Constructor Details
-
LastModifiedMetadataChecksummer
public LastModifiedMetadataChecksummer()
-
-
Method Details
-
doCreateMetaChecksum
- Specified by:
doCreateMetaChecksumin classAbstractMetadataChecksummer
-
isDisabled
Deprecated.Since 2.0.0, not having a checksummer defined or setting one explicitly tonulleffectively disables it.Deprecated.- Returns:
- always
false
-
setDisabled
Deprecated.Since 2.0.0, not having a checksummer defined or setting one explicitly tonulleffectively disable it.Deprecated. Invoking this method has no effect- Parameters:
disabled- argument is ignored
-
loadChecksummerFromXML
- Specified by:
loadChecksummerFromXMLin classAbstractMetadataChecksummer
-
saveChecksummerToXML
- Specified by:
saveChecksummerToXMLin classAbstractMetadataChecksummer
-
equals
- Overrides:
equalsin classAbstractMetadataChecksummer
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractMetadataChecksummer
-
toString
- Overrides:
toStringin classAbstractMetadataChecksummer
-
nulleffectively disables it.