use of org.openremote.model.gateway.GatewayConnection in project openremote by openremote.
the class GatewayClientService method configure.
@Override
public void configure() throws Exception {
from(PERSISTENCE_TOPIC).routeId("GatewayServiceConnectionChanges").filter(isPersistenceEventForEntityType(GatewayConnection.class)).process(exchange -> {
@SuppressWarnings("unchecked") PersistenceEvent<GatewayConnection> persistenceEvent = exchange.getIn().getBody(PersistenceEvent.class);
GatewayConnection connection = persistenceEvent.getEntity();
processConnectionChange(connection, persistenceEvent.getCause());
});
}
use of org.openremote.model.gateway.GatewayConnection in project openremote by openremote.
the class GatewayClientService method getConnectionStatus.
protected ConnectionStatus getConnectionStatus(String realm) {
GatewayConnection connection = connectionRealmMap.get(realm);
if (connection == null) {
return null;
}
if (connection.isDisabled()) {
return ConnectionStatus.DISABLED;
}
WebsocketIOClient<String> client = clientRealmMap.get(realm);
return client != null ? client.getConnectionStatus() : null;
}
Aggregations