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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tccc.kos.core.service.app.Application
Application.View -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinstallAssembly(Assembly assembly) Installs an assembly.voidinstallRegions(Collection<BaseRegion> regions) Install regions for the application.voidinstallRegions(Collection<BaseRegion> regions, RegionSettings settings) Install regions for the application with a custom settings bean.voidSet theDevicethat represents the physical device to external systems.Methods inherited from class com.tccc.kos.core.service.app.Application
addLocalization, addToCtx, getAppDir, getAppFile, getAppId, getBroker, getConfig, getCoreDir, getCoreFile, getCtx, getDataDir, getDataFile, getDescriptor, getHandle, getHandlePrefix, getKab, getKabByType, getKabByType, getKeyVal, getLoader, getLocalization, getNodeManifest, getParentAppId, getSection, getSection, getSectionName, getSectionsByNamePrefix, getVfs, hasProfile, isPostStarted, isStarted, isStopped, load, openDatabase, resolveAppBrowserIntent, setConfig, start, started, stop, unloadMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.commons.core.service.config.ConfigAware
onConfigChanged, onConfigSetMethods 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. IfBaseRegionis extended to have additional settings, provide a subclass ofRegionSettingsthat includes the additional properties.- Parameters:
regions- list of regions to installsettings- bean to use to hold region settings
-
setDevice
Set theDevicethat represents the physical device to external systems. Once set, this object can be accessed via/api/kos/deviceand 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 theDeviceViewjson view in order to expose just the data needed for external systems to orient to the device.The default
DeviceisAssemblybased and will simply expose all installed assemblies. For simple devices this is generally sufficient, but this api allows a user definedDeviceto be used instead, allowing a great degree of freedom to define device data.- Parameters:
device- the device representation to use
-