Package com.tccc.kos.core.app
Class KosCore
java.lang.Object
com.tccc.kos.core.app.KosCore
Static accessor for a number of core kOS components that are so common
it's inefficient to inject them everywhere they're needed.
Usage Example
Mode mode = KosCore.getMode();
BeanContext ctx = KosCore.getCtx();
- Version:
- 2022-08-31
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatISO8601
(long ms) Format the epoch time in ms as an ISO-8601 string with fractional second resolution and timezone offset.static AnalyticsService
static String
getArch()
Returns the arch of this node.static String
Returns the board type of this node.static BeanContext
getCtx()
Returns the context for kOS.static String
Returns the device type of the overall device the node is part of.static String
Returns the manufacturer authority of this node.static File
Return the manufacturer data directory.static File
getMfgFile
(String path) Return aFile
for the specified path in the manufacturer data directory.static Mode
getMode()
Returns the current operational mode.static NodeId
Returns the ID of the node we're running on.static int
getPort()
Returns the port number that kOS is running on.static NodeId
Returns the nodeId of the primary node.static SystemApplication<?>
Return the system application.static BeanContext
Returns the context for the system app.static String
Returns the vendor authority of this node.static boolean
hasProfile
(String profile) Returns true if the specified profile is active.static boolean
Returns true if we're running on the system's primary node.static boolean
isProd()
Returns true if the current operational mode is PROD (production).static boolean
Returns true if we're running inside the Studio simulator.static boolean
isTest()
Returns true if the current operational mode is TEST.
-
Method Details
-
hasProfile
Returns true if the specified profile is active.- Parameters:
profile
- the profile to check
-
getMode
Returns the current operational mode. -
isTest
public static boolean isTest()Returns true if the current operational mode is TEST. -
isProd
public static boolean isProd()Returns true if the current operational mode is PROD (production). -
isSimulator
public static boolean isSimulator()Returns true if we're running inside the Studio simulator. -
isPrimary
public static boolean isPrimary()Returns true if we're running on the system's primary node. -
getPrimaryNodeId
Returns the nodeId of the primary node. -
getDeviceType
Returns the device type of the overall device the node is part of. -
getVendorAuthority
Returns the vendor authority of this node. -
getMfgAuthority
Returns the manufacturer authority of this node. -
getBoardType
Returns the board type of this node. -
getArch
Returns the arch of this node. -
getCtx
Returns the context for kOS. -
getSystemCtx
Returns the context for the system app. -
getSystemApp
Return the system application. -
getPort
public static int getPort()Returns the port number that kOS is running on. It defaults to 8081. -
getNodeId
Returns the ID of the node we're running on. -
getMfgDir
Return the manufacturer data directory. -
getMfgFile
Return aFile
for the specified path in the manufacturer data directory. -
formatISO8601
Format the epoch time in ms as an ISO-8601 string with fractional second resolution and timezone offset. This preserves the timezone information such that external systems have the benefit of localtime as well as the ability to normalize the time using the timezone offset.- Parameters:
ms
- the time in ms
-
getAnalytics
-