use of io.openems.common.exceptions.OpenemsException in project openems by OpenEMS.
the class WebsocketApiServer method onConfigUpdate.
public void onConfigUpdate() {
for (UiEdgeWebsocketHandler handler : this.handlers.values()) {
try {
Role role = handler.getUserOpt().get().getRole();
JsonObject j = DefaultMessages.configQueryReply(new JsonObject(), Config.getInstance().getJson(ConfigFormat.OPENEMS_UI, role, DEFAULT_CONFIG_LANGUAGE));
handler.send(j);
} catch (OpenemsException | NoSuchElementException e) {
log.warn(e.getMessage());
}
}
}
use of io.openems.common.exceptions.OpenemsException in project openems by OpenEMS.
the class WebsocketApiServer method disposeHandler.
private void disposeHandler(WebSocket websocket) {
UiEdgeWebsocketHandler handler;
try {
handler = getHandlerOrCloseWebsocket(websocket);
UUID uuid = handler.getUuid();
this.handlers.remove(uuid);
handler.dispose();
} catch (OpenemsException e) {
log.warn("Unable to dispose Handler: " + e.getMessage());
}
}
Aggregations