Object IPv6Controller

  • All Implemented Interfaces:

    
    public class IPv6Controller
    
                        

    Owns the client-resolved IPv6 (cip6) signal — the IPv6 sibling of IPController.

    The stored value is the 22-character base64url-encoded global IPv6 address (encoding happens at resolve time). Resolution is event-driven (SDK init, IPv6 network changes), off-main, single-flight, and fail-safe: resolver exceptions never overwrite a good value. A deterministic no-global-IPv6 result clears stale cip6 so unsupported networks do not keep sending the previous network's value.

    • Constructor Detail

    • Method Detail

      • shouldUseIPv6Signal

         final Boolean shouldUseIPv6Signal()

        IPv6 signal use is gated by the server flag AND the same age gating as IPv4. The same gate is used for both resolution and send; cache retention is separate.

      • clearIfConfigDisabled

         final Unit clearIfConfigDisabled()

        Clears a stale cached cip6 left over from a previous session where the IPv6 config was enabled. Called once at SDK init; the age-restricted and anonymisation-suppression paths already clear on their own transitions, so this only needs to cover the config-disabled case.

      • triggerResolve

         final Unit triggerResolve(String trigger)

        Kicks off a single-flight, off-main resolve. If a resolve is already in flight, the new trigger is dropped, not re-queued: a concurrent network change resolves to the same IPv6 source address, so re-running would only repeat work. isResolving is always reset in a finally, so the next trigger after the in-flight run completes is honored. Resolver/encode exceptions leave the cached value intact; a no-global-IPv6 result clears it.

        Parameters:
        trigger - a plain label emitted in the resolve/encode/failure telemetry payloads (TelemetryEvent.TRIGGER) and used for logging.