Class ShieldSignals
java.lang.Object
com.codename1.security.shield.ShieldSignals
Collection point for runtime self-protection observations.
The framework's own detections report here, and so can a cn1lib or the app itself when it notices something the platform checks cannot see -- a failed server-side consistency check, a suspicious sequence of user actions. Everything recorded here is offered to the attestation service on the next token fetch, where the policy engine decides what it means.
The bus is bounded: it keeps only the most recent observations, and repeat reports of the same id collapse onto the existing entry rather than accumulating. A hooking framework that trips a detector on every frame must not be able to exhaust memory.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(ShieldSignal signal) Records an observation.static voidConvenience overload for the common case.static voidclear()Discards every recorded observation.static booleanhasSignalAtLeast(int severity) True when any recorded observation is at or above the given severity.static ShieldSignal[]snapshot()The observations recorded so far.
-
Method Details
-
add
Records an observation. Repeat reports of an id already present update that entry in place. Safe to call from any thread; listeners are notified on the EDT. -
add
-
snapshot
The observations recorded so far. Never null. -
hasSignalAtLeast
public static boolean hasSignalAtLeast(int severity) True when any recorded observation is at or above the given severity. -
clear
public static void clear()Discards every recorded observation. Intended for tests and for the simulator's signal-faking menu.
-