use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ChangeWanStateRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception {
Object operationResult = mcs.callOnThis(new ChangeWanStateOperation(schemeName, publisherName, start));
JsonObject result = new JsonObject();
if (operationResult == null) {
result.add("result", SUCCESS);
} else {
result.add("result", operationResult.toString());
}
out.add("result", result);
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ChangeWanStateRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("schemeName", schemeName);
root.add("publisherName", publisherName);
root.add("start", start);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ClearWanQueuesRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception {
ClearWanQueuesOperation operation = new ClearWanQueuesOperation(schemeName, publisherName);
Object operationResult = mcs.callOnThis(operation);
JsonObject result = new JsonObject();
if (operationResult == null) {
result.add("result", SUCCESS);
} else {
result.add("result", operationResult.toString());
}
out.add("result", result);
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ClusterPropsRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject root) throws Exception {
Runtime runtime = Runtime.getRuntime();
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
IPartitionService partitionService = mcs.getHazelcastInstance().node.getPartitionService();
JsonObject properties = new JsonObject();
properties.add("hazelcast.cl_version", mcs.getHazelcastInstance().node.getBuildInfo().getVersion());
properties.add("date.cl_startTime", Long.toString(runtimeMxBean.getStartTime()));
properties.add("seconds.cl_upTime", Long.toString(runtimeMxBean.getUptime()));
properties.add("memory.cl_freeMemory", Long.toString(runtime.freeMemory()));
properties.add("memory.cl_totalMemory", Long.toString(runtime.totalMemory()));
properties.add("memory.cl_maxMemory", Long.toString(runtime.maxMemory()));
properties.add("return.hasOngoingMigration", Boolean.toString(partitionService.hasOnGoingMigration()));
properties.add("data.cl_migrationTasksCount", Long.toString(partitionService.getMigrationQueueSize()));
root.add("result", properties);
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ConsoleCommandRequest method toJson.
@Override
public JsonObject toJson() {
final JsonObject root = new JsonObject();
root.add("command", command);
return root;
}
Aggregations