Search in sources :

Example 1 with JsonObject

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

the class ManagementCenterIdentifier method toJson.

@Override
public JsonObject toJson() {
    JsonObject root = new JsonObject();
    root.add("version", version);
    root.add("clusterName", clusterName);
    root.add("address", address);
    return root;
}
Also used : JsonObject(com.eclipsesource.json.JsonObject)

Example 2 with JsonObject

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

the class MemberConfigRequest method writeResponse.

@Override
public void writeResponse(ManagementCenterService mcs, JsonObject root) {
    final JsonObject result = new JsonObject();
    ConfigXmlGenerator configXmlGenerator = new ConfigXmlGenerator(true);
    Config config = mcs.getHazelcastInstance().getConfig();
    String configXmlString = configXmlGenerator.generate(config);
    result.add("configXmlString", configXmlString);
    root.add("result", result);
}
Also used : Config(com.hazelcast.config.Config) JsonObject(com.eclipsesource.json.JsonObject) ConfigXmlGenerator(com.hazelcast.config.ConfigXmlGenerator)

Example 3 with JsonObject

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

the class RunGcRequest method writeResponse.

@Override
@SuppressFBWarnings(value = "DM_GC", justification = "Explicit GC is the point of this class")
public void writeResponse(ManagementCenterService mcs, JsonObject root) throws Exception {
    System.gc();
    root.add("result", new JsonObject());
}
Also used : JsonObject(com.eclipsesource.json.JsonObject) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Example 4 with JsonObject

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

the class ShutdownClusterRequest method writeResponse.

@Override
public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception {
    String resultString = "SUCCESS";
    try {
        mcs.getHazelcastInstance().getCluster().shutdown();
    } catch (Exception e) {
        ILogger logger = mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass());
        logger.warning("Cluster can not be shutdown: ", e);
        resultString = e.getMessage();
    }
    JsonObject result = new JsonObject().add("result", resultString);
    out.add("result", result);
}
Also used : JsonObject(com.eclipsesource.json.JsonObject) ILogger(com.hazelcast.logging.ILogger) JsonUtil.getString(com.hazelcast.util.JsonUtil.getString) IOException(java.io.IOException)

Example 5 with JsonObject

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

the class ThreadDumpRequest method toJson.

@Override
public JsonObject toJson() {
    final JsonObject root = new JsonObject();
    root.add("dumpDeadlocks", dumpDeadlocks);
    return root;
}
Also used : JsonObject(com.eclipsesource.json.JsonObject)

Aggregations

JsonObject (com.eclipsesource.json.JsonObject)499 Test (org.junit.Test)157 URL (java.net.URL)145 JsonArray (com.eclipsesource.json.JsonArray)96 JsonValue (com.eclipsesource.json.JsonValue)43 ParallelTest (com.hazelcast.test.annotation.ParallelTest)36 QuickTest (com.hazelcast.test.annotation.QuickTest)36 ArrayList (java.util.ArrayList)33 HashMap (java.util.HashMap)28 IOException (java.io.IOException)17 Map (java.util.Map)17 Matchers.containsString (org.hamcrest.Matchers.containsString)17 Date (java.util.Date)13 JsonUtil.getString (com.hazelcast.util.JsonUtil.getString)12 MalformedURLException (java.net.MalformedURLException)11 WalletCallException (com.vaklinov.zcashui.ZCashClientCaller.WalletCallException)7 URISyntaxException (java.net.URISyntaxException)6 ExecuteScriptRequest (com.hazelcast.internal.management.request.ExecuteScriptRequest)5 Link (org.eclipse.leshan.Link)5 Jedis (redis.clients.jedis.Jedis)5