Search in sources :

Example 16 with JsonObject

use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.

the class AbstractWanConfigurationEventBase method toJson.

public JsonObject toJson() {
    JsonObject json = super.toJson();
    json.add("wanConfigName", wanConfigName);
    return json;
}
Also used : JsonObject(com.hazelcast.internal.json.JsonObject)

Example 17 with JsonObject

use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.

the class AbstractWanSyncFinishedEvent method toJson.

@Override
public JsonObject toJson() {
    JsonObject json = super.toJson();
    json.add("durationSecs", durationSecs);
    json.add("partitionsSynced", partitionsSynced);
    json.add("recordsSynced", recordsSynced);
    return json;
}
Also used : JsonObject(com.hazelcast.internal.json.JsonObject)

Example 18 with JsonObject

use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.

the class ConfigUpdateFinishedEvent method toJson.

@Override
public JsonObject toJson() {
    JsonObject json = super.toJson();
    json.add("configUpdateResult", configUpdateResult.toJson());
    return json;
}
Also used : JsonObject(com.hazelcast.internal.json.JsonObject)

Example 19 with JsonObject

use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.

the class EventBatch method toJson.

public JsonObject toJson() {
    JsonObject json = new JsonObject();
    json.add("cluster", cluster);
    json.add("address", address);
    JsonArray eventJsonArray = new JsonArray();
    for (Event event : events) {
        JsonObject metadataJson = new JsonObject();
        metadataJson.add("type", event.getType().getCode());
        metadataJson.add("timestamp", event.getTimestamp());
        JsonObject eventJson = new JsonObject();
        eventJson.add("metadata", metadataJson);
        eventJson.add("data", event.toJson());
        eventJsonArray.add(eventJson);
    }
    json.add("events", eventJsonArray);
    return json;
}
Also used : JsonArray(com.hazelcast.internal.json.JsonArray) JsonObject(com.hazelcast.internal.json.JsonObject)

Example 20 with JsonObject

use of com.hazelcast.internal.json.JsonObject in project hazelcast by hazelcast.

the class WanAddConfigurationIgnoredEvent method toJson.

@Override
public JsonObject toJson() {
    JsonObject json = super.toJson();
    json.add("reason", reason);
    return json;
}
Also used : JsonObject(com.hazelcast.internal.json.JsonObject)

Aggregations

JsonObject (com.hazelcast.internal.json.JsonObject)151 Test (org.junit.Test)56 JsonArray (com.hazelcast.internal.json.JsonArray)41 QuickTest (com.hazelcast.test.annotation.QuickTest)38 JsonValue (com.hazelcast.internal.json.JsonValue)34 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)26 HazelcastJsonValue (com.hazelcast.core.HazelcastJsonValue)23 HazelcastInstance (com.hazelcast.core.HazelcastInstance)11 JsonUtil.getString (com.hazelcast.internal.util.JsonUtil.getString)10 SlowTest (com.hazelcast.test.annotation.SlowTest)9 HashMap (java.util.HashMap)8 CPMember (com.hazelcast.cp.CPMember)7 ArrayList (java.util.ArrayList)7 ConnectionResponse (com.hazelcast.internal.ascii.HTTPCommunicator.ConnectionResponse)6 NavigableJsonInputAdapter (com.hazelcast.internal.serialization.impl.NavigableJsonInputAdapter)6 JsonUtil.fromJsonObject (com.hazelcast.internal.util.JsonUtil.fromJsonObject)5 JsonUtil.toJsonObject (com.hazelcast.internal.util.JsonUtil.toJsonObject)5 Map (java.util.Map)5 ClusterService (com.hazelcast.internal.cluster.ClusterService)4 Address (com.hazelcast.cluster.Address)3