use of de.janrufmonitor.repository.imexport.ICallerImporter in project janrufmonitor by tbrandt77.
the class ConsoleImport method execute.
public void execute() throws Exception {
this.isExecuting = true;
if (this.getExecuteParams().length != 1) {
System.out.println("ERROR: Paramters are invalid. Please specify a valid module for installation.");
this.isExecuting = false;
return;
}
String filename = this.getExecuteParams()[0];
IImExporter imp = ImExportFactory.getInstance().getImporter("OldDatFileCallerImporter");
if (imp != null && imp instanceof ICallerImporter) {
((ICallerImporter) imp).setFilename(filename);
ICallerList cl = ((ICallerImporter) imp).doImport();
ICallerManager mgr = this.getRuntime().getCallerManagerFactory().getCallerManager("CallerDirectory");
if (mgr != null && mgr.isActive() && mgr.isSupported(IWriteCallerRepository.class)) {
((IWriteCallerRepository) mgr).setCaller(cl);
System.out.println("INFO: Successfully imported " + cl.size() + " caller entries.");
} else {
System.out.println("ERROR: Caller manager is missing.");
}
} else {
System.out.println("ERROR: import filter for DAT files is missing.");
}
this.isExecuting = false;
}
Aggregations