use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class ConfigUpdateResult method toJson.
public JsonObject toJson() {
JsonObject json = new JsonObject();
JsonArray addedConfigsAsJson = toJsonArray(addedConfigs);
JsonArray ignoredConfigsAsJson = toJsonArray(ignoredConfigs);
json.add("addedConfigs", addedConfigsAsJson);
json.add("ignoredConfigs", ignoredConfigsAsJson);
return json;
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class ConfigUpdateResult method toJsonArray.
private JsonArray toJsonArray(Set<ConfigNamespace> configs) {
JsonArray configsAsJson = new JsonArray();
for (ConfigNamespace ns : configs) {
JsonObject namespaceAsJson = new JsonObject();
namespaceAsJson.add("sectionName", ns.getSectionName());
namespaceAsJson.add("configName", ns.getConfigName());
configsAsJson.add(namespaceAsJson);
}
return configsAsJson;
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class SlowOperationDTO method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("operation", operation);
root.add("stackTrace", stackTrace);
root.add("totalInvocations", totalInvocations);
JsonArray invocationArray = new JsonArray();
for (SlowOperationInvocationDTO invocation : invocations) {
JsonObject json = invocation.toJson();
if (json != null) {
invocationArray.add(json);
}
}
root.add("invocations", invocationArray);
return root;
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class TimedMemberState method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("master", master);
root.add("time", time);
root.add("clusterName", clusterName);
if (memberList != null) {
JsonArray members = new JsonArray();
for (String member : memberList) {
members.add(member);
}
root.add("memberList", members);
}
root.add("memberState", memberState.toJson());
root.add("sslEnabled", sslEnabled);
root.add("lite", lite);
root.add("socketInterceptorEnabled", socketInterceptorEnabled);
root.add("scriptingEnabled", scriptingEnabled);
root.add("consoleEnabled", consoleEnabled);
root.add("mcDataAccessEnabled", mcDataAccessEnabled);
return root;
}
use of com.hazelcast.internal.json.JsonArray in project hazelcast by hazelcast.
the class TimedMemberState method fromJson.
@Override
public void fromJson(JsonObject json) {
time = getLong(json, "time");
master = getBoolean(json, "master");
clusterName = getString(json, "clusterName");
JsonArray jsonMemberList = getArray(json, "memberList");
memberList = new ArrayList<String>(jsonMemberList.size());
for (JsonValue member : jsonMemberList.values()) {
memberList.add(member.asString());
}
JsonObject jsonMemberState = getObject(json, "memberState");
memberState = new MemberStateImpl();
memberState.fromJson(jsonMemberState);
sslEnabled = getBoolean(json, "sslEnabled", false);
lite = getBoolean(json, "lite");
socketInterceptorEnabled = getBoolean(json, "socketInterceptorEnabled");
scriptingEnabled = getBoolean(json, "scriptingEnabled");
consoleEnabled = getBoolean(json, "consoleEnabled");
mcDataAccessEnabled = getBoolean(json, "mcDataAccessEnabled");
}
Aggregations