Class AbstractRestApi

java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.controller.api.rest.AbstractRestApi
All Implemented Interfaces:
OpenemsComponent, Controller, RestApi
Direct Known Subclasses:
ControllerApiRestReadOnlyImpl, ControllerApiRestReadWriteImpl

public abstract class AbstractRestApi extends AbstractOpenemsComponent implements RestApi, Controller, OpenemsComponent
  • Field Details

  • Constructor Details

    • AbstractRestApi

      public AbstractRestApi(String implementationName, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds)
  • Method Details

    • activate

      protected void activate(org.osgi.service.component.ComponentContext context, String id, String alias, boolean enabled, boolean isDebugModeEnabled, int apiTimeout, int port, int connectionlimit)
      Activate the AbstractRestApi.
      Parameters:
      context - the ComponentContext
      id - the ID
      alias - the Alias
      enabled - enable component?
      isDebugModeEnabled - enable debug mode?
      apiTimeout - the API timeout
      port - the port; if '0', the port is automatically assigned
      connectionlimit - the connection limit
    • deactivate

      protected void deactivate()
      Description copied from class: AbstractOpenemsComponent
      Handles @Deactivate of implementations. Prints log output.
      Overrides:
      deactivate in class AbstractOpenemsComponent
    • run

      public void run() throws OpenemsError.OpenemsNamedException
      Description copied from interface: Controller
      Executes the Controller logic.
      Specified by:
      run in interface Controller
      Throws:
      OpenemsError.OpenemsNamedException - on error
    • logInfo

      protected void logInfo(org.slf4j.Logger log, String message)
      Description copied from class: AbstractOpenemsComponent
      Log an info message including the Component ID.
      Overrides:
      logInfo in class AbstractOpenemsComponent
      Parameters:
      log - the Logger instance
      message - the message
    • logWarn

      protected void logWarn(org.slf4j.Logger log, String message)
      Description copied from class: AbstractOpenemsComponent
      Log a warn message including the Component ID.
      Overrides:
      logWarn in class AbstractOpenemsComponent
      Parameters:
      log - the Logger instance
      message - the message
    • logError

      protected void logError(org.slf4j.Logger log, String message)
      Description copied from class: AbstractOpenemsComponent
      Log an error message including the Component ID.
      Overrides:
      logError in class AbstractOpenemsComponent
      Parameters:
      log - the Logger instance
      message - the message
    • isDebugModeEnabled

      protected boolean isDebugModeEnabled()
    • getTimedata

      protected abstract Timedata getTimedata() throws OpenemsException
      Gets the Timedata service.
      Returns:
      the service
      Throws:
      OpenemsException - if the timeservice is not available
    • getUserService

      protected abstract UserService getUserService()
      Gets the UserService.
      Returns:
      the service
    • getComponentManager

      protected abstract ComponentManager getComponentManager()
      Gets the ComponentManager.
      Returns:
      the service
    • getAccessMode

      protected abstract AccessMode getAccessMode()
      Gets the AccessMode.
      Returns:
      the AccessMode