本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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
}
示例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);
}