Package org.openiam.esb.am.service.impl
Class GeoLocationIpServiceImpl
- java.lang.Object
-
- org.openiam.esb.am.service.impl.GeoLocationIpServiceImpl
-
- All Implemented Interfaces:
GeoLocationIpService
@Service("geoLocationService") public class GeoLocationIpServiceImpl extends Object implements GeoLocationIpServiceService for working with Geolocation information by user IP
-
-
Constructor Summary
Constructors Constructor Description GeoLocationIpServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DbIPGeo>findBeans(DbIPGeoSearchBean searchBean, int from, int size)DbIPGeofindByIp(InetAddress ip)Return geolocation information by IP.DbIpGeoStatusgetDbIpGeoStatus()LonggetRowCount()static BigIntegeripv6ToBigInteger(InetAddress inetAddress)booleanisGzipped(File file)voiduploadGeoInfo(FileRequest fileRequest)Upload geolocation information into DB from csv
-
-
-
Method Detail
-
findBeans
@Transactional(readOnly=true) public List<DbIPGeo> findBeans(DbIPGeoSearchBean searchBean, int from, int size) throws BasicDataServiceException
- Specified by:
findBeansin interfaceGeoLocationIpService- Throws:
BasicDataServiceException
-
findByIp
@Cacheable(value="geolocationByIp", key="{ #ip }", condition="{#searchBean != null and #searchBean.findInCache}") @Transactional(readOnly=false) public DbIPGeo findByIp(InetAddress ip) throws BasicDataServiceExceptionReturn geolocation information by IP. According properties can use internal DB or custom API. Request to custom API configured in groovy script- Specified by:
findByIpin interfaceGeoLocationIpService- Parameters:
ip-- Returns:
- Throws:
BasicDataServiceException
-
uploadGeoInfo
public void uploadGeoInfo(FileRequest fileRequest) throws BasicDataServiceException
Upload geolocation information into DB from csv- Specified by:
uploadGeoInfoin interfaceGeoLocationIpService- Parameters:
fileRequest-- Throws:
BasicDataServiceException
-
getDbIpGeoStatus
public DbIpGeoStatus getDbIpGeoStatus() throws BasicDataServiceException
- Specified by:
getDbIpGeoStatusin interfaceGeoLocationIpService- Throws:
BasicDataServiceException
-
getRowCount
public Long getRowCount() throws BasicDataServiceException
- Specified by:
getRowCountin interfaceGeoLocationIpService- Throws:
BasicDataServiceException
-
isGzipped
public boolean isGzipped(File file)
-
ipv6ToBigInteger
public static BigInteger ipv6ToBigInteger(InetAddress inetAddress)
-
-