Interface ControllerApiBackend
- All Superinterfaces:
Controller
,org.osgi.service.event.EventHandler
,OpenemsComponent
- All Known Implementing Classes:
ControllerApiBackendImpl
public interface ControllerApiBackend
extends Controller, OpenemsComponent, org.osgi.service.event.EventHandler
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReadChannel
Gets the Channel forControllerApiBackend.ChannelId.API_WORKER_LOG
.default LongReadChannel
Gets the Channel forControllerApiBackend.ChannelId.LAST_SUCCESSFUL_RESEND
.default StateChannel
Gets the Channel forControllerApiBackend.ChannelId.UNABLE_TO_SEND
.boolean
Gets if the edge is currently connected to the backend.CompletableFuture
<? extends JsonrpcResponseSuccess> sendRequest
(User user, JsonrpcRequest request) Sends the request to the connected backend.Methods inherited from interface io.openems.edge.controller.api.Controller
_setRunFailed, getRunFailed, getRunFailedChannel, run
Methods inherited from interface org.osgi.service.event.EventHandler
handleEvent
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
Method Details
-
getApiWorkerLogChannel
Gets the Channel forControllerApiBackend.ChannelId.API_WORKER_LOG
.- Returns:
- the Channel
-
getUnableToSendChannel
Gets the Channel forControllerApiBackend.ChannelId.UNABLE_TO_SEND
.- Returns:
- the Channel
-
getLastSuccessFulResendChannel
Gets the Channel forControllerApiBackend.ChannelId.LAST_SUCCESSFUL_RESEND
.- Returns:
- the Channel
-
isConnected
boolean isConnected()Gets if the edge is currently connected to the backend.- Returns:
- true if it is connected
-
sendRequest
CompletableFuture<? extends JsonrpcResponseSuccess> sendRequest(User user, JsonrpcRequest request) throws OpenemsError.OpenemsNamedException Sends the request to the connected backend.- Parameters:
user
- the userrequest
- the request to send- Returns:
- the result future
- Throws:
OpenemsError.OpenemsNamedException
- on error
-