Class NoOpClientInfoPort

java.lang.Object
com.fayupable.logged.core.port.NoOpClientInfoPort
All Implemented Interfaces:
IClientInfoPort

public final class NoOpClientInfoPort extends Object implements IClientInfoPort
A no-op IClientInfoPort that always reports the caller as unknown.

This implementation exists so that the core module remains fully usable on its own, without requiring any adapter (for example logged-spring, which resolves the caller through Spring Security or the current HTTP request) on the classpath. Adapter modules are expected to register their own IClientInfoPort implementation and override this default; this class is the fallback when none is provided.

  • Constructor Details

    • NoOpClientInfoPort

      public NoOpClientInfoPort()
  • Method Details

    • resolveCallerIdentity

      public String resolveCallerIdentity()
      Description copied from interface: IClientInfoPort
      Resolves an identifier describing who triggered the current invocation.
      Specified by:
      resolveCallerIdentity in interface IClientInfoPort
      Returns:
      a caller identity such as "user:42" or "ip:203.0.113.10", or an implementation-defined placeholder such as "unknown" if no identity can be resolved