// Grab the operational mode:
Mode mode = KosCore.getMode();
if (KosCore.isTestMode()) {
// Perform test-mode specific operations
}
if (KosCore.isProdMode()) {
// Perform production-mode specific operations
}
In KOS there are two modes: TEST and PROD. The mode is encoded in certificates and KAB files, and therefore allows KOS to determine when to trust artifacts and when not to.
When KOS is running in TEST mode, then artifacts certified either TEST or PROD are trusted, and therefore available to use.
When KOS is running in PROD mode, then only artifacts certified as PROD are trusted, and therefore available to use. In other words, a production system will never trust (and therefore never open or run) an artifact only certified for a TEST system.
In KOS, mode is encapulated in the Mode enum, which is accessed through the KosCore static accessor class:
// Grab the operational mode:
Mode mode = KosCore.getMode();
if (KosCore.isTestMode()) {
// Perform test-mode specific operations
}
if (KosCore.isProdMode()) {
// Perform production-mode specific operations
}