Class ClientPlace
java.lang.Object
com.iizix.server.user.ClientPlace
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final longHow 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.Method Summary
Modifier and TypeMethodDescriptionstatic StringaddressOf(IClientSessionGyro clientGyro) Gets the client address of a session as text.static RegionLocationlookup(InetAddress address) Looks a public address up with the default region location provider, waiting at mostPLACE_LOOKUP_MS.static RegionLocationlookup(InetAddress address, long waitMs) Looks a public address up with the default region location provider.static StringplaceOf(RegionLocation info) Describes a region location as a place: "city, region, country".resolve(IClientSessionGyro clientGyro) Resolves the client address of a session.
Field Details
PLACE_LOOKUP_MS
public static final long PLACE_LOOKUP_MSHow 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
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
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
Looks a public address up with the default region location provider, waiting at mostPLACE_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
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
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.