public class RestService
extends IntentService
Processor.process(RESTRequest)
On the forward path the service receives the Intent sent by WebService
and starts the corresponding REST method.
On the return path the service handles the callback fires by Processor
and sends the result to the RestResultReceiver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INTENT_KEY
Intent key
|
private Intent |
mCurrentIntent |
private static Processor |
processor
Processor to call |
static java.lang.String |
RECEIVER_KEY
Receiver key for intent
|
static java.lang.String |
REQUEST_KEY
RESTRequest key for intent |
static java.lang.String |
TAG |
Constructor and Description |
---|
RestService()
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
handleRESTServiceCallback(int statusCode,
RESTRequest<? extends Resource> r)
Handles the binder callback fires by the Processor in
Processor.postRequestProcess(int, RESTRequest, java.io.InputStream)
Current intent is retrieved in RestService#intentsMap in order to send results to RestResultReceiver |
protected void |
onHandleIntent(Intent intent)
Receives the intent and starts the request by calling
Processor.process(RESTRequest) |
static void |
setProcessor(Processor processor)
Setter for the
Processor |
public static final java.lang.String REQUEST_KEY
RESTRequest
key for intentpublic static final java.lang.String RECEIVER_KEY
public static final java.lang.String INTENT_KEY
public static final java.lang.String TAG
private static Processor processor
Processor
to callsetProcessor(Processor)
private Intent mCurrentIntent
protected void onHandleIntent(Intent intent)
Processor.process(RESTRequest)
Processor
,
Processor.RESTServiceCallback
private void handleRESTServiceCallback(int statusCode, RESTRequest<? extends Resource> r)
Processor.postRequestProcess(int, RESTRequest, java.io.InputStream)
Current intent is retrieved in RestService#intentsMap
in order to send results to RestResultReceiver
statusCode
- The status code resulting of all processr
- The actual RESTRequest
Processor.postRequestProcess(int, RESTRequest, java.io.InputStream)
,
RestResultReceiver
,
RestService#intentsMap