本文整理汇总了Java中com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient类的典型用法代码示例。如果您正苦于以下问题:Java AndroidInvalidationClient类的具体用法?Java AndroidInvalidationClient怎么用?Java AndroidInvalidationClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AndroidInvalidationClient类属于com.google.ipc.invalidation.external.client.android包,在下文中一共展示了AndroidInvalidationClient类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
@Override
protected void start(Request request, Response.Builder response) {
String clientKey = request.getClientKey();
AndroidInvalidationClient client = clientManager.get(clientKey);
if (setResponseStatus(client, request, response)) {
client.start();
}
}
示例2: stop
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
@Override
protected void stop(Request request, Response.Builder response) {
String clientKey = request.getClientKey();
AndroidInvalidationClient client = clientManager.get(clientKey);
if (setResponseStatus(client, request, response)) {
client.stop();
}
}
示例3: register
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
@Override
protected void register(Request request, Response.Builder response) {
String clientKey = request.getClientKey();
AndroidInvalidationClient client = clientManager.get(clientKey);
if (setResponseStatus(client, request, response)) {
ObjectId objectId = request.getObjectId();
client.register(objectId);
}
}
示例4: unregister
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
@Override
protected void unregister(Request request, Response.Builder response) {
String clientKey = request.getClientKey();
AndroidInvalidationClient client = clientManager.get(clientKey);
if (setResponseStatus(client, request, response)) {
ObjectId objectId = request.getObjectId();
client.unregister(objectId);
}
}
示例5: acknowledge
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
@Override
protected void acknowledge(Request request, Response.Builder response) {
String clientKey = request.getClientKey();
AckHandle ackHandle = request.getAckHandle();
AndroidInvalidationClient client = clientManager.get(clientKey);
if (setResponseStatus(client, request, response)) {
client.acknowledge(ackHandle);
}
}
示例6: destroy
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
@Override
protected void destroy(Request request, Response.Builder response) {
String clientKey = request.getClientKey();
AndroidInvalidationClient client = clientManager.get(clientKey);
if (setResponseStatus(client, request, response)) {
client.destroy();
}
}
示例7: setResponseStatus
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
/**
* If {@code client} is {@code null}, sets the {@code response} status to an error. Otherwise,
* sets the status to {@code success}.
* @return whether {@code client} was non-{@code null}. *
*/
private boolean setResponseStatus(AndroidInvalidationClient client, Request request,
Response.Builder response) {
if (client == null) {
response.setError("Client does not exist: " + request);
response.setStatus(Status.INVALID_CLIENT);
return false;
} else {
response.setStatus(Status.SUCCESS);
return true;
}
}
示例8: getClientKey
import com.google.ipc.invalidation.external.client.android.AndroidInvalidationClient; //导入依赖的package包/类
private String getClientKey(InvalidationClient client) {
return ((AndroidInvalidationClient) client).getClientKey();
}