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
getArch()
Returns the arch of this node.static String
Returns the authority value of this node.static String
Returns the board type of this node.static BeanContext
getCtx()
Returns the context for kOS.static Mode
getMode()
Returns the current operational mode.static NodeId
Returns the ID of the node we're running on.static PathMgr
Returns the object that gives us access to named paths.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 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. -
getAuthority
Returns the authority value of this node. -
getBoardType
Returns the board type of this node. -
getArch
Returns the arch of this node. -
getPathMgr
Returns the object that gives us access to named paths. -
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.
-