pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.geolocation
Class GeoIPLocationProvider

java.lang.Object
  extended by org.torweg.pulse.util.geolocation.GeoIPLocationProvider
All Implemented Interfaces:
LifecycleResource, IGeoLocationProvider

public class GeoIPLocationProvider
extends java.lang.Object
implements IGeoLocationProvider

this is an implementation of IGeoLocationProvider using Maxmind's GeoIP as the country provider.

Version:
$Revision: 1409 $
Author:
Thomas Weber

Constructor Summary
GeoIPLocationProvider()
          creates a new GeoIPLocationProvider.
 
Method Summary
 boolean isModified()
          returns whether the resource has been modified.
 GeoLocation lookup(java.net.InetAddress ip)
          returns the GeoLocation the given IP-address is located in.
 GeoLocation lookup(java.lang.String ip)
          returns the GeoLocation the given IP-address is located in.
 void restart()
          restarts the resource.
 void shutdown()
          destroys all internal resources.
 void startup()
          starts the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoIPLocationProvider

public GeoIPLocationProvider()
creates a new GeoIPLocationProvider.

Method Detail

lookup

public final GeoLocation lookup(java.lang.String ip)
returns the GeoLocation the given IP-address is located in.

Specified by:
lookup in interface IGeoLocationProvider
Parameters:
ip - the IP-address to lookup
Returns:
the GeoLocation

lookup

public final GeoLocation lookup(java.net.InetAddress ip)
returns the GeoLocation the given IP-address is located in.

Specified by:
lookup in interface IGeoLocationProvider
Parameters:
ip - the IP-address to lookup
Returns:
the GeoLocation

isModified

public final boolean isModified()
returns whether the resource has been modified.

Specified by:
isModified in interface LifecycleResource
Returns:
whether the resource has been modified

restart

public final void restart()
restarts the resource.

Specified by:
restart in interface LifecycleResource

shutdown

public final void shutdown()
destroys all internal resources.

Specified by:
shutdown in interface LifecycleResource

startup

public final void startup()
starts the resource.

Specified by:
startup in interface LifecycleResource