Package org.hoteia.qalingo.core.pojo.geoloc

Examples of org.hoteia.qalingo.core.pojo.geoloc.GeolocDataPojo


    @Produces(MediaType.APPLICATION_JSON)
    public GeolocContextResponse getGeolocMarketArea(@Context HttpServletRequest request) {
        GeolocContextResponse geolocContextResponse = new GeolocContextResponse();
       
        try {
            GeolocDataPojo geolocDataPojo = marketPojoService.getGeolocDataByRemoteAddress(request.getRemoteAddr());
            MarketAreaPojo marketAreaPojo = marketPojoService.getMarketAreaByGeolocData(geolocDataPojo);
            geolocContextResponse.setMarketArea(marketAreaPojo);
           
        } catch (Exception e) {
            logger.error("Some error during the Geoloc Context.", e);
View Full Code Here


        return dozerBeanMapper.map(marketArea, MarketAreaPojo.class);
    }
   
    public GeolocDataPojo getGeolocDataByRemoteAddress(final String remoteAddress) throws Exception {
        final GeolocData geolocData = geolocService.getGeolocData(remoteAddress);
        GeolocDataPojo geolocDataPojo = new GeolocDataPojo();
        if(geolocData != null){
            if(geolocData.getCountry() != null){
                geolocDataPojo.setCountryName(geolocData.getCountry().getName());
                geolocDataPojo.setCountryIsoCode(geolocData.getCountry().getIsoCode());
            }
            if(geolocData.getCity() != null){
                geolocDataPojo.setCityName(geolocData.getCity().getName());
                geolocDataPojo.setGeoNameId(geolocData.getCity().getGeoNameId());
            }
        }
        return dozerBeanMapper.map(geolocData, GeolocDataPojo.class);
    }
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.pojo.geoloc.GeolocDataPojo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.