use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class GetMapEntryRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject root) throws Exception {
IMap map = mcs.getHazelcastInstance().getMap(mapName);
JsonObject result = new JsonObject();
EntryView entry = null;
if (type.equals("string")) {
entry = map.getEntryView(key);
} else if (type.equals("long")) {
entry = map.getEntryView(Long.valueOf(key));
} else if (type.equals("integer")) {
entry = map.getEntryView(Integer.valueOf(key));
}
if (entry != null) {
Object value = entry.getValue();
result.add("browse_value", value != null ? value.toString() : "null");
result.add("browse_class", value != null ? value.getClass().getName() : "null");
result.add("memory_cost", Long.toString(entry.getCost()));
result.add("date_creation_time", Long.toString(entry.getCreationTime()));
result.add("date_expiration_time", Long.toString(entry.getExpirationTime()));
result.add("browse_hits", Long.toString(entry.getHits()));
result.add("date_access_time", Long.toString(entry.getLastAccessTime()));
result.add("date_update_time", Long.toString(entry.getLastUpdateTime()));
result.add("browse_version", Long.toString(entry.getVersion()));
}
root.add("result", result);
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class GetMapEntryRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("mapName", mapName);
root.add("type", type);
root.add("key", key);
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class GetMemberSystemPropertiesRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject root) {
Properties properties = System.getProperties();
JsonObject result = new JsonObject();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
result.add(entry.getKey().toString(), entry.getValue().toString());
}
root.add("result", result);
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class MapConfigRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("mapName", mapName);
root.add("update", update);
root.add("config", config.toJson());
return root;
}
use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class ChangeClusterStateRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("state", state);
return root;
}
Aggregations