forked from PingPlusPlus/pingpp-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPingpp.java
More file actions
78 lines (68 loc) · 1.76 KB
/
Pingpp.java
File metadata and controls
78 lines (68 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.pingplusplus;
/**
* Ping++ Base class
*/
public abstract class Pingpp {
/**
* Ping++ API BASE URL
*/
public static final String LIVE_API_BASE = "https://api.pingxx.com";
/**
* version
*/
public static final String VERSION = "2.1.8";
/**
* api key
*/
public static volatile String apiKey;
/**
* api version
*/
public static volatile String apiVersion = "2016-09-20";
public static String AcceptLanguage = "zh-CN";
private static volatile boolean verifySSL = true;
private static volatile String apiBase = LIVE_API_BASE;
public static volatile String privateKey;
public static volatile String privateKeyPath;
public static Boolean DEBUG = false;
/**
* (FOR TESTING ONLY)
* If you'd like your API requests to hit your own (mocked) server,
* you can set this up here by overriding the base api URL.
*/
public static void overrideApiBase(final String overriddenApiBase) {
apiBase = overriddenApiBase;
}
/**
* (FOR TESTING ONLY)
* Only disable SSL verification if you're using your own (mocked) server.
* Disabling verification on pingxx.com is not supported
*/
public static void setVerifySSL(boolean verify) {
verifySSL = verify;
}
/**
* get SSL state
*
* @return true is set SSL ,false is not set SSL
*/
public static boolean getVerifySSL() {
return verifySSL;
}
/**
* get api url
*
* @return String api url
*/
public static String getApiBase() {
return apiBase;
}
/**
* set api url
*
* @param apiBase
*/
public static void setApiBase(String apiBase) {
Pingpp.apiBase = apiBase;
}
}