Class GeoLookupService
Represents a service that can lookup country/city names by domainnames/ip addresses.
Thehis implementatuion uses free data from: http://dev.maxmind.com/geoip/geoip2/geolite2/.
Must include MaxMind attribution on the public site that uses this data (see License section on maxmind.com)
Inheritance
System.Object
GeoLookupService
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: NFX.Web.dll
Syntax
public class GeoLookupService : Service, IService, INamed, IConfigurable, ILocalizedTimeProvider, IGeoLookup, IApplicationComponent, IDisposable
Constructors
GeoLookupService()
Declaration
public GeoLookupService()
GeoLookupService(Object)
Declaration
public GeoLookupService(object director)
Parameters
Type |
Name |
Description |
System.Object |
director |
|
Fields
CONFIG_GEO_LOOKUP_SECTION
Declaration
public const string CONFIG_GEO_LOOKUP_SECTION = "geo-lookup"
Field Value
Type |
Description |
System.String |
|
Properties
Available
Returns true to indoicate that service has loaded and ready to serve data
Declaration
public bool Available { get; }
Property Value
Type |
Description |
System.Boolean |
|
DataPath
Specifies where the data is
Declaration
[Config]
public string DataPath { get; set; }
Property Value
Type |
Description |
System.String |
|
Instance
Lazily creates the default service instance
Declaration
public static IGeoLookup Instance { get; }
Property Value
Resolution
Specifies what resolution service provides
Declaration
[Config]
public LookupResolution Resolution { get; set; }
Property Value
StartCanceled
Returns true to indicate that previous attempt to start service - load data, was canceled
Declaration
public bool StartCanceled { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
CancelStart()
Cancels service start. This method may be needed when Start() blocks for a long time due to large volumes of data
Declaration
public void CancelStart()
Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Overrides
DoStart()
Declaration
protected override void DoStart()
Overrides
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
Lookup(IPAddress)
Tries to lookup the location by ip/dns name. Returns null if no match could be made
Declaration
public GeoEntity Lookup(IPAddress address)
Parameters
Type |
Name |
Description |
System.Net.IPAddress |
address |
|
Returns
Implements
System.IDisposable
Extension Methods