use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class EvictionConfigDTO method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject().add("size", evictionConfig.getSize()).add("maxSizePolicy", evictionConfig.getMaxSizePolicy().toString()).add("evictionPolicy", evictionConfig.getEvictionPolicy().toString());
String comparatorClassName = evictionConfig.getComparatorClassName();
if (!isNullOrEmpty(comparatorClassName)) {
root.add("comparatorClassName", comparatorClassName);
}
return root;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class PermissionConfigDTO method toJson.
@Override
public JsonObject toJson() {
JsonObject object = new JsonObject();
object.add("permissionType", permissionConfig.getType().getNodeName());
object.add("name", permissionConfig.getName());
if (StringUtil.isNullOrEmptyAfterTrim(permissionConfig.getPrincipal())) {
object.add("principal", "*");
} else {
object.add("principal", permissionConfig.getPrincipal());
}
Set<String> endpoints = permissionConfig.getEndpoints();
if (endpoints != null) {
JsonArray endpointsArray = new JsonArray();
for (String endpoint : endpoints) {
endpointsArray.add(endpoint);
}
object.add("endpoints", endpointsArray);
}
Set<String> actions = permissionConfig.getActions();
if (actions != null) {
JsonArray actionsArray = new JsonArray();
for (String action : actions) {
actionsArray.add(action);
}
object.add("actions", actionsArray);
}
return object;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class SlowOperationInvocationDTO method toJson.
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("id", id);
root.add("details", operationDetails);
root.add("startedAt", startedAt);
root.add("durationMs", durationMs);
return root;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class AbstractWanAntiEntropyEventBase method toJson.
@Override
public JsonObject toJson() {
JsonObject json = super.toJson();
json.add("wanReplicationName", wanReplicationName);
json.add("wanPublisherId", wanPublisherId);
json.add("mapName", mapName);
return json;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class ConfigUpdateFailedEvent method toJson.
@Override
public JsonObject toJson() {
JsonObject json = super.toJson();
json.add("failureReason", failureReason.toString());
json.add("exception", exception.getClass().getSimpleName());
json.add("exceptionMessage", exception.getMessage());
json.add("configUpdateResult", configUpdateResult.toJson());
if (namespace != null) {
json.add("configName", namespace.getConfigName() != null ? namespace.getConfigName() : "null");
json.add("sectionName", namespace.getSectionName());
}
return json;
}
Aggregations