Interface PlatformService

All Known Implementing Classes:
DefaultPlatformService

public interface PlatformService
API for SolarNode platform-wide support.
Since:
1.56
Version:
1.0
Author:
matt
  • Field Details

  • Method Details

    • activePlatformState

      PlatformService.PlatformState activePlatformState()
      Get the current active platform state.
      Returns:
      the active platform state
    • activePlatformTaskStatus

      PlatformService.PlatformTaskStatus activePlatformTaskStatus()
      Get the current active platform task status.
      Returns:
      the task info, or null if no task is active
    • activePlatformTaskInfo

      PlatformService.PlatformTaskInfo activePlatformTaskInfo(Locale locale)
      Get the current active platform task status, localized into task info.
      Parameters:
      locale - the desired locale of the info, or null for the system default
      Returns:
      the localized platform task info
    • subscribeToActivePlatformTaskInfo

      void subscribeToActivePlatformTaskInfo(Locale locale)
      Register a subscription to the active platform task's status updates for a specific locale.

      Once registered, this service will post messages to the MSG_TOPIC_PLATFORM_TASK_INFO topic.

      Parameters:
      locale - the locale to register for updates
    • performTaskWithState

      <T> Future<T> performTaskWithState(PlatformService.PlatformState state, PlatformService.PlatformTask<T> task)
      Perform a platform state-altering task.

      This method will schedule a task such that while that task is running the provided state is applied to the platform. While task is executing the activePlatformState() method will return the given state.

      Type Parameters:
      T - the task result type
      Parameters:
      state - the state the task must run with
      task - the task to execute
      Returns:
      a future with the task results