/** * Connects to a Hono Service component using the configured client. * * @param client The Hono client for the service that is to be connected. * @param serviceName The name of the service that is to be connected (used for logging). * @return A future that will succeed once the connection has been established. The future will fail if the * connection cannot be established. * @throws NullPointerException if serviceName is {@code null}. * @throws IllegalArgumentException if client is {@code null}. */ protected final Future<HonoClient> connectToService(final HonoClient client, final String serviceName) { return connectToService(client, serviceName, onConnect -> {}, onConnectionLost -> {}); }
/** * Connects to a Hono Service component using the configured client. * * @param client The Hono client for the service that is to be connected. * @param serviceName The name of the service that is to be connected (used for logging). * @return A future that will succeed once the connection has been established. The future will fail if the * connection cannot be established. * @throws NullPointerException if serviceName is {@code null}. * @throws IllegalArgumentException if client is {@code null}. */ protected final Future<HonoClient> connectToService(final HonoClient client, final String serviceName) { return connectToService(client, serviceName, onConnect -> {}, onConnectionLost -> {}); }
result.fail(new IllegalStateException("Command & Control service client must be set")); } else { connectToService(tenantServiceClient, "Tenant service"); connectToService(messagingClient, "AMQP Messaging Network"); connectToService(registrationServiceClient, "Device Registration service"); connectToService(credentialsServiceClient, "Credentials service"); connectToService( commandConnection, "Command and Control service",
result.fail(new IllegalStateException("Command & Control service client must be set")); } else { connectToService(tenantServiceClient, "Tenant service"); connectToService(messagingClient, "AMQP Messaging Network"); connectToService(registrationServiceClient, "Device Registration service"); connectToService(credentialsServiceClient, "Credentials service"); connectToService( commandConnection, "Command and Control service",