
public class PushGCM extends Object
| Modifier and Type | Field and Description |
|---|---|
static Hashtable<String,ServiceResponse> |
pendingCalls
Holds in memory the pending calls awaiting response from remote clients
|
| Constructor and Description |
|---|
PushGCM() |
| Modifier and Type | Method and Description |
|---|---|
static ServiceResponse |
callS(String nodeid,
String remoteid,
ServiceCall call,
String toURI)
Build a ServiceCall callback message and send it to the client remote
node endpoint through GCM.
|
static void |
handleResponse(String resp,
String nodeid)
Handles the response sent by the remote client, sending it to the right
pending call.
|
static void |
sendC(String nodeid,
String remoteid,
ContextEvent event,
String toURI)
Build a Context Event callback message and send it to the client remote
node endpoint through GCM.
|
public static Hashtable<String,ServiceResponse> pendingCalls
public static void sendC(String nodeid, String remoteid, ContextEvent event, String toURI) throws PushException
nodeid - The client id, needed in case the GCM key needs to be updated
in the DBremoteid - The client remote node endpointevent - The serialized Context Event to sendtoURI - PushExceptionpublic static ServiceResponse callS(String nodeid, String remoteid, ServiceCall call, String toURI) throws PushException
nodeid - The client id, needed in case the GCM key needs to be updated
in the DBremoteid - The client remote node endpointcall - The serialized Service Call to sendtoURI - PushExceptionpublic static void handleResponse(String resp, String nodeid) throws PushException
resp - The encoded response text sent by the clientnodeid - The id of the remote node, used to identify the right pending
callPushException - if the response message could not be properly readCopyright © 2018 universAAL Consortium. All rights reserved.