当前位置: 首页>>代码示例>>Java>>正文


Java BaseResult类代码示例

本文整理汇总了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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:18,代码来源:PushClient.java

示例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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:18,代码来源:PushClient.java

示例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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:11,代码来源:DeviceClient.java

示例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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:16,代码来源:ReportClient.java

示例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);        
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:7,代码来源:DeviceClient.java

示例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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:8,代码来源:DeviceClient.java


注:本文中的cn.jiguang.common.resp.BaseResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。