Mode mode = KosCore.getMode();
BeanContext ctx = KosCore.getCtx();
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();
public static boolean hasProfile(String profile)
Returns true if the specified profile is active.
profile String : the profile to check
boolean
public static boolean isProd()
Returns true if the current operational mode is PROD (production).
boolean
public static boolean isSimulator()
Returns true if we’re running inside the Studio simulator.
boolean
public static boolean isPrimary()
Returns true if we’re running on the system’s primary node.
boolean
public static NodeId getPrimaryNodeId()
Returns the nodeId of the primary node.
NodeId
public static String getDeviceType()
Returns the device type of the overall device the node is part of.
public static String getVendorAuthority()
Returns the vendor authority of this node.
public static String getMfgAuthority()
Returns the manufacturer authority of this node.
public static BeanContext getSystemCtx()
Returns the context for the system app.
BeanContext
public static SystemApplication<?> getSystemApp()
Return the system application.
SystemApplication<?>
public static int getPort()
Returns the port number that kOS is running on. It defaults to 8081.
int
public static File getMfgFile(String path)
Return a File for the specified path in the manufacturer data directory.
path String :
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