use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class TimedMemberState method fromJson.
@Override
public void fromJson(JsonObject json) {
time = getLong(json, "time");
master = getBoolean(json, "master");
clusterName = getString(json, "clusterName");
JsonArray jsonMemberList = getArray(json, "memberList");
memberList = new ArrayList<String>(jsonMemberList.size());
for (JsonValue member : jsonMemberList.values()) {
memberList.add(member.asString());
}
JsonObject jsonMemberState = getObject(json, "memberState");
memberState = new MemberStateImpl();
memberState.fromJson(jsonMemberState);
sslEnabled = getBoolean(json, "sslEnabled", false);
lite = getBoolean(json, "lite");
socketInterceptorEnabled = getBoolean(json, "socketInterceptorEnabled");
scriptingEnabled = getBoolean(json, "scriptingEnabled");
consoleEnabled = getBoolean(json, "consoleEnabled");
mcDataAccessEnabled = getBoolean(json, "mcDataAccessEnabled");
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class DiscoveryStrategyConfigDTO method fromJson.
@Override
public void fromJson(JsonObject json) {
config = new DiscoveryStrategyConfig();
JsonValue className = json.get("className");
if (className != null && !className.isNull()) {
config.setClassName(className.asString());
}
config.setProperties(fromJsonObject((JsonObject) json.get("properties")));
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class ClusterHotRestartStatusDTO method fromJson.
@Override
public void fromJson(JsonObject root) {
String dataRecoveryPolicyStr = root.getString("dataRecoveryPolicy", FULL_RECOVERY_ONLY.toString());
dataRecoveryPolicy = HotRestartClusterDataRecoveryPolicy.valueOf(dataRecoveryPolicyStr);
String hotRestartStatusStr = root.getString("hotRestartStatus", ClusterHotRestartStatus.UNKNOWN.toString());
hotRestartStatus = ClusterHotRestartStatus.valueOf(hotRestartStatusStr);
remainingValidationTimeMillis = root.getLong("remainingValidationTimeMillis", -1);
remainingDataLoadTimeMillis = root.getLong("remainingDataLoadTimeMillis", -1);
JsonArray memberStatuses = (JsonArray) root.get("memberHotRestartStatuses");
memberHotRestartStatusMap = createHashMap(memberStatuses.size());
for (JsonValue value : memberStatuses) {
JsonObject memberStatus = (JsonObject) value;
String member = memberStatus.getString("member", "<unknown>");
MemberHotRestartStatus status = MemberHotRestartStatus.valueOf(memberStatus.getString("status", MemberHotRestartStatus.PENDING.toString()));
memberHotRestartStatusMap.put(member, status);
}
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class DiscoveryConfigDTO method fromJson.
@Override
public void fromJson(JsonObject json) {
config = new DiscoveryConfig();
JsonValue nodeFilterClass = json.get("nodeFilterClass");
if (nodeFilterClass != null && !nodeFilterClass.isNull()) {
config.setNodeFilterClass(nodeFilterClass.asString());
}
JsonValue discoveryStrategies = json.get("discoveryStrategy");
if (discoveryStrategies != null && !discoveryStrategies.isNull()) {
Collection<DiscoveryStrategyConfig> strategyConfigs = config.getDiscoveryStrategyConfigs();
for (JsonValue strategy : discoveryStrategies.asArray()) {
DiscoveryStrategyConfigDTO strategyDTO = new DiscoveryStrategyConfigDTO();
strategyDTO.fromJson(strategy.asObject());
strategyConfigs.add(strategyDTO.getConfig());
}
}
}
use of com.hazelcast.internal.json.JsonValue in project hazelcast by hazelcast.
the class EvictionConfigDTO method fromJson.
@Override
public void fromJson(JsonObject json) {
evictionConfig = new EvictionConfig();
evictionConfig.setSize(getInt(json, "size"));
evictionConfig.setMaxSizePolicy(MaxSizePolicy.valueOf(getString(json, "maxSizePolicy")));
evictionConfig.setEvictionPolicy(EvictionPolicy.valueOf(getString(json, "evictionPolicy")));
JsonValue comparatorClassName = json.get("comparatorClassName");
if (comparatorClassName != null && !comparatorClassName.isNull()) {
evictionConfig.setComparatorClassName(comparatorClassName.asString());
}
}
Aggregations