Javadocs

KosCore

Summary

public final class KosCore extends Object

Description

Static accessor for a number of core kOS components that are so common it’s inefficient to inject them everywhere they’re needed. <h2 id="usage-example-heading">Usage Example*

Mode mode = KosCore.getMode();
BeanContext ctx = KosCore.getCtx();

Methods

hasProfile

public static boolean hasProfile(String profile)

Returns true if the specified profile is active.

profile String : the profile to check

boolean

getMode

public static Mode getMode()

Returns the current operational mode.

Mode

isTest

public static boolean isTest()

Returns true if the current operational mode is TEST.

boolean

isProd

public static boolean isProd()

Returns true if the current operational mode is PROD (production).

boolean

isSimulator

public static boolean isSimulator()

Returns true if we’re running inside the Studio simulator.

boolean

isPrimary

public static boolean isPrimary()

Returns true if we’re running on the system’s primary node.

boolean

getPrimaryNodeId

public static NodeId getPrimaryNodeId()

Returns the nodeId of the primary node.

NodeId

getDeviceType

public static String getDeviceType()

Returns the device type of the overall device the node is part of.

getVendorAuthority

public static String getVendorAuthority()

Returns the vendor authority of this node.

getMfgAuthority

public static String getMfgAuthority()

Returns the manufacturer authority of this node.

getBoardType

public static String getBoardType()

Returns the board type of this node.

getArch

public static String getArch()

Returns the arch of this node.

getCtx

public static BeanContext getCtx()

Returns the context for kOS.

BeanContext

getSystemCtx

public static BeanContext getSystemCtx()

Returns the context for the system app.

BeanContext

getSystemApp

public static SystemApplication<?> getSystemApp()

Return the system application.

SystemApplication<?>

getPort

public static int getPort()

Returns the port number that kOS is running on. It defaults to 8081.

int

getNodeId

public static NodeId getNodeId()

Returns the ID of the node we’re running on.

NodeId

getMfgDir

public static File getMfgDir()

Return the manufacturer data directory.

getMfgFile

public static File getMfgFile(String path)

Return a File for the specified path in the manufacturer data directory.

path String :

formatISO8601

public static String formatISO8601(long ms)

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.

ms long : the time in ms

getAnalytics

public static AnalyticsService getAnalytics()

AnalyticsService

Previous
Next
On this page
Java Development
Seamlessly transition from Legacy+ systems to Freestyle microdosing and advanced distributed dispense systems.
UI Development
Using KOS SDKs, integrating Consumer and Non-consumer facing UIs becomes seamless, giving you less hassle and more time to create.
Video Library
Meet some of our development team, as they lead you through the tools, features, and tips and tricks of various KOS tools.
Resources
Familiarize yourself with KOS terminology, our reference materials, and explore additional resources that complement your KOS journey.
Copyright © 2024 TCCC. All rights reserved.