本文整理汇总了Java中cn.jiguang.common.resp.BaseResult类的典型用法代码示例。如果您正苦于以下问题:Java BaseResult类的具体用法?Java BaseResult怎么用?Java BaseResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseResult类属于cn.jiguang.common.resp包,在下文中一共展示了BaseResult类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendPush
import cn.jiguang.common.resp.BaseResult; //导入依赖的package包/类
public PushResult sendPush(PushPayload pushPayload) throws APIConnectionException, APIRequestException {
Preconditions.checkArgument(! (null == pushPayload), "pushPayload should not be null");
if (_apnsProduction > 0) {
pushPayload.resetOptionsApnsProduction(true);
} else if(_apnsProduction == 0) {
pushPayload.resetOptionsApnsProduction(false);
}
if (_timeToLive >= 0) {
pushPayload.resetOptionsTimeToLive(_timeToLive);
}
ResponseWrapper response = _httpClient.sendPost(_baseUrl + _pushPath, pushPayload.toString());
return BaseResult.fromResponse(response, PushResult.class);
}
示例2: sendPushValidate
import cn.jiguang.common.resp.BaseResult; //导入依赖的package包/类
public PushResult sendPushValidate(PushPayload pushPayload) throws APIConnectionException, APIRequestException {
Preconditions.checkArgument(! (null == pushPayload), "pushPayload should not be null");
if (_apnsProduction > 0) {
pushPayload.resetOptionsApnsProduction(true);
} else if(_apnsProduction == 0) {
pushPayload.resetOptionsApnsProduction(false);
}
if (_timeToLive >= 0) {
pushPayload.resetOptionsTimeToLive(_timeToLive);
}
ResponseWrapper response = _httpClient.sendPost(_baseUrl + _pushValidatePath, pushPayload.toString());
return BaseResult.fromResponse(response, PushResult.class);
}
示例3: getAliasDeviceList
import cn.jiguang.common.resp.BaseResult; //导入依赖的package包/类
public AliasDeviceListResult getAliasDeviceList(String alias, String platform) throws APIConnectionException, APIRequestException {
String url = hostName + aliasesPath + "/" + alias;
if (null != platform) {
url += "?platform=" + platform;
}
ResponseWrapper response = _httpClient.sendGet(url);
return BaseResult.fromResponse(response, AliasDeviceListResult.class);
}
示例4: getUsers
import cn.jiguang.common.resp.BaseResult; //导入依赖的package包/类
public UsersResult getUsers(TimeUnit timeUnit, String start, int duration)
throws APIConnectionException, APIRequestException {
String startEncoded = null;
try {
startEncoded = URLEncoder.encode(start, "utf-8");
} catch (Exception e) {
}
String url = _hostName + _userPath
+ "?time_unit=" + timeUnit.toString()
+ "&start=" + startEncoded + "&duration=" + duration;
ResponseWrapper response = _httpClient.sendGet(url);
return BaseResult.fromResponse(response, UsersResult.class);
}
示例5: isDeviceInTag
import cn.jiguang.common.resp.BaseResult; //导入依赖的package包/类
public BooleanResult isDeviceInTag(String theTag, String registrationID) throws APIConnectionException, APIRequestException {
String url = hostName + tagsPath + "/" + theTag + "/registration_ids/" + registrationID;
ResponseWrapper response = _httpClient.sendGet(url);
return BaseResult.fromResponse(response, BooleanResult.class);
}
示例6: getDeviceTagAlias
import cn.jiguang.common.resp.BaseResult; //导入依赖的package包/类
public TagAliasResult getDeviceTagAlias(String registrationId) throws APIConnectionException, APIRequestException {
String url = hostName + devicesPath + "/" + registrationId;
ResponseWrapper response = _httpClient.sendGet(url);
return BaseResult.fromResponse(response, TagAliasResult.class);
}