Class ShieldSignals

java.lang.Object
com.codename1.security.shield.ShieldSignals

public final class ShieldSignals extends Object

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 Details

    • add

      public static void add(ShieldSignal signal)
      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

      public static void add(String id, int severity, String detail)
      Convenience overload for the common case.
    • snapshot

      public static ShieldSignal[] 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.