Package io.openems.edge.common.host
Class DummyHost
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.common.test.AbstractDummyOpenemsComponent<DummyHost>
io.openems.edge.common.host.DummyHost
- All Implemented Interfaces:
OpenemsComponent
,Host
,JsonApi
Simulates a
Host
for the OpenEMS Component test framework.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.openems.edge.common.host.Host
Host.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Field Summary
Fields inherited from interface io.openems.edge.common.host.Host
SINGLETON_COMPONENT_ID, SINGLETON_SERVICE_PID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture
<? extends JsonrpcResponseSuccess> handleJsonrpcRequest
(User user, JsonrpcRequest request) Handles a JSON-RPC Request.protected DummyHost
self()
withHostname
(String value) Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, deactivate, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, modified, removeChannel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.edge.common.host.Host
_setDiskIsFull, _setHostname, getDiskIsFull, getDiskIsFullChannel, getHostname, getHostnameChannel
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
-
Constructor Details
-
DummyHost
public DummyHost()
-
-
Method Details
-
self
- Specified by:
self
in classAbstractDummyOpenemsComponent<DummyHost>
-
withHostname
- Parameters:
value
- the value- Returns:
- myself
-
handleJsonrpcRequest
public CompletableFuture<? extends JsonrpcResponseSuccess> handleJsonrpcRequest(User user, JsonrpcRequest request) throws OpenemsError.OpenemsNamedException Description copied from interface:JsonApi
Handles a JSON-RPC Request.- Specified by:
handleJsonrpcRequest
in interfaceJsonApi
- Parameters:
user
- the authenticatedUser
request
- the JSON-RPC Request- Returns:
- a Future JSON-RPC Success Response; null response results in a OpenemsError.JSONRPC_UNHANDLED_METHOD
- Throws:
OpenemsError.OpenemsNamedException
- on error
-