SMILA (incubation) API documentation

org.eclipse.smila.connectivity.framework.crawler.web.http
Class HttpStatus

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.crawler.web.http.HttpStatus

public class HttpStatus
extends java.lang.Object

Set of status codes for retrieved URL.


Field Summary
static int ACCESS_DENIED
          Access denied - authorization required, but missing/incorrect.
static int BLOCKED
          Thread was blocked HTTP.max.delays times during fetching.
static int EXCEPTION
          Unspecified exception occurred.
static int FAILED
          Content was not retrieved.
static int GONE
          Resource is gone.
static int MOVED
          Resource has moved permanently.
static int NOTFETCHING
          Not fetching.
static int NOTFOUND
          Resource was not found.
static int NOTMODIFIED
          Unchanged since the last fetch.
static int PROTO_NOT_FOUND
          This protocol was not found.
static int REDIR_EXCEEDED
          Too many redirects.
static int RETRY
          Temporary failure.
static int ROBOTS_DENIED
          Access denied by robots.txt rules.
static HttpStatus STATUS_BLOCKED
          The Constant STATUS_BLOCKED.
static HttpStatus STATUS_FAILED
          The Constant STATUS_FAILED.
static HttpStatus STATUS_GONE
          The Constant STATUS_GONE.
static HttpStatus STATUS_NOTFETCHING
          The Constant STATUS_NOTFETCHING.
static HttpStatus STATUS_NOTFOUND
          The Constant STATUS_NOTFOUND.
static HttpStatus STATUS_NOTMODIFIED
          The Constant STATUS_NOTMODIFIED.
static HttpStatus STATUS_REDIR_EXCEEDED
          The Constant STATUS_REDIR_EXCEEDED.
static HttpStatus STATUS_RETRY
          The Constant STATUS_RETRY.
static HttpStatus STATUS_ROBOTS_DENIED
          The Constant STATUS_ROBOTS_DENIED.
static HttpStatus STATUS_SUCCESS
          The Constant STATUS_SUCCESS.
static HttpStatus STATUS_WOULDBLOCK
          The Constant STATUS_WOULDBLOCK.
static int SUCCESS
          Content was retrieved without errors.
static int TEMP_MOVED
          Resource has moved temporarily.
static int WOULDBLOCK
          Request was refused by protocol plug-ins, because it would block.
 
Constructor Summary
HttpStatus()
          Empty constructor.
HttpStatus(int code)
          Creates new object with given status code and empty message.
HttpStatus(int code, java.lang.Object message)
          Creates new object with given status code and object as a message.
HttpStatus(int code, java.lang.String message)
          Creates new object with the given status code and message.
HttpStatus(java.lang.Throwable throwable)
          Creates new object with the EXCEPTION status.
 
Method Summary
 boolean equals(java.lang.Object o)
          
 int getCode()
          Returns status code.
 java.lang.String getMessage()
          Returns status message.
 int hashCode()
          
 boolean isPermanentFailure()
          Checks if the HTTP error is permanent.
 boolean isSuccess()
          Checks if the status code is equal to SUCCESS.
 boolean isTransientFailure()
          Checks if the HTTP error is transient.
 void setCode(int code)
          Assigns status code.
 void setMessage(java.lang.String message)
          Assigns status message.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SUCCESS

public static final int SUCCESS
Content was retrieved without errors.

See Also:
Constant Field Values

FAILED

public static final int FAILED
Content was not retrieved. Any further errors may be indicated in _message.

See Also:
Constant Field Values

PROTO_NOT_FOUND

public static final int PROTO_NOT_FOUND
This protocol was not found. Application may attempt to retry later.

See Also:
Constant Field Values

GONE

public static final int GONE
Resource is gone.

See Also:
Constant Field Values

MOVED

public static final int MOVED
Resource has moved permanently. New URL should be found in _message.

See Also:
Constant Field Values

TEMP_MOVED

public static final int TEMP_MOVED
Resource has moved temporarily. New URL should be found in _message.

See Also:
Constant Field Values

NOTFOUND

public static final int NOTFOUND
Resource was not found.

See Also:
Constant Field Values

RETRY

public static final int RETRY
Temporary failure. Application may retry immediately.

See Also:
Constant Field Values

EXCEPTION

public static final int EXCEPTION
Unspecified exception occurred. Further information may be provided in _message.

See Also:
Constant Field Values

ACCESS_DENIED

public static final int ACCESS_DENIED
Access denied - authorization required, but missing/incorrect.

See Also:
Constant Field Values

ROBOTS_DENIED

public static final int ROBOTS_DENIED
Access denied by robots.txt rules.

See Also:
Constant Field Values

REDIR_EXCEEDED

public static final int REDIR_EXCEEDED
Too many redirects.

See Also:
Constant Field Values

NOTFETCHING

public static final int NOTFETCHING
Not fetching.

See Also:
Constant Field Values

NOTMODIFIED

public static final int NOTMODIFIED
Unchanged since the last fetch.

See Also:
Constant Field Values

WOULDBLOCK

public static final int WOULDBLOCK
Request was refused by protocol plug-ins, because it would block. The expected number of milliseconds to wait before retry may be provided in _message.

See Also:
Constant Field Values

BLOCKED

public static final int BLOCKED
Thread was blocked HTTP.max.delays times during fetching.

See Also:
Constant Field Values

STATUS_SUCCESS

public static final HttpStatus STATUS_SUCCESS
The Constant STATUS_SUCCESS.


STATUS_FAILED

public static final HttpStatus STATUS_FAILED
The Constant STATUS_FAILED.


STATUS_GONE

public static final HttpStatus STATUS_GONE
The Constant STATUS_GONE.


STATUS_NOTFOUND

public static final HttpStatus STATUS_NOTFOUND
The Constant STATUS_NOTFOUND.


STATUS_RETRY

public static final HttpStatus STATUS_RETRY
The Constant STATUS_RETRY.


STATUS_ROBOTS_DENIED

public static final HttpStatus STATUS_ROBOTS_DENIED
The Constant STATUS_ROBOTS_DENIED.


STATUS_REDIR_EXCEEDED

public static final HttpStatus STATUS_REDIR_EXCEEDED
The Constant STATUS_REDIR_EXCEEDED.


STATUS_NOTFETCHING

public static final HttpStatus STATUS_NOTFETCHING
The Constant STATUS_NOTFETCHING.


STATUS_NOTMODIFIED

public static final HttpStatus STATUS_NOTMODIFIED
The Constant STATUS_NOTMODIFIED.


STATUS_WOULDBLOCK

public static final HttpStatus STATUS_WOULDBLOCK
The Constant STATUS_WOULDBLOCK.


STATUS_BLOCKED

public static final HttpStatus STATUS_BLOCKED
The Constant STATUS_BLOCKED.

Constructor Detail

HttpStatus

public HttpStatus()
Empty constructor.


HttpStatus

public HttpStatus(int code,
                  java.lang.String message)
Creates new object with the given status code and message.

Parameters:
code - code
message - String

HttpStatus

public HttpStatus(int code)
Creates new object with given status code and empty message.

Parameters:
code - code

HttpStatus

public HttpStatus(int code,
                  java.lang.Object message)
Creates new object with given status code and object as a message.

Parameters:
code - status code
message - Object

HttpStatus

public HttpStatus(java.lang.Throwable throwable)
Creates new object with the EXCEPTION status.

Parameters:
throwable - Throwable
Method Detail

getCode

public int getCode()
Returns status code.

Returns:
code

setCode

public void setCode(int code)
Assigns status code.

Parameters:
code - the code

isSuccess

public boolean isSuccess()
Checks if the status code is equal to SUCCESS.

Returns:
boolean

isTransientFailure

public boolean isTransientFailure()
Checks if the HTTP error is transient.

Returns:
boolean

isPermanentFailure

public boolean isPermanentFailure()
Checks if the HTTP error is permanent.

Returns:
boolean

getMessage

public java.lang.String getMessage()
Returns status message.

Returns:
String

setMessage

public void setMessage(java.lang.String message)
Assigns status message.

Parameters:
message - String

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

SMILA (incubation) API documentation