}
@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);
}