Package com.evasion.plugin.geoloc.dataimport

Examples of com.evasion.plugin.geoloc.dataimport.Importer


       
    }
   
    @Override
    public boolean importData(String file, String format) throws EvasionException {
        Importer geo = new Importer(em, utx);
        geo.setFile(file);
        return geo.importData(format, Mode.UPDATE);
    }
View Full Code Here


    @Timeout()
    @Override
    public void timeout(Timer timer) {
        LOGGER.info("Import Geoloc timer step.");
        try {
            Importer geo = new Importer(em, utx);
            List<EntityJPA> countrys = defaultDAO.findAll(Country.class);
            for (EntityJPA object : countrys) {
                Country country = (Country) object;
                try {
                    utx.begin();  
                    if (geo.downloadCountryData(parametreManager.getProperty(Constante.IMPORT_FTP_DOWNLOAD_URL), country.getGeoname().getModDate().getTime(), country.getCode())) {
                        geo.importData(parametreManager.getProperty(Constante.IMPORT_FILE_FORMAT), Mode.DELTE_INSERT);
                        parametreManager.saveParametre(
                                Constante.IMPORT_LAST_UPDATE, String.valueOf(new Date().getTime()), Boolean.TRUE);
                    }
                    geo.clear();
                    utx.commit();

                    // @TODo revoir la gestion des exceptions
                } catch (Exception ex) {
                    throw  new EvasionException("Error import Geoloc data for country "+ country, ex);
View Full Code Here

    @Timeout()
    @Override
    public void timeout(Timer timer) {
        LOGGER.info("Import Geoloc timer step.");
        try {
            Importer geo = new Importer(em, utx);
            List<EntityJPA> countrys = defaultDAO.findAll(Country.class);
            for (EntityJPA object : countrys) {
                Country country = (Country) object;
                try {
                    utx.begin();
                    if (geo.downloadCountryData(parametreManager.getProperty(Constante.IMPORT_FTP_DOWNLOAD_URL), country.getGeoname().getModDate().getTime(), country.getCode())) {
                        geo.importData(parametreManager.getProperty(Constante.IMPORT_FILE_FORMAT), Mode.DELETE_INSERT);
                        parametreManager.saveParametre(
                                Constante.IMPORT_LAST_UPDATE, String.valueOf(new Date().getTime()), Boolean.TRUE);
                    }
                    geo.clear();
                    utx.commit();

                    // @TODo revoir la gestion des exceptions
                } catch (Exception ex) {
                    throw new EvasionException("Error import Geoloc data for country " + country, ex);
View Full Code Here

    }

    @Override
    public boolean importData(String file, String format) throws EvasionException {
        Importer geo = new Importer(em, utx);
        geo.setFile(file);
        return geo.importData(format, Mode.UPDATE);
    }
View Full Code Here

TOP

Related Classes of com.evasion.plugin.geoloc.dataimport.Importer

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.