@Override public void fromJson(JsonObject json) { final JsonArray jsonPartitions = getArray(json, "partitions"); for (JsonValue jsonPartition : jsonPartitions) { partitions.add(jsonPartition.asInt()); } memberStateSafe = getBoolean(json, "memberStateSafe"); migrationQueueSize = getInt(json, "migrationQueueSize"); }
@Override public void fromJson(JsonObject json) { creationTime = getLong(json, "creationTime", -1L); lastAccessTime = getLong(json, "lastAccessTime", -1L); lastUpdateTime = getLong(json, "lastUpdateTime", -1L); ownedEntryCount = getLong(json, "ownedEntryCount", -1L); cacheHits = getLong(json, "cacheHits", -1L); cacheHitPercentage = getFloat(json, "cacheHitPercentage", -1f); cacheMisses = getLong(json, "cacheMisses", -1L); cacheMissPercentage = getFloat(json, "cacheMissPercentage", -1f); cacheGets = getLong(json, "cacheGets", -1L); cachePuts = getLong(json, "cachePuts", -1L); cacheRemovals = getLong(json, "cacheRemovals", -1L); cacheEvictions = getLong(json, "cacheEvictions", -1L); averageGetTime = getFloat(json, "averageGetTime", -1f); averagePutTime = getFloat(json, "averagePutTime", -1f); averageRemoveTime = getFloat(json, "averageRemoveTime", -1f); }
@Override public void fromJson(JsonObject json) { creationTime = getLong(json, JSON_CREATION_TIME, -1L); totalPhysical = getLong(json, JSON_TOTAL_PHYSICAL, -1L); freePhysical = getLong(json, JSON_FREE_PHYSICAL, -1L); maxNativeMemory = getLong(json, JSON_MAX_NATIVE_MEMORY, -1L); committedNativeMemory = getLong(json, JSON_COMMITTED_NATIVE_MEMORY, -1L); usedNativeMemory = getLong(json, JSON_USED_NATIVE_MEMORY, -1L); freeNativeMemory = getLong(json, JSON_FREE_NATIVE_MEMORY, -1L); maxHeap = getLong(json, JSON_MAX_HEAP, -1L); committedHeap = getLong(json, JSON_COMMITTED_HEAP, -1L); usedHeap = getLong(json, JSON_USED_HEAP, -1L); gcStats = new LocalGCStatsImpl(); if (json.get(JSON_GC_STATS) != null) { gcStats.fromJson(getObject(json, JSON_GC_STATS)); } }
@Override public void fromJson(JsonObject json) { name = getString(json, "name"); queueSize = getInt(json, "queueSize"); poolSize = getInt(json, "poolSize"); remainingQueueCapacity = getInt(json, "remainingQueueCapacity"); maximumPoolSize = getInt(json, "maximumPoolSize"); isTerminated = getBoolean(json, "isTerminated"); completedTaskCount = getLong(json, "completedTaskCount"); } }
@Override public void fromJson(JsonObject json) { responseQueueSize = getInt(json, "responseQueueSize", -1); operationExecutorQueueSize = getInt(json, "operationExecutorQueueSize", -1); runningOperationsCount = getInt(json, "runningOperationsCount", -1); remoteOperationCount = getInt(json, "remoteOperationCount", -1); executedOperationCount = getLong(json, "executedOperationCount", -1L); operationThreadCount = getLong(json, "operationThreadCount", -1L); } }
@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"); }
@Override public void fromJson(JsonObject json) { mapName = getString(json, "mapName"); update = getBoolean(json, "update"); config = new MapConfigDTO(); config.fromJson(getObject(json, "config")); } }
@Override public void fromJson(JsonObject json) { final String jsonBackupTaskState = getString(json, "backupTaskState", null); final int jsonBackupTaskCompleted = getInt(json, "backupTaskCompleted", 0); final int jsonBackupTaskTotal = getInt(json, "backupTaskTotal", 0); backupTaskStatus = jsonBackupTaskState != null ? new BackupTaskStatus(BackupTaskState.valueOf(jsonBackupTaskState), jsonBackupTaskCompleted, jsonBackupTaskTotal) : null; isHotBackupEnabled = getBoolean(json, "isHotBackupEnabled", false); backupDirectory = getString(json, "backupDirectory", null); }
@Override public void fromJson(JsonObject json) { operation = getString(json, "operation"); stackTrace = getString(json, "stackTrace"); totalInvocations = getInt(json, "totalInvocations"); invocations = new ArrayList<SlowOperationInvocationDTO>(); for (JsonValue jsonValue : getArray(json, "invocations")) { SlowOperationInvocationDTO slowOperationInvocationDTO = new SlowOperationInvocationDTO(); slowOperationInvocationDTO.fromJson(jsonValue.asObject()); invocations.add(slowOperationInvocationDTO); } } }
@Override public void fromJson(JsonObject json) { getCount = getLong(json, "getCount", -1L); putCount = getLong(json, "putCount", -1L); removeCount = getLong(json, "removeCount", -1L); numberOfOtherOperations = getLong(json, "numberOfOtherOperations", -1L); numberOfEvents = getLong(json, "numberOfEvents", -1L); lastAccessTime = getLong(json, "lastAccessTime", -1L); lastUpdateTime = getLong(json, "lastUpdateTime", -1L); totalGetLatenciesNanos = MILLISECONDS.toNanos(getLong(json, "totalGetLatencies", -1L)); totalPutLatenciesNanos = MILLISECONDS.toNanos(getLong(json, "totalPutLatencies", -1L)); totalRemoveLatenciesNanos = MILLISECONDS.toNanos(getLong(json, "totalRemoveLatencies", -1L)); maxGetLatency = MILLISECONDS.toNanos(getLong(json, "maxGetLatency", -1L)); maxPutLatency = MILLISECONDS.toNanos(getLong(json, "maxPutLatency", -1L)); maxRemoveLatency = MILLISECONDS.toNanos(getLong(json, "maxRemoveLatency", -1L)); hits = getLong(json, "hits", -1L); ownedEntryCount = getLong(json, "ownedEntryCount", -1L); backupEntryCount = getLong(json, "backupEntryCount", -1L); backupCount = getInt(json, "backupCount", -1); ownedEntryMemoryCost = getLong(json, "ownedEntryMemoryCost", -1L); backupEntryMemoryCost = getLong(json, "backupEntryMemoryCost", -1L); creationTime = getLong(json, "creationTime", -1L); lockedEntryCount = getLong(json, "lockedEntryCount", -1L); dirtyEntryCount = getLong(json, "dirtyEntryCount", -1L); heapCost = getLong(json, "heapCost", -1L); merkleTreesCost = getLong(json, "merkleTreesCost", -1L); JsonValue jsonNearCacheStats = json.get("nearCacheStats"); if (jsonNearCacheStats != null) {
@Override @SuppressWarnings("checkstyle:methodlength") public void fromJson(JsonObject json) { address = getString(json, "address"); for (JsonObject.Member next : getObject(json, "mapStats")) { LocalMapStatsImpl stats = new LocalMapStatsImpl(); stats.fromJson(next.getValue().asObject()); mapStats.put(next.getName(), stats); for (JsonObject.Member next : getObject(json, "multiMapStats")) { LocalMultiMapStatsImpl stats = new LocalMultiMapStatsImpl(); stats.fromJson(next.getValue().asObject()); multiMapStats.put(next.getName(), stats); for (JsonObject.Member next : getObject(json, "replicatedMapStats", new JsonObject())) { LocalReplicatedMapStats stats = new LocalReplicatedMapStatsImpl(); stats.fromJson(next.getValue().asObject()); replicatedMapStats.put(next.getName(), stats); for (JsonObject.Member next : getObject(json, "queueStats")) { LocalQueueStatsImpl stats = new LocalQueueStatsImpl(); stats.fromJson(next.getValue().asObject()); queueStats.put(next.getName(), stats); for (JsonObject.Member next : getObject(json, "topicStats")) { LocalTopicStatsImpl stats = new LocalTopicStatsImpl(); stats.fromJson(next.getValue().asObject()); topicStats.put(next.getName(), stats); for (JsonObject.Member next : getObject(json, "reliableTopicStats")) {
/** * Returns a field in a Json object as a string. * Throws IllegalArgumentException if the field value is null. * * @param object the Json Object * @param field the field in the Json object to return * @return the Json field value as a string */ public static String getString(JsonObject object, String field) { final JsonValue value = object.get(field); throwExceptionIfNull(value, field); return value.asString(); }
@Override public void fromJson(JsonObject json) { state = getString(json, "state"); } }
@Override public void fromJson(JsonObject json) { creationTime = getLong(json, "creationTime", -1L); value = getLong(json, "value", -1L); totalIncrementOperationCount = getLong(json, "totalIncrementOperationCount", -1L); totalDecrementOperationCount = getLong(json, "totalDecrementOperationCount", -1L); }
@Override public void fromJson(JsonObject json) { maxVisibleSlowOperationCount = getLong(json, "maxVisibleSlowOperationCount", Long.MAX_VALUE); for (JsonValue jsonValue : getArray(json, "slowOperations")) { SlowOperationDTO slowOperationDTO = new SlowOperationDTO(); slowOperationDTO.fromJson(jsonValue.asObject()); slowOperations.add(slowOperationDTO); } creationTime = getLong(json, "creationTime", -1L); }
@Override public void fromJson(JsonObject json) { script = getString(json, "script", ""); engine = getString(json, "engine", ""); final JsonArray array = getArray(json, "targets", new JsonArray()); targets = createHashSet(array.size()); for (JsonValue target : array) { targets.add(target.asString()); } }
@Override public void fromJson(JsonObject json) { ownedEntryCount = getLong(json, "ownedEntryCount", -1L); ownedEntryMemoryCost = getLong(json, "ownedEntryMemoryCost", -1L); creationTime = getLong(json, "creationTime", -1L); hits = getLong(json, "hits", -1L); misses = getLong(json, "misses", -1L); evictions = getLong(json, "evictions", -1L); expirations = getLong(json, "expirations", -1L); invalidations = getLong(json, "invalidations", -1L); invalidationRequests = getLong(json, "invalidationEvents", -1L); persistenceCount = getLong(json, "persistenceCount", -1L); lastPersistenceTime = getLong(json, "lastPersistenceTime", -1L); lastPersistenceDuration = getLong(json, "lastPersistenceDuration", -1L); lastPersistenceWrittenBytes = getLong(json, "lastPersistenceWrittenBytes", -1L); lastPersistenceKeyCount = getLong(json, "lastPersistenceKeyCount", -1L); lastPersistenceFailure = getString(json, "lastPersistenceFailure", ""); }
JsonObject request = JsonValue.readFrom(reader).asObject(); if (!request.isEmpty()) { JsonObject innerRequest = getObject(request, "request"); final int type = getInt(innerRequest, "type"); final int taskId = getInt(request, "taskId"); task.fromJson(getObject(innerRequest, "request")); boolean success; if (task instanceof AsyncConsoleRequest) {