Class ClientPlace

java.lang.Object
com.iizix.server.user.ClientPlace

public final class ClientPlace extends Object
The client address of a session and the place the server's region location provider knows for it, resolved as the sign-in throttle, the session geolocation log and the account notices resolve them (CC-SIGNIN-RECORDS-AND-SECURITY-LOG, order 556: one resolver for the sign-in records and the security events). The connection's remote address, unless it is a trusted proxy's ($geo.trustedProxies) and the forwarded headers name the client; a private or local address is never looked up. Never throws.
Author:
Christopher Mindus
  • Field Details

    • PLACE_LOOKUP_MS

      public static final long PLACE_LOOKUP_MS
      How long a place lookup may take before the caller goes on without it: the provider is local (IP2Location) and answers in microseconds once loaded; a web provider may be slow.
      See Also:
  • Method Details

    • resolve

      public static ClientAddressResolver.Resolution resolve(IClientSessionGyro clientGyro)
      Resolves the client address of a session.
      Parameters:
      clientGyro - The client session, null for none.
      Returns:
      The resolution; its address null when none is known.
    • addressOf

      public static String addressOf(IClientSessionGyro clientGyro)
      Gets the client address of a session as text.
      Parameters:
      clientGyro - The client session, null for none.
      Returns:
      The address, null when none is known.
    • lookup

      public static RegionLocation lookup(InetAddress address)
      Looks a public address up with the default region location provider, waiting at most PLACE_LOOKUP_MS.
      Parameters:
      address - The address, null for none.
      Returns:
      The region location, null when there is no provider, the address is null, private or local, the lookup failed or took too long.
    • lookup

      public static RegionLocation lookup(InetAddress address, long waitMs)
      Looks a public address up with the default region location provider.
      Parameters:
      address - The address, null for none.
      waitMs - The longest wait in milliseconds; zero for the cached answer only.
      Returns:
      The region location, null when there is no provider, the address is null, private or local, the lookup failed or took too long.
    • placeOf

      public static String placeOf(RegionLocation info)
      Describes a region location as a place: "city, region, country".
      Parameters:
      info - The region location, null for none.
      Returns:
      The place, null when nothing is known.