Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Nested Class Summary

Nested classes/interfaces inherited from class org.archive.crawler.settings.ComplexType
`ComplexType.MBeanAttributeInfoIterator`

Field Summary
`(package private) static java.lang.String` | `ATTR_COUNTRY_CODE`
`(package private) static java.lang.String` | `ATTR_IMPLEMENTATION`
`(package private) static java.lang.String` | `DEFAULT_COUNTRY_CODE`

Fields inherited from class org.archive.crawler.deciderules.ConfiguredDecideRule
`ALLOWED_TYPES, ATTR_DECISION`

Fields inherited from class org.archive.crawler.deciderules.DecideRule
`ACCEPT, PASS, REJECT`

Fields inherited from class org.archive.crawler.settings.ComplexType
`definition, definitionMap`

Constructor Summary
`ExternalGeoLocationDecideRule(java.lang.String name)`

Method Summary
`protected boolean` | `evaluate(java.lang.Object obj)`
`protected ExternalGeoLookupInterface` | `getConfiguredImplementation(java.lang.Object o)` Get implementation, if one specified.

Methods inherited from class org.archive.crawler.deciderules.PredicatedDecideRule
`decisionFor`

Methods inherited from class org.archive.crawler.deciderules.ConfiguredDecideRule
`singlePossibleNonPassDecision`

Methods inherited from class org.archive.crawler.deciderules.DecideRule
`getController, kickUpdate`

Methods inherited from class org.archive.crawler.settings.ModuleType
`addElement, listUsedFiles`

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`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### 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

Constructor Detail

### ExternalGeoLocationDecideRule

    public ExternalGeoLocationDecideRule(java.lang.String name)

Parameters:
  `name` - Name of this rule.

Method Detail

### 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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Internet Archive. All Rights Reserved.