@@ -54,14 +54,16 @@ public JPushClient(String masterSecret, String appKey) {
5454 _deviceClient = new DeviceClient (masterSecret , appKey );
5555 _scheduleClient = new ScheduleClient (masterSecret , appKey );
5656 }
57-
57+
58+ @ Deprecated
5859 public JPushClient (String masterSecret , String appKey , int maxRetryTimes ) {
5960 _pushClient = new PushClient (masterSecret , appKey , maxRetryTimes );
6061 _reportClient = new ReportClient (masterSecret , appKey , maxRetryTimes );
6162 _deviceClient = new DeviceClient (masterSecret , appKey , maxRetryTimes );
6263 _scheduleClient = new ScheduleClient (masterSecret , appKey , maxRetryTimes );
6364 }
64-
65+
66+ @ Deprecated
6567 public JPushClient (String masterSecret , String appKey , int maxRetryTimes , HttpProxy proxy ) {
6668 _pushClient = new PushClient (masterSecret , appKey , maxRetryTimes , proxy );
6769 _reportClient = new ReportClient (masterSecret , appKey , maxRetryTimes , proxy );
@@ -81,10 +83,15 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr
8183 * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
8284 */
8385 public JPushClient (String masterSecret , String appKey , int maxRetryTimes , HttpProxy proxy , ClientConfig conf ) {
84- _pushClient = new PushClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
85- _reportClient = new ReportClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
86- _deviceClient = new DeviceClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
87- _scheduleClient = new ScheduleClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
86+ this (masterSecret , appKey , proxy , conf );
87+ conf .setMaxRetryTimes (maxRetryTimes );
88+ }
89+
90+ public JPushClient (String masterSecret , String appKey , HttpProxy proxy , ClientConfig conf ) {
91+ _pushClient = new PushClient (masterSecret , appKey , proxy , conf );
92+ _reportClient = new ReportClient (masterSecret , appKey , proxy , conf );
93+ _deviceClient = new DeviceClient (masterSecret , appKey , proxy , conf );
94+ _scheduleClient = new ScheduleClient (masterSecret , appKey , proxy , conf );
8895 }
8996
9097 /**
@@ -101,12 +108,33 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr
101108 * @param apnsProduction Global APNs environment setting. It will override PushPayload Options.
102109 * @param timeToLive Global time_to_live setting. It will override PushPayload Options.
103110 */
111+ @ Deprecated
104112 public JPushClient (String masterSecret , String appKey , int maxRetryTimes , HttpProxy proxy , ClientConfig conf ,
105113 boolean apnsProduction , long timeToLive ) {
106- _pushClient = new PushClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
107- _reportClient = new ReportClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
108- _deviceClient = new DeviceClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
109- _scheduleClient = new ScheduleClient (masterSecret , appKey , maxRetryTimes , proxy , conf );
114+ this (masterSecret , appKey , proxy , conf , apnsProduction , timeToLive );
115+ conf .setMaxRetryTimes (maxRetryTimes );
116+
117+ }
118+
119+ /**
120+ * Create a JPush Client by custom Client configuration with global settings.
121+ *
122+ * If you are using JPush privacy cloud, and you want different settings from default globally,
123+ * maybe this constructor is what you needed.
124+ *
125+ * @param masterSecret API access secret of the appKey.
126+ * @param appKey The KEY of one application on JPush.
127+ * @param proxy The proxy, if there is no proxy, should be null.
128+ * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
129+ * @param apnsProduction Global APNs environment setting. It will override PushPayload Options.
130+ * @param timeToLive Global time_to_live setting. It will override PushPayload Options.
131+ */
132+ public JPushClient (String masterSecret , String appKey , HttpProxy proxy , ClientConfig conf ,
133+ boolean apnsProduction , long timeToLive ) {
134+ _pushClient = new PushClient (masterSecret , appKey , proxy , conf );
135+ _reportClient = new ReportClient (masterSecret , appKey , proxy , conf );
136+ _deviceClient = new DeviceClient (masterSecret , appKey , proxy , conf );
137+ _scheduleClient = new ScheduleClient (masterSecret , appKey , proxy , conf );
110138 _pushClient .setDefaults (apnsProduction , timeToLive );
111139 }
112140
@@ -126,8 +154,6 @@ public JPushClient(String masterSecret, String appKey, boolean apnsProduction, l
126154 _deviceClient = new DeviceClient (masterSecret , appKey );
127155 _scheduleClient = new ScheduleClient (masterSecret , appKey );
128156 }
129-
130-
131157 // ----------------------------- Push API
132158
133159 /**
0 commit comments