use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class KubernetesClient method parsePodsList.
private static List<Endpoint> parsePodsList(JsonObject podsListJson) {
List<Endpoint> addresses = new ArrayList<>();
for (JsonValue item : toJsonArray(podsListJson.get("items"))) {
JsonObject status = item.asObject().get("status").asObject();
String ip = toString(status.get("podIP"));
if (ip != null) {
Integer port = extractContainerPort(item);
addresses.add(new Endpoint(new EndpointAddress(ip, port), isReady(status)));
}
}
return addresses;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class WanSyncProgressUpdateEvent method toJson.
@Override
public JsonObject toJson() {
JsonObject json = super.toJson();
json.add("partitionsToSync", partitionsToSync);
json.add("partitionsSynced", partitionsSynced);
json.add("recordsSynced", recordsSynced);
return json;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class ClientEndPointDTO method toJson.
@Override
public JsonObject toJson() {
final JsonObject root = Json.object();
root.add("uuid", uuid.toString());
root.add("address", address);
root.add("clientType", clientType);
root.add("name", name);
JsonArray labelsObject = Json.array();
for (String label : labels) {
labelsObject.add(label);
}
root.add("labels", labelsObject);
root.add("ipAddress", ipAddress);
root.add("canonicalHostName", canonicalHostName);
return root;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class CustomWanPublisherConfigDTO method toJson.
@Override
@SuppressWarnings({ "checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity" })
public JsonObject toJson() {
JsonObject root = new JsonObject();
root.add("publisherId", config.getPublisherId());
root.add("className", config.getClassName());
if (!isNullOrEmpty(config.getProperties())) {
root.add("properties", toJsonObject(config.getProperties()));
}
return root;
}
use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.
the class WanReplicationConfigDTO method toJson.
@Override
public JsonObject toJson() {
JsonObject root = new JsonObject();
if (config.getName() != null) {
root.add("name", config.getName());
}
JsonArray batchPublishers = new JsonArray();
JsonArray customPublishers = new JsonArray();
for (WanBatchPublisherConfig publisherConfig : config.getBatchPublisherConfigs()) {
batchPublishers.add(new WanBatchPublisherConfigDTO(publisherConfig).toJson());
}
for (WanCustomPublisherConfig publisherConfig : config.getCustomPublisherConfigs()) {
customPublishers.add(new CustomWanPublisherConfigDTO(publisherConfig).toJson());
}
root.add("batchPublishers", batchPublishers);
root.add("customPublishers", customPublishers);
WanConsumerConfig consumerConfig = config.getConsumerConfig();
if (consumerConfig != null) {
root.add("consumer", new WanConsumerConfigDTO(consumerConfig).toJson());
}
return root;
}
Aggregations