public class UiWebsocketImpl extends AbstractOpenemsBackendComponent implements UiWebsocket
Modifier and Type | Field and Description |
---|---|
protected EdgeWebsocket |
edgeWebsocket |
protected JsonRpcRequestHandler |
jsonRpcRequestHandler |
protected Metadata |
metadata |
protected WebsocketServer |
server |
protected Timedata |
timeData |
Constructor and Description |
---|
UiWebsocketImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
logInfo(org.slf4j.Logger log,
java.lang.String message)
Log an info message including the Component ID.
|
protected void |
logWarn(org.slf4j.Logger log,
java.lang.String message)
Log a warn message including the Component ID.
|
void |
send(java.lang.String edgeId,
JsonrpcNotification notification)
Send a JSON-RPC Notification broadcast to all UI sessions with a given
Edge-ID.
|
void |
send(java.util.UUID token,
JsonrpcNotification notification)
Send a JSON-RPC Notification to a UI session.
|
java.util.concurrent.CompletableFuture<JsonrpcResponseSuccess> |
send(java.util.UUID token,
JsonrpcRequest request)
Send a JSON-RPC Request to a UI session via WebSocket and expect a JSON-RPC
Response.
|
getName, logDebug, logError
protected WebsocketServer server
protected volatile JsonRpcRequestHandler jsonRpcRequestHandler
protected volatile Metadata metadata
protected volatile EdgeWebsocket edgeWebsocket
protected volatile Timedata timeData
protected void logInfo(org.slf4j.Logger log, java.lang.String message)
AbstractOpenemsBackendComponent
logInfo
in class AbstractOpenemsBackendComponent
log
- the Logger that is used for writing the logmessage
- the Info-messageprotected void logWarn(org.slf4j.Logger log, java.lang.String message)
AbstractOpenemsBackendComponent
logWarn
in class AbstractOpenemsBackendComponent
log
- the Logger that is used for writing the logmessage
- the Warn-messagepublic void send(java.util.UUID token, JsonrpcNotification notification) throws OpenemsError.OpenemsNamedException
UiWebsocket
send
in interface UiWebsocket
token
- the UI tokennotification
- the JsonrpcNotificationOpenemsError.OpenemsNamedException
- on errorpublic java.util.concurrent.CompletableFuture<JsonrpcResponseSuccess> send(java.util.UUID token, JsonrpcRequest request) throws OpenemsError.OpenemsNamedException
UiWebsocket
send
in interface UiWebsocket
token
- the UI tokenrequest
- the JsonrpcRequestOpenemsError.OpenemsNamedException
- on errorpublic void send(java.lang.String edgeId, JsonrpcNotification notification) throws OpenemsError.OpenemsNamedException
UiWebsocket
send
in interface UiWebsocket
edgeId
- the Edge-IDnotification
- the JsonrpcNotificationOpenemsError.OpenemsNamedException
- on error