Package com.iizix.geo
Class HostNameRegionLocation
java.lang.Object
com.iizix.geo.HostNameRegionLocation
A host name and/or IP address (IPv4 or IPv6) that has region location information. The region location information is retrieved from one of the configured service providers for this purpose in the server.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if two region location information object are equal.Gets the InetAddress.getHost()
Gets the host name or IPv4/IPv6 address.Gets the original host name or IPv4/IPv6 address.getInfo
(long timeout, IRegionLocationReply callback) Requests the region location information.int
hashCode()
Returns the hashCode.toString()
Creates a string representation of the instance.
Method Details
getInfo
public RegionLocation getInfo(long timeout, IRegionLocationReply callback) throws InterruptedException, TimeoutException Requests the region location information.If the request already has been requested and it has a reply, with or without error, the callback
reply
will not be invoked.- Parameters:
timeout
- The timeout: zero for service provider default, negative value for indefinite waiting, otherwise a timeout in milliseconds.callback
- The callback for asynchronous requests.- Returns:
- The RegionInfo instance or if the request already has been retrieved, or
null
if request is done asynchronously and request has not yet been retrieved. The return value can be{@link RegionInfo#ERROR}
if the request failed. If so, check the error with the - Throws:
InterruptedException
- If the thread was interrupted because the service provider was disposed or somebody else interrupted the thread, only ifcallback
parameter isnull
.TimeoutException
- If a timeout occurred during synchronous wait, only ifcallback
parameter isnull
.
getHost
Gets the host name or IPv4/IPv6 address.- Returns:
- The host.
getHostNameOrAddress
Gets the original host name or IPv4/IPv6 address.- Returns:
- The host name or address.
getAddress
Gets the InetAddress.- Returns:
- The InetAddress as IPv4 or IPv6 instance.
toString
Creates a string representation of the instance.hashCode
public int hashCode()Returns the hashCode.equals
Checks if two region location information object are equal.