| ... |
... |
@@ -37,14 +37,14 @@ import fr.ird.observe.services.configuration.ObserveDataSourceInformation; |
|
37
|
37
|
import fr.ird.observe.services.service.BabModelVersionException;
|
|
38
|
38
|
import fr.ird.observe.services.service.DatabaseConnexionNotAuthorizedException;
|
|
39
|
39
|
import fr.ird.observe.services.service.DatabaseNotFoundException;
|
|
40
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
41
|
|
-import org.apache.commons.logging.Log;
|
|
42
|
|
-import org.apache.commons.logging.LogFactory;
|
|
43
|
|
-
|
|
44
|
40
|
import java.beans.PropertyChangeListener;
|
|
45
|
41
|
import java.io.File;
|
|
46
|
42
|
import java.util.EnumSet;
|
|
47
|
43
|
import java.util.Objects;
|
|
|
44
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
45
|
+import org.apache.commons.logging.Log;
|
|
|
46
|
+import org.apache.commons.logging.LogFactory;
|
|
|
47
|
+
|
|
48
|
48
|
|
|
49
|
49
|
import static fr.ird.observe.application.swing.configuration.constants.DbMode.USE_LOCAL;
|
|
50
|
50
|
import static fr.ird.observe.application.swing.configuration.constants.DbMode.USE_REMOTE;
|
| ... |
... |
@@ -463,7 +463,7 @@ public class ConfigModel extends AdminActionModel { |
|
463
|
463
|
}
|
|
464
|
464
|
}
|
|
465
|
465
|
|
|
466
|
|
- protected void startIncomingSourceModel(AdminUI ui) {
|
|
|
466
|
+ protected void startIncomingSourceModel(AdminUI ui, final ObserveDataSourceInformation previousSourceInfo) {
|
|
467
|
467
|
|
|
468
|
468
|
AdminUIModel uiModel = ui.getModel();
|
|
469
|
469
|
|
| ... |
... |
@@ -476,7 +476,6 @@ public class ConfigModel extends AdminActionModel { |
|
476
|
476
|
ObserveSwingDataSource previousSource = getPreviousSource();
|
|
477
|
477
|
|
|
478
|
478
|
ObserveDataSourceConfiguration previousSourceConfig = null;
|
|
479
|
|
- ObserveDataSourceInformation previousSourceInfo = null;
|
|
480
|
479
|
|
|
481
|
480
|
EnumSet<DbMode> authorizedModes = uiModel.getIncomingDataSourceMode();
|
|
482
|
481
|
EnumSet<DbMode> modes = EnumSet.noneOf(DbMode.class);
|
| ... |
... |
@@ -508,7 +507,7 @@ public class ConfigModel extends AdminActionModel { |
|
508
|
507
|
|
|
509
|
508
|
try {
|
|
510
|
509
|
previousSourceConfig = previousSource.getConfiguration().clone();
|
|
511
|
|
- previousSourceInfo = previousSource.getInformation();
|
|
|
510
|
+// previousSourceInfo = previousSource.getInformation();
|
|
512
|
511
|
} catch (CloneNotSupportedException e) {
|
|
513
|
512
|
if (log.isErrorEnabled()) {
|
|
514
|
513
|
log.error("con not clone previous data configuration", e);
|
| ... |
... |
@@ -602,15 +601,17 @@ public class ConfigModel extends AdminActionModel { |
|
602
|
601
|
// avant le demarrage du wizard, on ferme toujours la source
|
|
603
|
602
|
// en cours d'utilisation
|
|
604
|
603
|
|
|
|
604
|
+ ObserveDataSourceInformation previousSourceInformation = null;
|
|
605
|
605
|
if (previousSource != null && previousSource.isOpen()) {
|
|
606
|
606
|
|
|
|
607
|
+ previousSourceInformation = previousSource.getInformation();
|
|
607
|
608
|
if (log.isDebugEnabled()) {
|
|
608
|
609
|
log.debug("Close previous source " + previousSource.getLabel());
|
|
609
|
610
|
}
|
|
610
|
611
|
doCloseSource(previousSource);
|
|
611
|
612
|
}
|
|
612
|
613
|
|
|
613
|
|
- startIncomingSourceModel(ui);
|
|
|
614
|
+ startIncomingSourceModel(ui, previousSourceInformation);
|
|
614
|
615
|
|
|
615
|
616
|
startCentralSourceModel(ui);
|
|
616
|
617
|
|