org.apache.nutch.parse

## Class ParseStatus

- java.lang.Object
- - org.apache.nutch.parse.ParseStatus

- All Implemented Interfaces:
    Writable

      public class ParseStatus
      extends java.lang.Object
      implements Writable

  Author:
    Andrzej Bialecki <ab@getopt.org>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte` | `FAILED` General failure.
    `static short` | `FAILED_EXCEPTION` Parsing failed.
    `static short` | `FAILED_INVALID_FORMAT` Parsing failed.
    `static short` | `FAILED_MISSING_CONTENT` Parsing failed.
    `static short` | `FAILED_MISSING_PARTS` Parsing failed.
    `static short` | `FAILED_TRUNCATED` Parsing failed.
    `static java.lang.String[]` | `majorCodes`
    `static byte` | `NOTPARSED` Parsing was not performed.
    `static ParseStatus` | `STATUS_FAILURE`
    `static ParseStatus` | `STATUS_NOTPARSED`
    `static ParseStatus` | `STATUS_SUCCESS`
    `static byte` | `SUCCESS` Parsing succeeded.
    `static short` | `SUCCESS_REDIRECT` Parsed content contains a directive to redirect to another URL.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParseStatus()`
    `ParseStatus(int majorCode)`
    `ParseStatus(int majorCode, int minorCode)`
    `ParseStatus(int majorCode, int minorCode, java.lang.String message)` Simplified constructor for passing just a text message.
    `ParseStatus(int majorCode, int minorCode, java.lang.String[] args)`
    `ParseStatus(int majorCode, java.lang.String message)` Simplified constructor for passing just a text message.
    `ParseStatus(int majorCode, java.lang.String[] args)`
    `ParseStatus(java.lang.Throwable t)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.String[]` | `getArgs()`
    `Parse` | `getEmptyParse(Configuration conf)` A convenience method.
    `ParseResult` | `getEmptyParseResult(java.lang.String url, Configuration conf)` A convenience method.
    `int` | `getMajorCode()`
    `java.lang.String` | `getMessage()` A convenience method.
    `int` | `getMinorCode()`
    `byte` | `getVersion()`
    `boolean` | `isSuccess()` A convenience method.
    `static ParseStatus` | `read(java.io.DataInput in)`
    `void` | `readFields(java.io.DataInput in)`
    `void` | `setArgs(java.lang.String[] args)`
    `void` | `setMajorCode(byte majorCode)`
    `void` | `setMessage(java.lang.String msg)`
    `void` | `setMinorCode(short minorCode)`
    `java.lang.String` | `toString()`
    `void` | `write(java.io.DataOutput out)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### NOTPARSED

          public static final byte NOTPARSED

      Parsing was not performed.
      See Also:
        Constant Field Values

    - #### SUCCESS

          public static final byte SUCCESS

      Parsing succeeded.
      See Also:
        Constant Field Values

    - #### FAILED

          public static final byte FAILED

      General failure. There may be a more specific error message in arguments.
      See Also:
        Constant Field Values

    - #### majorCodes

          public static final java.lang.String[] majorCodes

    - #### SUCCESS_REDIRECT

          public static final short SUCCESS_REDIRECT

      Parsed content contains a directive to redirect to another URL. The target URL can be retrieved from the arguments.
      See Also:
        Constant Field Values

    - #### FAILED_EXCEPTION

          public static final short FAILED_EXCEPTION

      Parsing failed. An Exception occured (which may be retrieved from the arguments).
      See Also:
        Constant Field Values

    - #### FAILED_TRUNCATED

          public static final short FAILED_TRUNCATED

      Parsing failed. Content was truncated, but the parser cannot handle incomplete content.
      See Also:
        Constant Field Values

    - #### FAILED_INVALID_FORMAT

          public static final short FAILED_INVALID_FORMAT

      Parsing failed. Invalid format - the content may be corrupted or of wrong type.
      See Also:
        Constant Field Values

    - #### FAILED_MISSING_PARTS

          public static final short FAILED_MISSING_PARTS

      Parsing failed. Other related parts of the content are needed to complete parsing. The list of URLs to missing parts may be provided in arguments. The Fetcher may decide to fetch these parts at once, then put them into Content.metadata, and supply them for re-parsing.
      See Also:
        Constant Field Values

    - #### FAILED_MISSING_CONTENT

          public static final short FAILED_MISSING_CONTENT

      Parsing failed. There was no content to be parsed - probably caused by errors at protocol stage.
      See Also:
        Constant Field Values

    - #### STATUS_NOTPARSED

          public static final ParseStatus STATUS_NOTPARSED

    - #### STATUS_SUCCESS

          public static final ParseStatus STATUS_SUCCESS

    - #### STATUS_FAILURE

          public static final ParseStatus STATUS_FAILURE

  - ### Constructor Detail

    - #### ParseStatus

          public ParseStatus()

    - #### ParseStatus

          public ParseStatus(int majorCode,
                             int minorCode,
                             java.lang.String[] args)

    - #### ParseStatus

          public ParseStatus(int majorCode)

    - #### ParseStatus

          public ParseStatus(int majorCode,
                             java.lang.String[] args)

    - #### ParseStatus

          public ParseStatus(int majorCode,
                             int minorCode)

    - #### ParseStatus

          public ParseStatus(int majorCode,
                             int minorCode,
                             java.lang.String message)

      Simplified constructor for passing just a text message.

    - #### ParseStatus

          public ParseStatus(int majorCode,
                             java.lang.String message)

      Simplified constructor for passing just a text message.

    - #### ParseStatus

          public ParseStatus(java.lang.Throwable t)

  - ### Method Detail

    - #### getVersion

          public byte getVersion()

    - #### read

          public static ParseStatus read(java.io.DataInput in)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readFields

          public void readFields(java.io.DataInput in)
                          throws java.io.IOException

      Specified by:
        `readFields` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### write

          public void write(java.io.DataOutput out)
                     throws java.io.IOException

      Specified by:
        `write` in interface `Writable`
      Throws:
        `java.io.IOException`

    - #### isSuccess

          public boolean isSuccess()

      A convenience method. Returns true if majorCode is SUCCESS, false otherwise.

    - #### getMessage

          public java.lang.String getMessage()

      A convenience method. Return a String representation of the first argument, or null.

    - #### getArgs

          public java.lang.String[] getArgs()

    - #### getMajorCode

          public int getMajorCode()

    - #### getMinorCode

          public int getMinorCode()

    - #### getEmptyParse

          public Parse getEmptyParse(Configuration conf)

      A convenience method. Creates an empty Parse instance, which returns this status.

    - #### getEmptyParseResult

          public ParseResult getEmptyParseResult(java.lang.String url,
                                                 Configuration conf)

      A convenience method. Creates an empty ParseResult, which contains this status.

    - #### toString

          public java.lang.String toString()

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

    - #### setArgs

          public void setArgs(java.lang.String[] args)

    - #### setMessage

          public void setMessage(java.lang.String msg)

    - #### setMajorCode

          public void setMajorCode(byte majorCode)

    - #### setMinorCode

          public void setMinorCode(short minorCode)

    - #### equals

          public boolean equals(java.lang.Object o)

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

Copyright © 2019 The Apache Software Foundation