Class BridgeOnewireImpl
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.bridge.onewire.impl.BridgeOnewireImpl
-
- All Implemented Interfaces:
BridgeOnewire
,OpenemsComponent
,JsonApi
public class BridgeOnewireImpl extends AbstractOpenemsComponent implements BridgeOnewire, OpenemsComponent, JsonApi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.openems.edge.bridge.onewire.BridgeOnewire
BridgeOnewire.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
-
Constructor Summary
Constructors Constructor Description BridgeOnewireImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTask(java.util.function.Consumer<DSPortAdapter> task)
Add a Task.protected void
deactivate()
Handles @Deactivate of implementations.java.util.concurrent.CompletableFuture<JsonrpcResponseSuccess>
handleJsonrpcRequest(User user, JsonrpcRequest message)
Handles a JSON-RPC Request.protected void
logError(org.slf4j.Logger log, java.lang.String message)
Log an error message including the Component ID.void
removeTask(java.util.function.Consumer<DSPortAdapter> task)
Removes a Task.-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, 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.bridge.onewire.BridgeOnewire
_setUnableToSelectPortFault, getUnableToSelectPortFault, getUnableToSelectPortFaultChannel
-
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 Detail
-
deactivate
protected void deactivate()
Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsComponent
-
addTask
public void addTask(java.util.function.Consumer<DSPortAdapter> task)
Description copied from interface:BridgeOnewire
Add a Task.Tasks are executed sequentially in a separate thread.
- Specified by:
addTask
in interfaceBridgeOnewire
- Parameters:
task
- the task
-
removeTask
public void removeTask(java.util.function.Consumer<DSPortAdapter> task)
Description copied from interface:BridgeOnewire
Removes a Task.- Specified by:
removeTask
in interfaceBridgeOnewire
- Parameters:
task
- the task
-
logError
protected void logError(org.slf4j.Logger log, java.lang.String message)
Description copied from class:AbstractOpenemsComponent
Log an error message including the Component ID.- Overrides:
logError
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-
handleJsonrpcRequest
public java.util.concurrent.CompletableFuture<JsonrpcResponseSuccess> handleJsonrpcRequest(User user, JsonrpcRequest message) throws OpenemsError.OpenemsNamedException
Description copied from interface:JsonApi
Handles a JSON-RPC Request.- Specified by:
handleJsonrpcRequest
in interfaceJsonApi
- Parameters:
user
- the authenticatedUser
message
- 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
-
-