|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
com.alarexgroup.m2mplf.net.http.HttpAsyncCommunicator
public class HttpAsyncCommunicator
This class is designated for HTTP registry communication. When sends HTTP request, application can carry on the next work without waiting on server's replay.
Answer is proccessed as far as is returned. Regarding to common GPRS communication delay and speed in dates transfer is this way very convenient.
Example:
import com.alarexgroup.m2mplf.M2Mlet;
|
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Method Summary | |
|---|---|
int |
addHeaderProperty(java.lang.String key,
java.lang.String value)
Append a parameter to HTTP header |
void |
close()
communicator logged off |
static HttpAsyncCommunicator |
getHttpAsyncCommunicator(HTTPEventListener listener,
java.lang.String connectionProfile)
Returns initialized HTTPAsyncCommunicator. |
int |
openConnection(java.lang.String url,
java.lang.String method)
Opens connection to concrete URL. |
void |
run()
internal method |
void |
sendRequest(byte[] data)
data sending - in HTTP request |
void |
setRequestId(int id)
ID setting - to match REQUEST-ANSWER in onHTTPEvent method |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static HttpAsyncCommunicator getHttpAsyncCommunicator(HTTPEventListener listener,
java.lang.String connectionProfile)
listener - HTTPEventListener - this class implements HTTPEventListener interface.
Into this class is directed call of onHTTPEvent menthod - for input data processing.connectionProfile - connection profile
public int openConnection(java.lang.String url,
java.lang.String method)
url - url - server address in form "http://www.youraddress.cz", eventually includes parameters.method - POST, GET, HEAD
public int addHeaderProperty(java.lang.String key,
java.lang.String value)
key - - name of parametervalue - - value of parameter
public void sendRequest(byte[] data)
data - to sendpublic void setRequestId(int id)
id - identifierpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void close()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||