com.monkeycoder.monkeynetwork
Class HttpStateEngine

java.lang.Object
  extended by java.util.Observable
      extended by com.monkeycoder.monkeynetwork.ProtocolStateEngine
          extended by com.monkeycoder.monkeynetwork.HttpStateEngine
All Implemented Interfaces:
java.lang.Runnable

public class HttpStateEngine
extends ProtocolStateEngine
implements java.lang.Runnable

This class handles HTTP Fetching and state maintenance.

This class uses monkeynetwork.ini and requires the following parameters:

Author:
David Stephens

Field Summary
static int STATE_EVALUATE_ENCODING_TYPE
           
static int STATE_EVALUATE_RESPONSE_CODE
           
static int STATE_GET_RESPONSE_BODY
           
static int STATE_GET_RESPONSE_HEADER
           
static int STATE_SEND_REQUEST
           
static int STATE_SETUP_FETCH_BLIND
           
static int STATE_SETUP_FETCH_CHUNKED
           
static int STATE_SETUP_FETCH_CONTENT_LENGTH
           
static int STATE_WAIT
           
 
Fields inherited from class com.monkeycoder.monkeynetwork.ProtocolStateEngine
content, fetchUri, net, nextState, STATE_DONE, STATE_START
 
Constructor Summary
HttpStateEngine()
          Creates a state engine for handling HTTP network traffic.
 
Method Summary
 void run()
          Multi-Threaded entry point.
 
Methods inherited from class com.monkeycoder.monkeynetwork.ProtocolStateEngine
getContent, setFetchUri, setNetwork
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_WAIT

public static final int STATE_WAIT
See Also:
Constant Field Values

STATE_SEND_REQUEST

public static final int STATE_SEND_REQUEST
See Also:
Constant Field Values

STATE_GET_RESPONSE_HEADER

public static final int STATE_GET_RESPONSE_HEADER
See Also:
Constant Field Values

STATE_EVALUATE_RESPONSE_CODE

public static final int STATE_EVALUATE_RESPONSE_CODE
See Also:
Constant Field Values

STATE_EVALUATE_ENCODING_TYPE

public static final int STATE_EVALUATE_ENCODING_TYPE
See Also:
Constant Field Values

STATE_SETUP_FETCH_CHUNKED

public static final int STATE_SETUP_FETCH_CHUNKED
See Also:
Constant Field Values

STATE_SETUP_FETCH_CONTENT_LENGTH

public static final int STATE_SETUP_FETCH_CONTENT_LENGTH
See Also:
Constant Field Values

STATE_SETUP_FETCH_BLIND

public static final int STATE_SETUP_FETCH_BLIND
See Also:
Constant Field Values

STATE_GET_RESPONSE_BODY

public static final int STATE_GET_RESPONSE_BODY
See Also:
Constant Field Values
Constructor Detail

HttpStateEngine

public HttpStateEngine()
Creates a state engine for handling HTTP network traffic.

Method Detail

run

public void run()
Multi-Threaded entry point. Run in its own thread and use Thread.start().

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class ProtocolStateEngine