Object IPv6Controller
-
- All Implemented Interfaces:
public class IPv6ControllerOwns 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
cip6so unsupported networks do not keep sending the previous network's value.
-
-
Field Summary
Fields Modifier and Type Field Description private StringipAddresspublic final static StringTRIGGER_SDK_INITpublic final static StringTRIGGER_IPv6_NETWORK_CHANGEDpublic final static IPv6ControllerINSTANCE
-
Method Summary
Modifier and Type Method Description final BooleanshouldUseIPv6Signal()IPv6 signal use is gated by the server flag AND the same age gating as IPv4. final UnitclearIpAddress()final UnitclearIfConfigDisabled()Clears a stale cached cip6left over from a previous session where the IPv6 config was enabled.final UnitsubscribeToIPv6NetworkChanges()Subscribes the single strong-ref busAction to IPv6 network changes. final UnittriggerResolve(String trigger)Kicks off a single-flight, off-main resolve. final StringgetIpAddress()final UnitsetIpAddress(String ipAddress)-
-
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.
-
clearIpAddress
final Unit clearIpAddress()
-
clearIfConfigDisabled
final Unit clearIfConfigDisabled()
Clears a stale cached
cip6left 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.
-
subscribeToIPv6NetworkChanges
final Unit subscribeToIPv6NetworkChanges()
Subscribes the single strong-ref busAction to IPv6 network changes. Idempotent across repeated com.inmobi.unification.sdk.UnifiedSdk init via isSubscribed.
-
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.
-
getIpAddress
final String getIpAddress()
-
setIpAddress
final Unit setIpAddress(String ipAddress)
-
-
-
-