Search in sources :

Example 1 with GatewayConnection

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());
    });
}
Also used : GatewayConnection(org.openremote.model.gateway.GatewayConnection)

Example 2 with GatewayConnection

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;
}
Also used : GatewayConnection(org.openremote.model.gateway.GatewayConnection)

Aggregations

GatewayConnection (org.openremote.model.gateway.GatewayConnection)2