MCPcopy Create free account
hub / github.com/apache/nutch / ProtocolStatus

Class ProtocolStatus

src/java/org/apache/nutch/storage/ProtocolStatus.java:28–483  ·  view source on GitHub ↗

A nested container representing data captured from web server responses.

Source from the content-addressed store, hash-verified

26
27/** A nested container representing data captured from web server responses. */
28public class ProtocolStatus extends org.apache.gora.persistency.impl.PersistentBase implements org.apache.avro.specific.SpecificRecord, org.apache.gora.persistency.Persistent {
29 public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ProtocolStatus\",\"namespace\":\"org.apache.nutch.storage\",\"doc\":\"A nested container representing data captured from web server responses.\",\"fields\":[{\"name\":\"code\",\"type\":\"int\",\"doc\":\"A protocol response code which can be one of SUCCESS - content was retrieved without errors, FAILED - Content was not retrieved. Any further errors may be indicated in args, PROTO_NOT_FOUND - This protocol was not found. Application may attempt to retry later, GONE - Resource is gone, MOVED - Resource has moved permanently. New url should be found in args, TEMP_MOVED - Resource has moved temporarily. New url should be found in args., NOTFOUND - Resource was not found, RETRY - Temporary failure. Application may retry immediately., EXCEPTION - Unspecified exception occured. Further information may be provided in args., ACCESS_DENIED - Access denied - authorization required, but missing/incorrect., ROBOTS_DENIED - Access denied by robots.txt rules., REDIR_EXCEEDED - Too many redirects., NOTFETCHING - Not fetching., NOTMODIFIED - Unchanged since the last fetch., WOULDBLOCK - Request was refused by protocol plugins, because it would block. The expected number of milliseconds to wait before retry may be provided in args., BLOCKED - Thread was blocked http.max.delays times during fetching.\",\"default\":0},{\"name\":\"args\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"doc\":\"Optional arguments supplied to compliment and/or justify the response code.\",\"default\":[]},{\"name\":\"lastModified\",\"type\":\"long\",\"doc\":\"A server reponse indicating when this page was last modified, this can be unreliable at times hence this is used as a default fall back value for the preferred 'modifiedTime' and 'preModifiedTime' obtained from the WebPage itself.\",\"default\":0}]}");
30 private static final long serialVersionUID = 1419258826534980195L;
31 /** Enum containing all data bean's fields. */
32 public static enum Field {
33 CODE(0, "code"),
34 ARGS(1, "args"),
35 LAST_MODIFIED(2, "lastModified"),
36 ;
37 /**
38 * Field's index.
39 */
40 private int index;
41
42 /**
43 * Field's name.
44 */
45 private String name;
46
47 /**
48 * Field's constructor
49 * @param index field's index.
50 * @param name field's name.
51 */
52 Field(int index, String name) {this.index=index;this.name=name;}
53
54 /**
55 * Gets field's index.
56 * @return int field's index.
57 */
58 public int getIndex() {return index;}
59
60 /**
61 * Gets field's name.
62 * @return String field's name.
63 */
64 public String getName() {return name;}
65
66 /**
67 * Gets field's attributes to string.
68 * @return String field's attributes to string.
69 */
70 public String toString() {return name;}
71 };
72
73 public static final String[] _ALL_FIELDS = {
74 "code",
75 "args",
76 "lastModified",
77 };
78
79 /**
80 * Gets the total field count.
81 * @return int field count
82 */
83 public int getFieldsCount() {
84 return ProtocolStatus._ALL_FIELDS.length;
85 }

Callers

nothing calls this directly

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected