Package com.tccc.kos.core.service.app
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
Base class for system applications, which simply adds convenience methods
to the base Application type.
- Since:
- 1.0
- Version:
- 2023-01-24
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
installAssembly
(Assembly assembly) Installs an assembly.void
installRegions
(Collection<BaseRegion> regions) Install regions for the application.void
installRegions
(Collection<BaseRegion> regions, RegionSettings settings) Install regions for the application with a custom settings bean.void
Set theDevice
that represents the physical device to external systems.Methods inherited from class com.tccc.kos.core.service.app.Application
addLocalization, addToCtx, getAppDir, getAppFile, getAppId, getConfig, getCoreDir, getCoreFile, getCtx, getDataDir, getDataFile, getDescriptor, getHandle, getHandlePrefix, getKab, getKeyVal, getLoader, getLocalization, getNodeManifest, getSection, getSection, getSectionsByNamePrefix, getVfs, hasProfile, isPostStarted, isStarted, isStopped, load, openDatabase, resolveAppBrowserIntent, setConfig, start, started, stop, unload
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.service.config.ConfigAware
onConfigChanged, onConfigSet
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
-
Constructor Details
-
SystemApplication
public SystemApplication()
-
-
Method Details
-
installAssembly
Installs an assembly. This simply callsAssemblyService.install()
-
installRegions
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 useinstallRegions(regions, settings)
.- Parameters:
regions
- list of regions to install
-
installRegions
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. IfBaseRegion
is extended to have additional settings, provide a subclass ofRegionSettings
that includes the additional properties.- Parameters:
regions
- list of regions to installsettings
- bean to use to hold region settings
-
setDevice
Set theDevice
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 theDeviceView
json view in order to expose just the data needed for external systems to orient to the device.The default
Device
isAssembly
based and will simply expose all installed assemblies. For simple devices this is generally sufficient, but this api allows a user definedDevice
to be used instead, allowing a great degree of freedom to define device data.- Parameters:
device
- the device representation to use
-