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;
}
use of com.eclipsesource.json.JsonObject 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.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class WanPublisherConfigDTO method toJson.
@Override
public JsonObject toJson() {
JsonObject object = new JsonObject();
object.add("groupName", config.getGroupName());
object.add("queueCapacity", config.getQueueCapacity());
object.add("className", config.getClassName());
object.add("queueFullBehavior", config.getQueueFullBehavior().getId());
JsonObject properties = new JsonObject();
for (Map.Entry<String, Comparable> property : config.getProperties().entrySet()) {
properties.add(property.getKey(), Json.value(property.getValue().toString()));
}
object.add("properties", properties);
return object;
}
Aggregations