|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.net.http.RequestQueue
public class RequestQueue
| Nested Class Summary | |
|---|---|
(package private) class |
RequestQueue.ActivePool
This class maintains active connection threads |
(package private) static interface |
RequestQueue.ConnectionManager
This interface is exposed to each connection |
(package private) class |
RequestQueue.NetworkStateTracker
|
| Field Summary | |
|---|---|
static String |
HTTP_NETWORK_STATE_CHANGED_INTENT
This intent broadcast when http is paused or unpaused due to net availability toggling |
static String |
HTTP_NETWORK_STATE_UP
|
(package private) boolean |
mNetworkConnected
true if connected |
| Constructor Summary | |
|---|---|
RequestQueue(Context context)
A RequestQueue class instance maintains a set of queued requests. |
|
RequestQueue(Context context,
int connectionCount)
A RequestQueue class instance maintains a set of queued requests. |
|
| Method Summary | |
|---|---|
void |
disablePlatformNotifications()
If platform notifications have been enabled, call this method to disable before destroying RequestQueue |
(package private) void |
dump()
debug tool: prints request queue to log |
void |
enablePlatformNotifications()
Enables data state and proxy tracking |
HttpHost |
getProxyHost()
used by webkit |
Request |
getRequest()
|
Request |
getRequest(HttpHost host)
|
boolean |
haveRequest(HttpHost host)
|
protected void |
queueRequest(Request request,
boolean head)
|
RequestHandle |
queueRequest(String url,
String method,
Map<String,String> headers,
EventHandler eventHandler,
InputStream bodyProvider,
int bodyLength,
boolean highPriority)
Queues an HTTP request |
RequestHandle |
queueRequest(String url,
WebAddress uri,
String method,
Map<String,String> headers,
EventHandler eventHandler,
InputStream bodyProvider,
int bodyLength,
boolean highPriority)
Queues an HTTP request |
(package private) boolean |
requestsPending()
|
void |
requeueRequest(Request request)
Put request back on head of queue |
void |
setNetworkState(boolean isNetworkConnected)
Called by the NetworkStateTracker -- updates when network connectivity is lost/restored. |
void |
shutdown()
This must be called to cleanly shutdown RequestQueue |
void |
startTiming()
|
void |
stopTiming()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
boolean mNetworkConnected
public static final String HTTP_NETWORK_STATE_CHANGED_INTENT
public static final String HTTP_NETWORK_STATE_UP
| Constructor Detail |
|---|
public RequestQueue(Context context)
context - application context
public RequestQueue(Context context,
int connectionCount)
context - application contextconnectionCount - The number of simultaneous connections| Method Detail |
|---|
public void enablePlatformNotifications()
public void disablePlatformNotifications()
public HttpHost getProxyHost()
public RequestHandle queueRequest(String url,
String method,
Map<String,String> headers,
EventHandler eventHandler,
InputStream bodyProvider,
int bodyLength,
boolean highPriority)
url - The url to load.method - "GET" or "POST."headers - A hashmap of http headers.eventHandler - The event handler for handling returned
data. Callbacks will be made on the supplied instance.bodyProvider - InputStream providing HTTP body, null if nonebodyLength - length of body, must be 0 if bodyProvider is nullhighPriority - If true, queues before low priority
requests if possible
public RequestHandle queueRequest(String url,
WebAddress uri,
String method,
Map<String,String> headers,
EventHandler eventHandler,
InputStream bodyProvider,
int bodyLength,
boolean highPriority)
url - The url to load.uri - The uri of the url to load.method - "GET" or "POST."headers - A hashmap of http headers.eventHandler - The event handler for handling returned
data. Callbacks will be made on the supplied instance.bodyProvider - InputStream providing HTTP body, null if nonebodyLength - length of body, must be 0 if bodyProvider is nullhighPriority - If true, queues before low priority
requests if possiblepublic void setNetworkState(boolean isNetworkConnected)
boolean requestsPending()
void dump()
public Request getRequest()
getRequest in interface RequestFeederpublic Request getRequest(HttpHost host)
getRequest in interface RequestFeederpublic boolean haveRequest(HttpHost host)
haveRequest in interface RequestFeederpublic void requeueRequest(Request request)
requeueRequest in interface RequestFeederpublic void shutdown()
protected void queueRequest(Request request,
boolean head)
public void startTiming()
public void stopTiming()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||