<commit_before>package org.waterforpeople.mapping.dataexport;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.waterforpeople.mapping.app.gwt.client.devicefiles.DeviceFilesDto;
import org.waterforpeople.mapping.dao.DeviceFilesDao;
import org.waterforpeople.mapping.dataexport.service.BulkDataServiceClient;
import org.waterforpeople.mapping.domain.Status.StatusCode;

import com.gallatinsystems.device.domain.DeviceFiles;
import com.gallatinsystems.framework.dataexport.applet.DataImporter;
import com.google.appengine.api.datastore.Text;

public class DeviceFilesReplicationImporter implements DataImporter {

	@Override
	public Map<Integer, String> validate(File file) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void executeImport(File file, String serverBase) {

	}

	@Override
	public void executeImport(String sourceBase, String serverBase) {
		DeviceFilesDao dfDao = new DeviceFilesDao();
		for (DeviceFiles df : fetchDeviceFiles(
				StatusCode.PROCESSED_WITH_ERRORS, sourceBase)) {
			DeviceFiles dfLocal = new DeviceFiles();
			dfLocal.setURI(df.getURI());
			dfLocal.setPhoneNumber(df.getPhoneNumber());
			dfLocal.setProcessedStatus(df.getProcessedStatus());
			dfLocal.setProcessingMessageText(df.getProcessingMessageText());
			dfLocal.setProcessDate(df.getProcessDate());
			dfDao.save(dfLocal);<commit_msg>Added some logging statements.<commit_after>package org.waterforpeople.mapping.dataexport;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.waterforpeople.mapping.app.gwt.client.devicefiles.DeviceFilesDto;
import org.waterforpeople.mapping.dao.DeviceFilesDao;
import org.waterforpeople.mapping.dataexport.service.BulkDataServiceClient;
import org.waterforpeople.mapping.domain.Status.StatusCode;

import com.gallatinsystems.device.domain.DeviceFiles;
import com.gallatinsystems.framework.dataexport.applet.DataImporter;
import com.google.appengine.api.datastore.Text;

public class DeviceFilesReplicationImporter implements DataImporter {
	private final static Logger log = Logger.getLogger(DeviceFilesReplicationImporter.class.getName());
	
	@Override
	public Map<Integer, String> validate(File file) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void executeImport(File file, String serverBase) {

	}

	@Override
	public void executeImport(String sourceBase, String serverBase) {
		DeviceFilesDao dfDao = new DeviceFilesDao();
		int i =0;
		List<DeviceFiles> dflist = fetchDeviceFiles(
				StatusCode.PROCESSED_WITH_ERRORS, sourceBase);
		log.log(Level.INFO,"fetched " + dflist.size() + " devicefiles");
		for (DeviceFiles df : dflist) {
			DeviceFiles dfLocal = new DeviceFiles();
			dfLocal.setURI(df.getURI());
			dfLocal.setPhoneNumber(df.getPhoneNumber());
			dfLocal.setProcessedStatus(df.getProcessedStatus());
			dfLocal.setProcessingMessageText(df.getProcessingMessageText());
			dfLocal.setProcessDate(df.getProcessDate());
			dfDao.save(dfLocal);
			i++;
			log.log(Level.INFO, "Saved devicefiles record: " + i);
			
{'fraction_non_alphanumeric': 0.1039360393603936, 'fraction_numerical': 0.0003075030750307503, 'mean_word_length': 5.950854700854701, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6964308', 'n_tokens_mistral': 1045, 'n_tokens_neox': 992, 'n_words': 181}