dk.netarkivet.harvester.datamodel
Enum StopReason

java.lang.Object
  extended by java.lang.Enum<StopReason>
      extended by dk.netarkivet.harvester.datamodel.StopReason
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<StopReason>

public enum StopReason
extends java.lang.Enum<StopReason>

Class for containing a reason for stopping the harvesting of a domain. There are five possible reasons: 1) We have now harvested the whole domain (DOWNLOAD_COMPLETE) 2) We have now harvested the number of objects allowed from this domain in this iteration (OBJECT_LIMIT) 3) We have now harvested the the number of bytes allowed from this domain in this iteration (SIZE_LIMIT) 4) We stopped harvesting because we hit the per-configuration limit (CONFIG_SIZE_LIMIT) 5) We don't know whether or not the harvesting is completed, because the crawler did not finish in an orderly way (DOWNLOAD_UNFINISHED) Note: This enum is serialized to database using the order in which these are defined. Thus the order of stop reasons MUST NOT BE CHANGED!


Enum Constant Summary
CONFIG_SIZE_LIMIT
          We stopped harvesting because we hit the per-configuration limit.
DOWNLOAD_COMPLETE
          We have now harvested the whole domain.
DOWNLOAD_UNFINISHED
          We don't know whether or not the harvesting is completed, because the crawler did not finish in an orderly way.
OBJECT_LIMIT
          We have now harvested the number of objects allowed from this domain in this harvest.
SIZE_LIMIT
          We have now harvested the the number of bytes allowed from this domain in this harvest.
 
Method Summary
 java.lang.String getLocalizedString(java.util.Locale l)
          Return a localized string describing a stopreason.
(package private) static StopReason getStopReason(int stopreasonNum)
          Get the StopReason corresponding to the given positive integer.
static StopReason valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static StopReason[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DOWNLOAD_COMPLETE

public static final StopReason DOWNLOAD_COMPLETE
We have now harvested the whole domain.


OBJECT_LIMIT

public static final StopReason OBJECT_LIMIT
We have now harvested the number of objects allowed from this domain in this harvest.


SIZE_LIMIT

public static final StopReason SIZE_LIMIT
We have now harvested the the number of bytes allowed from this domain in this harvest.


CONFIG_SIZE_LIMIT

public static final StopReason CONFIG_SIZE_LIMIT
We stopped harvesting because we hit the per-configuration limit.


DOWNLOAD_UNFINISHED

public static final StopReason DOWNLOAD_UNFINISHED
We don't know whether or not the harvesting is completed, because the crawler did not finish in an orderly way.

Method Detail

values

public static final StopReason[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(StopReason c : StopReason.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static StopReason valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getStopReason

static StopReason getStopReason(int stopreasonNum)
Get the StopReason corresponding to the given positive integer.

Parameters:
stopreasonNum - a given positive integer
Returns:
the StopReason corresponding to the given positive integer

getLocalizedString

public java.lang.String getLocalizedString(java.util.Locale l)
Return a localized string describing a stopreason.

Parameters:
l - the locale
Returns:
a localized string describing a stopreason.