Class GeoLookupService
Represents a service that can lookup country/city names by domain names/ip addresses. This implementation 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)
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)
Namespace: Azos.Web.GeoLookup
Assembly: Azos.Web.dll
Syntax
public sealed class GeoLookupService : Daemon, IDisposable, IDaemon, IDaemonView, INamed, IConfigurable, ILocalizedTimeProvider, IGeoLookup, IApplicationComponent
Constructors
GeoLookupService(IApplicationComponent)
Declaration
public GeoLookupService(IApplicationComponent director)
Parameters
Type | Name | Description |
---|---|---|
IApplicationComponent | director |
GeoLookupService(IApplication)
Declaration
public GeoLookupService(IApplication app)
Parameters
Type | Name | Description |
---|---|---|
IApplication | app |
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 indicate that service has loaded and ready to serve data
Declaration
public bool Available { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
DataPath
Specifies where the data is
Declaration
[Config]
public string DataPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Resolution
Specifies what resolution service provides
Declaration
[Config]
public LookupResolution Resolution { get; set; }
Property Value
Type | Description |
---|---|
LookupResolution |
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()
DoConfigure(IConfigSectionNode)
Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Type | Name | Description |
---|---|---|
IConfigSectionNode | node |
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
Type | Description |
---|---|
GeoEntity |
Implements
System.IDisposable