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 GeoLocationIpService
Service 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)
DbIPGeo
findByIp(InetAddress ip)
Return geolocation information by IP.DbIpGeoStatus
getDbIpGeoStatus()
Long
getRowCount()
static BigInteger
ipv6ToBigInteger(InetAddress inetAddress)
boolean
isGzipped(File file)
void
uploadGeoInfo(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:
findBeans
in interfaceGeoLocationIpService
- Throws:
BasicDataServiceException
-
findByIp
@Cacheable(value="geolocationByIp", key="{ #ip }", condition="{#searchBean != null and #searchBean.findInCache}") @Transactional(readOnly=false) public DbIPGeo findByIp(InetAddress ip) throws BasicDataServiceException
Return geolocation information by IP. According properties can use internal DB or custom API. Request to custom API configured in groovy script- Specified by:
findByIp
in interfaceGeoLocationIpService
- Parameters:
ip
-- Returns:
- Throws:
BasicDataServiceException
-
uploadGeoInfo
public void uploadGeoInfo(FileRequest fileRequest) throws BasicDataServiceException
Upload geolocation information into DB from csv- Specified by:
uploadGeoInfo
in interfaceGeoLocationIpService
- Parameters:
fileRequest
-- Throws:
BasicDataServiceException
-
getDbIpGeoStatus
public DbIpGeoStatus getDbIpGeoStatus() throws BasicDataServiceException
- Specified by:
getDbIpGeoStatus
in interfaceGeoLocationIpService
- Throws:
BasicDataServiceException
-
getRowCount
public Long getRowCount() throws BasicDataServiceException
- Specified by:
getRowCount
in interfaceGeoLocationIpService
- Throws:
BasicDataServiceException
-
isGzipped
public boolean isGzipped(File file)
-
ipv6ToBigInteger
public static BigInteger ipv6ToBigInteger(InetAddress inetAddress)
-
-