Search in sources :

Example 81 with ICallerList

use of de.janrufmonitor.framework.ICallerList in project janrufmonitor by tbrandt77.

the class ThunderbirdCallerManager method createCallerListFromThunderbird.

private void createCallerListFromThunderbird() {
    final String file = this.m_configuration.getProperty(CFG_MAB_FILE, "");
    Thread t = new Thread(new Runnable() {

        public void run() {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e2) {
            }
            File mso_cache = new File(THB_CACHE_PATH);
            if (!mso_cache.exists())
                mso_cache.mkdirs();
            ICallerList cl = new ThunderbirdTransformer(file, true).getCallers();
            try {
                getDatabaseHandler().deleteCallerList(cl);
                getDatabaseHandler().commit();
                getDatabaseHandler().insertOrUpdateCallerList(cl);
                getDatabaseHandler().commit();
            } catch (SQLException e) {
                m_logger.log(Level.SEVERE, e.getMessage(), e);
                try {
                    getDatabaseHandler().rollback();
                } catch (SQLException e1) {
                    m_logger.log(Level.SEVERE, e1.getMessage(), e1);
                }
            }
        }
    });
    t.setName("JAM-ThunderbirdSync-Thread-(non-deamon)");
    t.start();
}
Also used : ICallerList(de.janrufmonitor.framework.ICallerList) SQLException(java.sql.SQLException) File(java.io.File)

Aggregations

ICallerList (de.janrufmonitor.framework.ICallerList)81 ICaller (de.janrufmonitor.framework.ICaller)40 List (java.util.List)36 ArrayList (java.util.ArrayList)32 IAttribute (de.janrufmonitor.framework.IAttribute)24 IPhonenumber (de.janrufmonitor.framework.IPhonenumber)24 SQLException (java.sql.SQLException)24 IAttributeMap (de.janrufmonitor.framework.IAttributeMap)18 IMultiPhoneCaller (de.janrufmonitor.framework.IMultiPhoneCaller)17 IOException (java.io.IOException)15 Message (de.janrufmonitor.exception.Message)14 Iterator (java.util.Iterator)11 Map (java.util.Map)11 File (java.io.File)10 HashMap (java.util.HashMap)10 Viewer (org.eclipse.jface.viewers.Viewer)10 ICallerManager (de.janrufmonitor.repository.ICallerManager)9 ComFailException (com.jacob.com.ComFailException)8 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)8 AttributeFilter (de.janrufmonitor.repository.filter.AttributeFilter)7