org.archive.crawler.deciderules
Class ExternalGeoLocationDecideRule
java.lang.Object
javax.management.Attribute
org.archive.crawler.settings.Type
org.archive.crawler.settings.ComplexType
org.archive.crawler.settings.ModuleType
org.archive.crawler.deciderules.DecideRule
org.archive.crawler.deciderules.ConfiguredDecideRule
org.archive.crawler.deciderules.PredicatedDecideRule
org.archive.crawler.deciderules.ExternalGeoLocationDecideRule
- All Implemented Interfaces:
- java.io.Serializable, javax.management.DynamicMBean
public class ExternalGeoLocationDecideRule
- extends PredicatedDecideRule
A rule that can be configured to take alternate implementations
of the ExternalGeoLocationInterface.
If no implementation specified, or none found, returns configured decision.
If host in URI has been resolved checks CrawlHost for the country code
determination.
If country code is not present, does country lookup, and saves the country
code to CrawlHost
for future consultation.
If country code is present in CrawlHost
, compares it against
the configured code.
Note that if a host's IP address changes during the crawl, we still consider
the associated hostname to be in the country of its original IP address.
- Author:
- Igor Ranitovic
- See Also:
- Serialized Form
Methods inherited from class org.archive.crawler.settings.ComplexType |
addElementToDefinition, checkValue, earlyInitialize, getAbsoluteName, getAttribute, getAttribute, getAttribute, getAttributeInfo, getAttributeInfo, getAttributeInfoIterator, getAttributes, getDataContainerRecursive, getDataContainerRecursive, getDefaultValue, getDescription, getElementFromDefinition, getLegalValues, getLocalAttribute, getMBeanInfo, getMBeanInfo, getParent, getPreservedFields, getSettingsHandler, getUncheckedAttribute, getValue, globalSettings, invoke, isInitialized, isOverridden, iterator, removeElementFromDefinition, setAsOrder, setAttribute, setAttribute, setAttributes, setDescription, setPreservedFields, toString, unsetAttribute |
Methods inherited from class org.archive.crawler.settings.Type |
addConstraint, equals, getConstraints, getLegalValueType, isExpertSetting, isOverrideable, isTransient, setExpertSetting, setLegalValueType, setOverrideable, setTransient |
Methods inherited from class javax.management.Attribute |
getName, hashCode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ATTR_IMPLEMENTATION
static final java.lang.String ATTR_IMPLEMENTATION
- See Also:
- Constant Field Values
ATTR_COUNTRY_CODE
static final java.lang.String ATTR_COUNTRY_CODE
- See Also:
- Constant Field Values
DEFAULT_COUNTRY_CODE
static final java.lang.String DEFAULT_COUNTRY_CODE
- See Also:
- Constant Field Values
ExternalGeoLocationDecideRule
public ExternalGeoLocationDecideRule(java.lang.String name)
- Parameters:
name
- Name of this rule.
evaluate
protected boolean evaluate(java.lang.Object obj)
- Specified by:
evaluate
in class PredicatedDecideRule
getConfiguredImplementation
protected ExternalGeoLookupInterface getConfiguredImplementation(java.lang.Object o)
- Get implementation, if one specified. If none specified, will keep trying
to find one. Will be messy if the provided class is not-instantiable
- Parameters:
o
- A context object.
- Returns:
- Instance of
ExternalGeoLookupInterface
or null.
Copyright © 2003-2011 Internet Archive. All Rights Reserved.