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 the database using the order in which these are defined. Thus the order of stop reasons MUST NOT BE CHANGED!


Enum Constant Summary
CONFIG_OBJECT_LIMIT
          Stop reason is configuration object limit reached, when the domain reached the maximum number of objects allowed by the configuration.
CONFIG_SIZE_LIMIT
          Stop reason is configuration size limit reached, when the domain reached the maximum number of bytes allowed by the configuration.
DOWNLOAD_COMPLETE
          Stop reason is download complete, when all pages within the scope of the harvest template have been downloaded.
DOWNLOAD_UNFINISHED
          Stop reason is download unfinished, when we don't know whether or not the harvesting is completed, because the crawler did not finish in an orderly way.
OBJECT_LIMIT
          Stop reason is object limit reached, when the domain reached the maximum number of objects allowed by the harvest.
SIZE_LIMIT
          Stop reason is size limit reached, when the domain reached the maximum number of bytes allowed by the 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 are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DOWNLOAD_COMPLETE

public static final StopReason DOWNLOAD_COMPLETE
Stop reason is download complete, when all pages within the scope of the harvest template have been downloaded.


OBJECT_LIMIT

public static final StopReason OBJECT_LIMIT
Stop reason is object limit reached, when the domain reached the maximum number of objects allowed by the harvest.


SIZE_LIMIT

public static final StopReason SIZE_LIMIT
Stop reason is size limit reached, when the domain reached the maximum number of bytes allowed by the harvest.


CONFIG_SIZE_LIMIT

public static final StopReason CONFIG_SIZE_LIMIT
Stop reason is configuration size limit reached, when the domain reached the maximum number of bytes allowed by the configuration.


DOWNLOAD_UNFINISHED

public static final StopReason DOWNLOAD_UNFINISHED
Stop reason is download unfinished, when we don't know whether or not the harvesting is completed, because the crawler did not finish in an orderly way.


CONFIG_OBJECT_LIMIT

public static final StopReason CONFIG_OBJECT_LIMIT
Stop reason is configuration object limit reached, when the domain reached the maximum number of objects allowed by the configuration.

Method Detail

values

public static StopReason[] values()
Returns an array containing the constants of this enum type, in the order they are 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 are 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
java.lang.NullPointerException - if the argument is null

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
See Also:
Enum.ordinal()

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.