@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(ConnectivityCommandResponse.JsonFields.JSON_CONNECTION_ID, connectionId, predicate); jsonObjectBuilder.set(JSON_CONNECTION_STATUS, connectionStatus.getName(), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(ConnectivityCommandResponse.JsonFields.JSON_CONNECTION_ID, connectionId, predicate); jsonObjectBuilder.set(JSON_CONNECTION_STATUS, connectionStatus.getName(), predicate); }
@Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder(); jsonObjectBuilder.set(JsonFields.CONNECTION_STATUS, connectionStatus.getName(), predicate); if (connectionStatusDetails != null) { jsonObjectBuilder.set(JsonFields.CONNECTION_STATUS_DETAILS, connectionStatusDetails, predicate); } jsonObjectBuilder.set(JsonFields.IN_CONNECTION_STATUS_SINCE, inConnectionStatusSince.toString(), predicate); jsonObjectBuilder.set(JsonFields.CLIENT_STATE, clientState, predicate); jsonObjectBuilder.set(JsonFields.SOURCES_METRICS, sourcesMetrics.stream() .map(SourceMetrics::toJson) .collect(JsonCollectors.valuesToArray()), predicate); jsonObjectBuilder.set(JsonFields.TARGETS_METRICS, targetsMetrics.stream() .map(TargetMetrics::toJson) .collect(JsonCollectors.valuesToArray()), predicate); return jsonObjectBuilder.build(); }
@Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder(); jsonObjectBuilder.set(JsonFields.CONNECTION_STATUS, connectionStatus.getName(), predicate); if (connectionStatusDetails != null) { jsonObjectBuilder.set(JsonFields.CONNECTION_STATUS_DETAILS, connectionStatusDetails, predicate); } jsonObjectBuilder.set(JsonFields.IN_CONNECTION_STATUS_SINCE, inConnectionStatusSince.toString(), predicate); jsonObjectBuilder.set(JsonFields.CLIENT_STATE, clientState, predicate); jsonObjectBuilder.set(JsonFields.SOURCES_METRICS, sourcesMetrics.stream() .map(SourceMetrics::toJson) .collect(JsonCollectors.valuesToArray()), predicate); jsonObjectBuilder.set(JsonFields.TARGETS_METRICS, targetsMetrics.stream() .map(TargetMetrics::toJson) .collect(JsonCollectors.valuesToArray()), predicate); return jsonObjectBuilder.build(); }
@Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder(); jsonObjectBuilder.set(JsonFields.SCHEMA_VERSION, schemaVersion.toInt(), predicate); jsonObjectBuilder.set(JsonFields.STATUS, status.getName(), predicate); if (statusDetails != null) { jsonObjectBuilder.set(JsonFields.STATUS_DETAILS, statusDetails, predicate); } jsonObjectBuilder.set(JsonFields.MESSAGE_COUNT, messageCount, predicate); if (lastMessageAt != null) { jsonObjectBuilder.set(JsonFields.LAST_MESSAGE_AT, lastMessageAt.toString(), predicate); } return jsonObjectBuilder.build(); }
jsonObjectBuilder.set(JsonFields.NAME, name, predicate); jsonObjectBuilder.set(JsonFields.CONNECTION_TYPE, connectionType.getName(), predicate); jsonObjectBuilder.set(JsonFields.CONNECTION_STATUS, connectionStatus.getName(), predicate); jsonObjectBuilder.set(JsonFields.URI, uri.toString(), predicate); jsonObjectBuilder.set(JsonFields.SOURCES, sources.stream()
jsonObjectBuilder.set(JsonFields.NAME, name, predicate); jsonObjectBuilder.set(JsonFields.CONNECTION_TYPE, connectionType.getName(), predicate); jsonObjectBuilder.set(JsonFields.CONNECTION_STATUS, connectionStatus.getName(), predicate); jsonObjectBuilder.set(JsonFields.URI, uri.toString(), predicate); jsonObjectBuilder.set(JsonFields.SOURCES, sources.stream()
@Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); final JsonObjectBuilder jsonObjectBuilder = JsonFactory.newObjectBuilder(); jsonObjectBuilder.set(JsonFields.SCHEMA_VERSION, schemaVersion.toInt(), predicate); jsonObjectBuilder.set(JsonFields.STATUS, status.getName(), predicate); if (statusDetails != null) { jsonObjectBuilder.set(JsonFields.STATUS_DETAILS, statusDetails, predicate); } jsonObjectBuilder.set(JsonFields.MESSAGE_COUNT, messageCount, predicate); if (lastMessageAt != null) { jsonObjectBuilder.set(JsonFields.LAST_MESSAGE_AT, lastMessageAt.toString(), predicate); } return jsonObjectBuilder.build(); }
log.debug("Connection <{}> has status <{}> and will therefore be opened.", connection.getId(), connection.getConnectionStatus().getName()); final OpenConnection openConnection = OpenConnection.of(connectionId, command.getDittoHeaders()); askClientActor(openConnection, log.debug("Connection <{}> has status <{}> and will therefore stay closed.", connection.getId(), connection.getConnectionStatus().getName()); respondWithCreateConnectionResponse(connection, command, origin);
log.debug("Connection <{}> has status <{}> and will therefore be opened.", connection.getId(), connection.getConnectionStatus().getName()); final OpenConnection openConnection = OpenConnection.of(connectionId, command.getDittoHeaders()); askClientActor(openConnection, log.debug("Connection <{}> has status <{}> and will therefore stay closed.", connection.getId(), connection.getConnectionStatus().getName()); respondWithCreateConnectionResponse(connection, command, origin);