Class SystemApplication<T extends BaseAppConfig>

java.lang.Object
com.tccc.kos.core.service.app.Application<T>
com.tccc.kos.core.service.app.SystemApplication<T>
All Implemented Interfaces:
ConfigAware<T>, ContextHandleAware, HandleAware, JsonDescriptorAware, Loadable

public abstract class SystemApplication<T extends BaseAppConfig> extends Application<T>
Base class for system applications, which simply adds convenience methods to the base Application type.
Since:
1.0
Version:
2023-01-24
  • Constructor Details

    • SystemApplication

      public SystemApplication()
  • Method Details

    • installAssembly

      public void installAssembly(Assembly assembly)
      Installs an assembly. This simply calls AssemblyService.install()
    • installRegions

      public void installRegions(Collection<BaseRegion> regions)
      Install regions for the application. This install standard kOS region settings which will update every time the region changes. To install a custom settings bean with more properties use installRegions(regions, settings) .
      Parameters:
      regions - list of regions to install
    • installRegions

      public void installRegions(Collection<BaseRegion> regions, RegionSettings settings)
      Install regions for the application with a custom settings bean. The bean will be used as a config bean to hold settings for the selected region. When regions are changed, this bean will be updated with default values from the newly selected region. If BaseRegion is extended to have additional settings, provide a subclass of RegionSettings that includes the additional properties.
      Parameters:
      regions - list of regions to install
      settings - bean to use to hold region settings
    • setDevice

      public void setDevice(Device device)
      Set the Device that represents the physical device to external systems. Once set, this object can be accessed via /api/kos/device and is commonly used to bootstrap external systems such as admin ui's. This provides a unified definition of the device to aid external systems in establishing a baseline of device configuration and state. This object should be annotated with the DeviceView json view in order to expose just the data needed for external systems to orient to the device.

      The default Device is Assembly based and will simply expose all installed assemblies. For simple devices this is generally sufficient, but this api allows a user defined Device to be used instead, allowing a great degree of freedom to define device data.

      Parameters:
      device - the device representation to use