package com.it_screen.edgevision; import java.util.List; /** Optional identity service for visitor sessions. */ interface ReIdProvider { long UNCERTAIN = -1; boolean enabled(); default boolean hasObservation(long visitorId) { return false; } /** Return a confidently matched candidate ID, zero for a distinct visitor, or UNCERTAIN when evidence is insufficient. */ long match(Observation observation, List candidates); void observed(long visitorId, Observation observation); void expired(long visitorId); static ReIdProvider disabled() { return new ReIdProvider() { @Override public boolean enabled() { return false; } @Override public long match(T observation, List candidates) { return 0; } @Override public void observed(long visitorId, T observation) { } @Override public void expired(long visitorId) { } }; } }