-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathGridInfo.java
More file actions
70 lines (54 loc) · 1.42 KB
/
GridInfo.java
File metadata and controls
70 lines (54 loc) · 1.42 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
package com.seleniumgrid2api.api;
import com.google.gson.JsonObject;
import java.net.MalformedURLException;
import java.net.URL;
public class GridInfo {
private URL proxyId;
private String host;
private int port;
private String internalKey;
private String session;
private String inactivityTime;
private String msg;
private String success;
public URL getProxyId() {
return proxyId;
}
public String getHost() {
return host;
}
public int getPort() {
return port;
}
public String getInternalKey() {
return internalKey;
}
public String getSession() {
return session;
}
public String getInactivityTime() {
return inactivityTime;
}
public String getMsg() {
return msg;
}
public String getSuccess() {
return success;
}
public GridInfo(JsonObject object) {
try {
proxyId = new URL(object.get("proxyId").getAsString());
if ((proxyId.getHost() != null) && (proxyId.getPort() != -1)) {
host = proxyId.getHost();
port = proxyId.getPort();
}
internalKey = object.get("internalKey").getAsString();
session = object.get("session").getAsString();
inactivityTime = object.get("inactivityTime").getAsString();
msg = object.get("msg").getAsString();
success = object.get("success").getAsString();
} catch (MalformedURLException e) {
System.out.println("Error Parsing Grid Info.");
}
}
}