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


Java ClientConfig.getInstance方法代码示例

本文整理汇总了Java中cn.jiguang.common.ClientConfig.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ClientConfig.getInstance方法的具体用法?Java ClientConfig.getInstance怎么用?Java ClientConfig.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cn.jiguang.common.ClientConfig的用法示例。


在下文中一共展示了ClientConfig.getInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PushClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
/**
 * Create a Push Client with max retry times.
 * This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig} instead of this constructor.
    *
 * @param masterSecret  API access secret of the appKey.
 * @param appKey The KEY of one application on JPush.
 * @param maxRetryTimes max retry times
    * @param proxy The max retry times.
 */
   @Deprecated
public PushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy) {
       ServiceHelper.checkBasic(appKey, masterSecret);

       ClientConfig conf = ClientConfig.getInstance();
       conf.setMaxRetryTimes(maxRetryTimes);

       this._baseUrl = (String) conf.get(ClientConfig.PUSH_HOST_NAME);
       this._pushPath = (String) conf.get(ClientConfig.PUSH_PATH);
       this._pushValidatePath = (String) conf.get(ClientConfig.PUSH_VALIDATE_PATH);

       this._apnsProduction = (Integer) conf.get(ClientConfig.APNS_PRODUCTION);
       this._timeToLive = (Long) conf.get(ClientConfig.TIME_TO_LIVE);

       String authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
       this._httpClient = new NativeHttpClient(authCode, proxy, conf);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:27,代码来源:PushClient.java

示例2: DeviceClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
/**
 * This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
 * @param masterSecret API access secret of the appKey.
 * @param appKey The KEY of one application on JPush.
 * @param maxRetryTimes The max retry times.
 * @param proxy The HTTP proxy.
 *
 */
@Deprecated
public DeviceClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy) {
    ClientConfig conf = ClientConfig.getInstance();
    conf.setMaxRetryTimes(maxRetryTimes);
    ServiceHelper.checkBasic(appKey, masterSecret);

    hostName = (String) conf.get(ClientConfig.DEVICE_HOST_NAME);
    devicesPath = (String) conf.get(ClientConfig.DEVICES_PATH);
    tagsPath = (String) conf.get(ClientConfig.TAGS_PATH);
    aliasesPath = (String) conf.get(ClientConfig.ALIASES_PATH);

    String authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
    _httpClient = new NativeHttpClient(authCode, proxy, conf);

}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:24,代码来源:DeviceClient.java

示例3: ScheduleClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
/**
 * This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
 * @param masterSecret API access secret of the appKey.
 * @param appKey The KEY of one application on JPush.
 * @param maxRetryTimes The mas retry times.
 * @param proxy The proxy, if there is no proxy, should be null.
 */
@Deprecated
public ScheduleClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy) {
    ServiceHelper.checkBasic(appKey, masterSecret);

    ClientConfig conf = ClientConfig.getInstance();
    conf.setMaxRetryTimes(maxRetryTimes);

    hostName = (String) conf.get(ClientConfig.SCHEDULE_HOST_NAME);
    schedulePath = (String) conf.get(ClientConfig.SCHEDULE_PATH);
    apnsProduction = (Integer) conf.get(ClientConfig.APNS_PRODUCTION);
    timeToLive = (Long) conf.get(ClientConfig.TIME_TO_LIVE);

    String authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
    this._httpClient = new NativeHttpClient(authCode, proxy, conf);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:23,代码来源:ScheduleClient.java

示例4: ReportClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
/**
    * This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
    * @param masterSecret  API access secret of the appKey.
    * @param appKey The KEY of one application on JPush.
    * @param maxRetryTimes max retry times
    * @param proxy The max retry times.
    *
    */
   @Deprecated
public ReportClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy) {
       ServiceHelper.checkBasic(appKey, masterSecret);

       ClientConfig conf = ClientConfig.getInstance();
       conf.setMaxRetryTimes(maxRetryTimes);

       _hostName = (String) conf.get(ClientConfig.REPORT_HOST_NAME);
       _receivePath = (String) conf.get(ClientConfig.REPORT_RECEIVE_PATH);
       _userPath = (String) conf.get(ClientConfig.REPORT_USER_PATH);
       _messagePath = (String) conf.get(ClientConfig.REPORT_MESSAGE_PATH);

       String authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
       _httpClient = new NativeHttpClient(authCode, proxy, conf);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:24,代码来源:ReportClient.java

示例5: testCustomClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
public static void testCustomClient() {
	ClientConfig config = ClientConfig.getInstance();
	config.setMaxRetryTimes(5);
	config.setConnectionTimeout(10 * 1000);	// 10 seconds
	config.setSSLVersion("TLSv1.1");		// JPush server supports SSLv3, TLSv1, TLSv1.1, TLSv1.2

	JPushClient jPushClient = new JPushClient(PushConfig.masterSecret, PushConfig.appKey, null, config);
	
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:10,代码来源:ClientExample.java

示例6: jPushClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
/**
 * 创建JpushClient
 *
 * @return
 */
private JPushClient jPushClient() {
	ClientConfig clientConfig = ClientConfig.getInstance();
	JPushClient jpushClient = new JPushClient(this.MASTER_SECRET, this.APPKEY, null, clientConfig);
	return jpushClient;
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:11,代码来源:PushServiceForCall.java

示例7: testCustomPushClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
public static void testCustomPushClient() {
	ClientConfig config = ClientConfig.getInstance();

	config.setApnsProduction(false); 	// development env
	config.setTimeToLive(60 * 60 * 24); // one day

//	config.setGlobalPushSetting(false, 60 * 60 * 24); // development env, one day

	JPushClient jPushClient = new JPushClient(PushConfig.masterSecret, PushConfig.appKey, null, config); 	// JPush client

//	PushClient pushClient = new PushClient(masterSecret, appKey, null, config); 	// push client only

}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:14,代码来源:ClientExample.java

示例8: JPushClient

import cn.jiguang.common.ClientConfig; //导入方法依赖的package包/类
/**
* Create a JPush Client with global settings.
* 
* If you want different settings from default globally, this constructor is what you needed.
* This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setGlobalPushSetting} instead of this constructor.
   *
* @param masterSecret API access secret of the appKey.
* @param appKey The KEY of one application on JPush.
* @param apnsProduction Global APNs environment setting. It will override PushPayload Options.
* @param timeToLive Global time_to_live setting. It will override PushPayload Options.
*/
  @Deprecated
  public JPushClient(String masterSecret, String appKey, boolean apnsProduction, long timeToLive) {
      ClientConfig conf = ClientConfig.getInstance();
      conf.setApnsProduction(apnsProduction);
      conf.setTimeToLive(timeToLive);
      _pushClient = new PushClient(masterSecret, appKey);
      _reportClient = new ReportClient(masterSecret, appKey);
      _deviceClient = new DeviceClient(masterSecret, appKey);
      _scheduleClient = new ScheduleClient(masterSecret, appKey);
  }
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:22,代码来源:JPushClient.java


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