Interface ComponentManager
- All Superinterfaces:
ClockProvider
,JsonApi
,OpenemsComponent
- All Known Implementing Classes:
ComponentManagerImpl
,DummyComponentManager
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
_setConfigNotActivated
(Boolean value) Internal method to set the 'nextValue' onComponentManager.ChannelId.CONFIG_NOT_ACTIVATED
Channel.default void
_setDefaultConfigurationFailed
(boolean value) Internal method to set the 'nextValue' onComponentManager.ChannelId.DEFAULT_CONFIGURATION_FAILED
Channel.default void
_setDuplicatedComponentId
(Boolean value) Internal method to set the 'nextValue' onComponentManager.ChannelId.DUPLICATED_COMPONENT_ID
Channel.default void
_setWasOutOfMemory
(boolean value) Internal method to set the 'nextValue' onComponentManager.ChannelId.WAS_OUT_OF_MEMORY
Channel.Gets all OpenEMS-Components.default <T extends Channel<?>>
TgetChannel
(ChannelAddress channelAddress) Gets a Channel by its Channel-Address.getClock()
Gets the OpenEMS Clock - either the real system clock or a mocked clock for simulations.<T extends OpenemsComponent>
TgetComponent
(String componentId) Gets a OpenEMS-Component by its Component-ID.Gets the Config Not Activated Warning State.default StateChannel
Gets the Channel forComponentManager.ChannelId.CONFIG_NOT_ACTIVATED
.Gets the Default Configuration Failed State.default StateChannel
Gets the Channel forComponentManager.ChannelId.DEFAULT_CONFIGURATION_FAILED
.Gets the Duplicated Component-ID Fault State.default StateChannel
Gets the Channel forComponentManager.ChannelId.DUPLICATED_COMPONENT_ID
.Gets the complete configuration of this OpenEMS Edge.Gets all enabled OpenEMS-Components.<T extends OpenemsComponent>
List<T> getEnabledComponentsOfType
(Class<T> clazz) Gets all enabled OpenEMS-Components of the given Type.<T extends OpenemsComponent>
TgetPossiblyDisabledComponent
(String componentId) Gets a OpenEMS-Component by its Component-ID.Gets the Was Out of Memory Fault State.default StateChannel
Gets the Channel forComponentManager.ChannelId.WAS_OUT_OF_MEMORY
.Methods inherited from interface io.openems.edge.common.jsonapi.JsonApi
handleJsonrpcRequest
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
-
Field Details
-
SINGLETON_SERVICE_PID
- See Also:
-
SINGLETON_COMPONENT_ID
- See Also:
-
-
Method Details
-
getConfigNotActivatedChannel
Gets the Channel forComponentManager.ChannelId.CONFIG_NOT_ACTIVATED
.- Returns:
- the Channel
-
getConfigNotActivated
Gets the Config Not Activated Warning State. SeeComponentManager.ChannelId.CONFIG_NOT_ACTIVATED
.- Returns:
- the Channel
Value
-
_setConfigNotActivated
Internal method to set the 'nextValue' onComponentManager.ChannelId.CONFIG_NOT_ACTIVATED
Channel.- Parameters:
value
- the next value
-
getDuplicatedComponentIdChannel
Gets the Channel forComponentManager.ChannelId.DUPLICATED_COMPONENT_ID
.- Returns:
- the Channel
-
getDuplicatedComponentId
Gets the Duplicated Component-ID Fault State. SeeComponentManager.ChannelId.DUPLICATED_COMPONENT_ID
.- Returns:
- the Channel
Value
-
_setDuplicatedComponentId
Internal method to set the 'nextValue' onComponentManager.ChannelId.DUPLICATED_COMPONENT_ID
Channel.- Parameters:
value
- the next value
-
getWasOutOfMemoryChannel
Gets the Channel forComponentManager.ChannelId.WAS_OUT_OF_MEMORY
.- Returns:
- the Channel
-
getWasOutOfMemory
Gets the Was Out of Memory Fault State. SeeComponentManager.ChannelId.WAS_OUT_OF_MEMORY
.- Returns:
- the Channel
Value
-
_setWasOutOfMemory
default void _setWasOutOfMemory(boolean value) Internal method to set the 'nextValue' onComponentManager.ChannelId.WAS_OUT_OF_MEMORY
Channel.- Parameters:
value
- the next value
-
getDefaultConfigurationFailedChannel
Gets the Channel forComponentManager.ChannelId.DEFAULT_CONFIGURATION_FAILED
.- Returns:
- the Channel
-
getDefaultConfigurationFailed
Gets the Default Configuration Failed State. SeeComponentManager.ChannelId.DEFAULT_CONFIGURATION_FAILED
.- Returns:
- the Channel
Value
-
_setDefaultConfigurationFailed
default void _setDefaultConfigurationFailed(boolean value) Internal method to set the 'nextValue' onComponentManager.ChannelId.DEFAULT_CONFIGURATION_FAILED
Channel.- Parameters:
value
- the next value
-
getClock
Clock getClock()Gets the OpenEMS Clock - either the real system clock or a mocked clock for simulations.- Specified by:
getClock
in interfaceClockProvider
- Returns:
- the Clock
-
getEnabledComponents
List<OpenemsComponent> getEnabledComponents()Gets all enabled OpenEMS-Components.Be aware that via this method usage of the Component service is not tracked by the bundle's use count (See
BundleContext.getService(org.osgi.framework.ServiceReference)
). Make sure to use the references as shortly as possible.- Returns:
- a List of OpenEMS-Components
- Throws:
IllegalArgumentException
- if the Component was not found
-
getEnabledComponentsOfType
Gets all enabled OpenEMS-Components of the given Type.Be aware that via this method usage of the Component service is not tracked by the bundle's use count (See
BundleContext.getService(org.osgi.framework.ServiceReference)
). Make sure to use the references as shortly as possible.- Type Parameters:
T
- the given Type, subclass ofOpenemsComponent
- Parameters:
clazz
- the given Type, subclass ofOpenemsComponent
- Returns:
- a List of OpenEMS-Components
-
getAllComponents
List<OpenemsComponent> getAllComponents()Gets all OpenEMS-Components.Be aware that via this method usage of the Component service is not tracked by the bundle's use count (See
BundleContext.getService(org.osgi.framework.ServiceReference)
). Make sure to use the references as shortly as possible.- Returns:
- a List of OpenEMS-Components
- Throws:
IllegalArgumentException
- if the Component was not found
-
getComponent
<T extends OpenemsComponent> T getComponent(String componentId) throws OpenemsError.OpenemsNamedException Gets a OpenEMS-Component by its Component-ID. The Component is guaranteed to be enabled.Be aware that via this method usage of the Component service is not tracked by the bundle's use count (See
BundleContext.getService(org.osgi.framework.ServiceReference)
). Make sure to use the references as shortly as possible.- Type Parameters:
T
- the typed Component- Parameters:
componentId
- the Component-ID (e.g. "_sum")- Returns:
- the OpenEMS-Component
- Throws:
OpenemsError.OpenemsNamedException
- if the Component was not found
-
getPossiblyDisabledComponent
<T extends OpenemsComponent> T getPossiblyDisabledComponent(String componentId) throws OpenemsError.OpenemsNamedException Gets a OpenEMS-Component by its Component-ID. Be careful, that the Component might not be 'enabled'. If in doubt, usegetComponent(String)
instead.Be aware that via this method usage of the Component service is not tracked by the bundle's use count (See
BundleContext.getService(org.osgi.framework.ServiceReference)
). Make sure to use the references as shortly as possible.- Type Parameters:
T
- the typed Component- Parameters:
componentId
- the Component-ID (e.g. "_sum")- Returns:
- the OpenEMS-Component
- Throws:
OpenemsError.OpenemsNamedException
- if the Component was not found
-
getChannel
default <T extends Channel<?>> T getChannel(ChannelAddress channelAddress) throws IllegalArgumentException, OpenemsError.OpenemsNamedException Gets a Channel by its Channel-Address.- Type Parameters:
T
- the typed Channel- Parameters:
channelAddress
- the Channel-Address- Returns:
- the Channel
- Throws:
IllegalArgumentException
- if the Channel is not availableOpenemsError.OpenemsNamedException
- on error
-
getEdgeConfig
EdgeConfig getEdgeConfig()Gets the complete configuration of this OpenEMS Edge.Internally updates the cache if necessary and publishes a CONFIG_UPDATE event on update.
- Returns:
- the
EdgeConfig
object
-