public class DummyComponentManager extends java.lang.Object implements ComponentManager
ComponentManager.ChannelId
Constructor and Description |
---|
DummyComponentManager() |
DummyComponentManager(java.time.Clock clock) |
Modifier and Type | Method and Description |
---|---|
Channel<?> |
_channel(java.lang.String channelName)
Deprecated.
|
DummyComponentManager |
addComponent(OpenemsComponent component)
Specific for this Dummy implementation.
|
java.lang.String |
alias()
Returns a human-readable name of this Component..
|
java.util.Collection<Channel<?>> |
channels()
Returns all Channels.
|
java.util.List<OpenemsComponent> |
getAllComponents()
Gets all OpenEMS-Components.
|
java.time.Clock |
getClock()
Gets the OpenEMS Clock - either the real system clock or a mocked clock for
simulations.
|
org.osgi.service.component.ComponentContext |
getComponentContext()
Returns the ComponentContext.
|
EdgeConfig |
getEdgeConfig()
Gets the complete configuration of this OpenEMS Edge.
|
java.util.List<OpenemsComponent> |
getEnabledComponents()
Gets all enabled OpenEMS-Components.
|
<T extends OpenemsComponent> |
getEnabledComponentsOfType(java.lang.Class<T> clazz)
Gets all enabled OpenEMS-Components of the given Type.
|
java.util.concurrent.CompletableFuture<JsonrpcResponseSuccess> |
handleJsonrpcRequest(User user,
JsonrpcRequest request)
Handles a JSON-RPC Request.
|
java.lang.String |
id()
Returns a unique ID for this OpenEMS component.
|
boolean |
isEnabled()
Returns whether this component is enabled.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_setConfigNotActivated, _setDefaultConfigurationFailed, _setDuplicatedComponentId, _setWasOutOfMemory, getChannel, getComponent, getConfigNotActivated, getConfigNotActivatedChannel, getDefaultConfigurationFailed, getDefaultConfigurationFailedChannel, getDuplicatedComponentId, getDuplicatedComponentIdChannel, getPossiblyDisabledComponent, getWasOutOfMemory, getWasOutOfMemoryChannel
_getChannelAs, channel, channel, debugLog, getModbusSlaveNatureTable, getState, getStateChannel, hasFaults, logDebug, logError, logInfo, logWarn, serviceFactoryPid, servicePid, updateConfigurationProperty, updateReferenceFilter
public DummyComponentManager()
public DummyComponentManager(java.time.Clock clock)
public java.util.List<OpenemsComponent> getEnabledComponents()
ComponentManager
getEnabledComponents
in interface ComponentManager
public java.util.List<OpenemsComponent> getAllComponents()
ComponentManager
getAllComponents
in interface ComponentManager
public <T extends OpenemsComponent> java.util.List<T> getEnabledComponentsOfType(java.lang.Class<T> clazz)
ComponentManager
getEnabledComponentsOfType
in interface ComponentManager
T
- the given Type, subclass of OpenemsComponent
clazz
- the given Type, subclass of OpenemsComponent
public DummyComponentManager addComponent(OpenemsComponent component)
component
- public EdgeConfig getEdgeConfig()
ComponentManager
Internally updates the cache if necessary and publishes a CONFIG_UPDATE event on update.
getEdgeConfig
in interface ComponentManager
EdgeConfig
objectpublic java.lang.String id()
OpenemsComponent
id
in interface OpenemsComponent
public java.lang.String alias()
OpenemsComponent
alias
in interface OpenemsComponent
public boolean isEnabled()
OpenemsComponent
isEnabled
in interface OpenemsComponent
public org.osgi.service.component.ComponentContext getComponentContext()
OpenemsComponent
getComponentContext
in interface OpenemsComponent
@Deprecated public Channel<?> _channel(java.lang.String channelName)
OpenemsComponent
Note: It is preferred to use the typed channel()-method, that's why it is marked as @Deprecated.
_channel
in interface OpenemsComponent
channelName
- the Channel-ID as a stringpublic java.util.Collection<Channel<?>> channels()
OpenemsComponent
channels
in interface OpenemsComponent
public java.util.concurrent.CompletableFuture<JsonrpcResponseSuccess> handleJsonrpcRequest(User user, JsonrpcRequest request) throws OpenemsError.OpenemsNamedException
JsonApi
handleJsonrpcRequest
in interface JsonApi
user
- the authenticated Userrequest
- the JSON-RPC RequestOpenemsError.OpenemsNamedException
- on errorpublic java.time.Clock getClock()
ComponentManager
getClock
in interface ClockProvider
getClock
in interface ComponentManager