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.datamodel
Class CrawlHost

    java.lang.Object
      org.archive.crawler.datamodel.CrawlHost

All Implemented Interfaces:
  java.io.Serializable, CrawlSubstats.HasCrawlSubstats

    public class CrawlHost

extends java.lang.Object
implements java.io.Serializable, CrawlSubstats.HasCrawlSubstats

Represents a single remote "host". An host is a name for which there is a dns record or an IP-address. This might be a machine or a virtual host.

Author:
  gojomo
See Also:
  Serialized Form

Field Summary
`static long` | `IP_NEVER_EXPIRES` Flag value indicating always-valid IP
`static long` | `IP_NEVER_LOOKED_UP` Flag value indicating an IP has not yet been looked up
`protected CrawlSubstats` | `substats`

Constructor Summary
`CrawlHost(java.lang.String hostname)` Create a new CrawlHost object.
`CrawlHost(java.lang.String hostname, java.lang.String countryCode)` Create a new CrawlHost object.

Method Summary
`java.lang.String` | `getCountryCode()` Get country code of this host
`long` | `getEarliestNextURIEmitTime()` Get the earliest time a URI for this host could be emitted.
`java.lang.String` | `getHostName()` Get the host name.
`java.net.InetAddress` | `getIP()` Get the IP address for this host.
`long` | `getIpFetched()` Get the time when the IP address for this host was last looked up.
`long` | `getIpTTL()` Get the TTL value from the dns record for this host.
`CrawlSubstats` | `getSubstats()`
`boolean` | `hasBeenLookedUp()` Return true if the IP for this host has been looked up.
`void` | `setCountryCode(java.lang.String countryCode)` Set country code for this hos
`void` | `setEarliestNextURIEmitTime(long earliestNextURIEmitTime)` Set the earliest time a URI for this host could be emitted.
`void` | `setIP(java.net.InetAddress address, long ttl)` Set the IP address for this host.
`java.lang.String` | `toString()`

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

Field Detail

### IP_NEVER_EXPIRES

    public static final long IP_NEVER_EXPIRES

  Flag value indicating always-valid IP

  See Also:
    Constant Field Values

### IP_NEVER_LOOKED_UP

    public static final long IP_NEVER_LOOKED_UP

  Flag value indicating an IP has not yet been looked up

  See Also:
    Constant Field Values

### substats

    protected CrawlSubstats substats

Constructor Detail

### CrawlHost

    public CrawlHost(java.lang.String hostname)

  Create a new CrawlHost object.

  Parameters:
    `hostname` - the host name for this host.

### CrawlHost

    public CrawlHost(java.lang.String hostname,
                     java.lang.String countryCode)

  Create a new CrawlHost object.

  Parameters:
    `hostname` - the host name for this host.
    `countryCode` - the country code for this host.

Method Detail

### hasBeenLookedUp

    public boolean hasBeenLookedUp()

  Return true if the IP for this host has been looked up. Returns true even if the lookup failed.

  Returns:
    true if the IP for this host has been looked up.

### setIP

    public void setIP(java.net.InetAddress address,
                      long ttl)

  Set the IP address for this host.

  Parameters:
    `address` -
    `ttl` - the TTL from the dns record in seconds or -1 if it should live forever (is a numeric IP).

### getIP

    public java.net.InetAddress getIP()

  Get the IP address for this host.

  Returns:
    the IP address for this host.

### getIpFetched

    public long getIpFetched()

  Get the time when the IP address for this host was last looked up.

  Returns:
    the time when the IP address for this host was last looked up.

### getIpTTL

    public long getIpTTL()

  Get the TTL value from the dns record for this host.

  Returns:
    the TTL value from the dns record for this host -- in seconds -- or -1 if this lookup should be valid forever (numeric ip).

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getHostName

    public java.lang.String getHostName()

  Get the host name.

  Returns:
    Returns the host name.

### getEarliestNextURIEmitTime

    public long getEarliestNextURIEmitTime()

  Get the earliest time a URI for this host could be emitted. This only has effect if constraints on bandwidth per host is set.

  Returns:
    Returns the earliestNextURIEmitTime.

### setEarliestNextURIEmitTime

    public void setEarliestNextURIEmitTime(long earliestNextURIEmitTime)

  Set the earliest time a URI for this host could be emitted. This only has effect if constraints on bandwidth per host is set.

  Parameters:
    `earliestNextURIEmitTime` - The earliestNextURIEmitTime to set.

### getCountryCode

    public java.lang.String getCountryCode()

  Get country code of this host

  Returns:
    Retruns country code or null if not availabe

### setCountryCode

    public void setCountryCode(java.lang.String countryCode)

  Set country code for this hos

  Parameters:
    `countryCode` - The country code of this host

### getSubstats

    public CrawlSubstats getSubstats()

  Specified by:
    `getSubstats` in interface `CrawlSubstats.HasCrawlSubstats`

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.