Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
bba686f2
by Tony CHEMIT at 2018-07-19T11:48:09Z
19 changed files:
- client-configuration/src/main/config/Client.ini
- client-configuration/src/main/resources/i18n/client-configuration_en_GB.properties
- client-configuration/src/main/resources/i18n/client-configuration_es_ES.properties
- client-configuration/src/main/resources/i18n/client-configuration_fr_FR.properties
- client/src/main/assembly/dist/obstuna-admin/README.txt
- + client/src/main/assembly/dist/obstuna-admin/create-server.bat
- + client/src/main/assembly/dist/obstuna-admin/create-server.sh
- + client/src/main/assembly/dist/obstuna-admin/drop-server.bat
- + client/src/main/assembly/dist/obstuna-admin/drop-server.sh
- + client/src/main/assembly/dist/obstuna-admin/update-security-server.bat
- + client/src/main/assembly/dist/obstuna-admin/update-security-server.sh
- + client/src/main/assembly/dist/obstuna-admin/update-server.bat
- + client/src/main/assembly/dist/obstuna-admin/update-server.sh
- client/src/main/java/fr/ird/observe/client/ObserveCLAction.java
- client/src/main/java/fr/ird/observe/client/ui/storage/ObstunaAdminAction.java
- client/src/main/java/fr/ird/observe/client/ui/storage/RemoteUILauncher.java
- server-configuration/src/main/resources/observeweb-log4j.conf
- server/src/main/java/fr/ird/observe/server/controller/v1/DataSourceServiceRestApi.java
- services/src/main/java/fr/ird/observe/services/service/DataSourceService.java
Changes:
| ... | ... | @@ -624,6 +624,11 @@ description = observe.action.commandline.launch.obstuna.admin.ui |
| 624 | 624 |
action = "fr.ird.observe.client.ObserveCLAction#launchObstunaAdminUI"
|
| 625 | 625 |
aliases = --obstuna-admin
|
| 626 | 626 |
|
| 627 |
+[action serverAdminUi]
|
|
| 628 |
+description = observe.action.commandline.launch.server.admin.ui
|
|
| 629 |
+action = "fr.ird.observe.client.ObserveCLAction#launchServerAdminUI"
|
|
| 630 |
+aliases = --server-admin
|
|
| 631 |
+ |
|
| 627 | 632 |
[action h2ServerMode]
|
| 628 | 633 |
description = observe.action.commandline.launch.h2.server.mode
|
| 629 | 634 |
action = "fr.ird.observe.client.ObserveCLAction#launchH2ServerMode"
|
| ... | ... | @@ -7,6 +7,7 @@ observe.action.commandline.help.ui=Show gui help |
| 7 | 7 |
observe.action.commandline.launch.admin.ui=Launch an administration task
|
| 8 | 8 |
observe.action.commandline.launch.h2.server.mode=Launch ObServe in server mode
|
| 9 | 9 |
observe.action.commandline.launch.obstuna.admin.ui=Launch an adminstration task on obstuna
|
| 10 |
+observe.action.commandline.launch.server.admin.ui=Launch an adminstration task on server
|
|
| 10 | 11 |
observe.action.commandline.use.jmx=Add JMX support
|
| 11 | 12 |
observe.config.backup.atClose=Perform a backup of local source when closing application
|
| 12 | 13 |
observe.config.backup.delay=Delay in minutes between local data source backup
|
| ... | ... | @@ -7,6 +7,7 @@ observe.action.commandline.help.ui=Mostrar el manual de usuario (modo grafico) |
| 7 | 7 |
observe.action.commandline.launch.admin.ui=Ejecutar una operación de administración
|
| 8 | 8 |
observe.action.commandline.launch.h2.server.mode=Ejecutar ObServe en modo servidor
|
| 9 | 9 |
observe.action.commandline.launch.obstuna.admin.ui=Ejecutar una operación de administración sobre Obstuna
|
| 10 |
+observe.action.commandline.launch.server.admin.ui=Lancer une opération d'administration sur un serveur \#TODO
|
|
| 10 | 11 |
observe.action.commandline.use.jmx=Mostrar el soporte JMX
|
| 11 | 12 |
observe.config.backup.atClose=Realizar una copia de seguridad de la base de datos local al cerrar la aplicación
|
| 12 | 13 |
observe.config.backup.delay=Minutos entre cada copia de seguridad de la base de datos local
|
| ... | ... | @@ -7,6 +7,7 @@ observe.action.commandline.help.ui=Afficher le manuel utilisateur (mode graphiqu |
| 7 | 7 |
observe.action.commandline.launch.admin.ui=Lancer une opération d'administration
|
| 8 | 8 |
observe.action.commandline.launch.h2.server.mode=Lancer ObServe en mode serveur
|
| 9 | 9 |
observe.action.commandline.launch.obstuna.admin.ui=Lancer une opération d'administration sur Obstuna
|
| 10 |
+observe.action.commandline.launch.server.admin.ui=Lancer une opération d'administration sur un serveur
|
|
| 10 | 11 |
observe.action.commandline.use.jmx=Ajouter le support JMX
|
| 11 | 12 |
observe.config.backup.atClose=Effectuer une sauvegarde de la base locale à la fermeture de l'application
|
| 12 | 13 |
observe.config.backup.delay=Temps en minutes entre chaque sauvegarde de la base locale
|
| ... | ... | @@ -6,7 +6,7 @@ Lancer le script (sh) |
| 6 | 6 |
|
| 7 | 7 |
./createdb/create-ird_obstuna.sh
|
| 8 | 8 |
|
| 9 |
-Puis lancer ObServe en mode création de base obstuna
|
|
| 9 |
+puis
|
|
| 10 | 10 |
|
| 11 | 11 |
./create-obstuna.sh
|
| 12 | 12 |
|
| ... | ... | @@ -27,8 +27,6 @@ ou |
| 27 | 27 |
Pour mettre à jour la sécurité sur une base obstuna
|
| 28 | 28 |
---------------------------------------------------
|
| 29 | 29 |
|
| 30 |
-Il faut ensuite lancer l'action de mise à jour de base via ObServe :
|
|
| 31 |
- |
|
| 32 | 30 |
./update-security-obstuna.sh
|
| 33 | 31 |
|
| 34 | 32 |
ou
|
| ... | ... | @@ -43,3 +41,47 @@ Pour vider une base obstuna |
| 43 | 41 |
ou
|
| 44 | 42 |
|
| 45 | 43 |
./drop-obstuna.bat
|
| 44 |
+ |
|
| 45 |
+ |
|
| 46 |
+Pour créer une nouvelle base via server
|
|
| 47 |
+------------------------------------------
|
|
| 48 |
+ |
|
| 49 |
+Lancer le script (sh)
|
|
| 50 |
+ |
|
| 51 |
+./createdb/create-ird_obstuna.sh
|
|
| 52 |
+ |
|
| 53 |
+puis
|
|
| 54 |
+ |
|
| 55 |
+./create-server.sh
|
|
| 56 |
+ |
|
| 57 |
+ou
|
|
| 58 |
+ |
|
| 59 |
+./create-server.bat
|
|
| 60 |
+ |
|
| 61 |
+ |
|
| 62 |
+Pour mettre à jour une base via serveur
|
|
| 63 |
+---------------------------------------
|
|
| 64 |
+ |
|
| 65 |
+./update-server.sh
|
|
| 66 |
+ |
|
| 67 |
+ou
|
|
| 68 |
+ |
|
| 69 |
+./update-server.bat
|
|
| 70 |
+ |
|
| 71 |
+Pour mettre à jour la sécurité sur une base via serveur
|
|
| 72 |
+-------------------------------------------------------
|
|
| 73 |
+ |
|
| 74 |
+./update-security-server.sh
|
|
| 75 |
+ |
|
| 76 |
+ou
|
|
| 77 |
+ |
|
| 78 |
+./update-security-server.bat
|
|
| 79 |
+ |
|
| 80 |
+Pour vider une base via serveur
|
|
| 81 |
+-------------------------------
|
|
| 82 |
+ |
|
| 83 |
+./drop-server.sh
|
|
| 84 |
+ |
|
| 85 |
+ou
|
|
| 86 |
+ |
|
| 87 |
+./drop-server.bat
|
| 1 |
+ |
|
| 2 |
+java -Xmx512M -Xms512M -jar ../${project.build.finalName}.jar --server-admin create
|
|
| \ No newline at end of file |
| 1 |
+###
|
|
| 2 |
+# #%L
|
|
| 3 |
+# ObServe :: Admin Client
|
|
| 4 |
+#
|
|
| 5 |
+# $Id$
|
|
| 6 |
+# $HeadURL$
|
|
| 7 |
+# %%
|
|
| 8 |
+# Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
|
|
| 9 |
+# %%
|
|
| 10 |
+# This program is free software: you can redistribute it and/or modify
|
|
| 11 |
+# it under the terms of the GNU General Public License as
|
|
| 12 |
+# published by the Free Software Foundation, either version 3 of the
|
|
| 13 |
+# License, or (at your option) any later version.
|
|
| 14 |
+#
|
|
| 15 |
+# This program is distributed in the hope that it will be useful,
|
|
| 16 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 17 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 18 |
+# GNU General Public License for more details.
|
|
| 19 |
+#
|
|
| 20 |
+# You should have received a copy of the GNU General Public
|
|
| 21 |
+# License along with this program. If not, see
|
|
| 22 |
+# <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 23 |
+# #L%
|
|
| 24 |
+###
|
|
| 25 |
+#!/bin/sh
|
|
| 26 |
+# Pour créer une nouvelle base obstuna (le schéma sera créer et le référentiel rempli)
|
|
| 27 |
+ |
|
| 28 |
+java -Xmx512M -Xms512M -jar ../${project.build.finalName}.jar --server-admin create
|
|
| \ No newline at end of file |
| 1 |
+ |
|
| 2 |
+java -Xmx512M -Xms512M -jar ../${project.build.finalName}.jar --server-admin drop
|
|
| \ No newline at end of file |
| 1 |
+###
|
|
| 2 |
+# #%L
|
|
| 3 |
+# ObServe :: Admin Client
|
|
| 4 |
+#
|
|
| 5 |
+# $Id$
|
|
| 6 |
+# $HeadURL$
|
|
| 7 |
+# %%
|
|
| 8 |
+# Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
|
|
| 9 |
+# %%
|
|
| 10 |
+# This program is free software: you can redistribute it and/or modify
|
|
| 11 |
+# it under the terms of the GNU General Public License as
|
|
| 12 |
+# published by the Free Software Foundation, either version 3 of the
|
|
| 13 |
+# License, or (at your option) any later version.
|
|
| 14 |
+#
|
|
| 15 |
+# This program is distributed in the hope that it will be useful,
|
|
| 16 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 17 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 18 |
+# GNU General Public License for more details.
|
|
| 19 |
+#
|
|
| 20 |
+# You should have received a copy of the GNU General Public
|
|
| 21 |
+# License along with this program. If not, see
|
|
| 22 |
+# <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 23 |
+# #L%
|
|
| 24 |
+###
|
|
| 25 |
+#!/bin/sh
|
|
| 26 |
+# Pour vider une base obstuna (toutes les tables seront supprimées)
|
|
| 27 |
+ |
|
| 28 |
+java -Xmx512M -Xms512M -jar ../${project.build.finalName}.jar --server-admin drop
|
|
| \ No newline at end of file |
| 1 |
+ |
|
| 2 |
+java -Xmx512M -Xms512M -jar ../${project.build.finalName}.jar --server-admin security
|
|
| \ No newline at end of file |
| 1 |
+###
|
|
| 2 |
+# #%L
|
|
| 3 |
+# ObServe :: Admin Client
|
|
| 4 |
+#
|
|
| 5 |
+# $Id$
|
|
| 6 |
+# $HeadURL$
|
|
| 7 |
+# %%
|
|
| 8 |
+# Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
|
|
| 9 |
+# %%
|
|
| 10 |
+# This program is free software: you can redistribute it and/or modify
|
|
| 11 |
+# it under the terms of the GNU General Public License as
|
|
| 12 |
+# published by the Free Software Foundation, either version 3 of the
|
|
| 13 |
+# License, or (at your option) any later version.
|
|
| 14 |
+#
|
|
| 15 |
+# This program is distributed in the hope that it will be useful,
|
|
| 16 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 17 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 18 |
+# GNU General Public License for more details.
|
|
| 19 |
+#
|
|
| 20 |
+# You should have received a copy of the GNU General Public
|
|
| 21 |
+# License along with this program. If not, see
|
|
| 22 |
+# <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 23 |
+# #L%
|
|
| 24 |
+###
|
|
| 25 |
+#!/bin/sh
|
|
| 26 |
+# Pour mettre à jour la sécurité sur une base postgres
|
|
| 27 |
+ |
|
| 28 |
+java -Xmx512M -Xms512M -jar ../${project.build.finalName}.jar --server-admin security
|
|
| \ No newline at end of file |
| 1 |
+ |
|
| 2 |
+java -Xmx2048M -Xms512M -jar ../${project.build.finalName}.jar --server-admin update
|
|
| \ No newline at end of file |
| 1 |
+###
|
|
| 2 |
+# #%L
|
|
| 3 |
+# ObServe :: Admin Client
|
|
| 4 |
+#
|
|
| 5 |
+# $Id$
|
|
| 6 |
+# $HeadURL$
|
|
| 7 |
+# %%
|
|
| 8 |
+# Copyright (C) 2008 - 2010 IRD, Codelutin, Tony Chemit
|
|
| 9 |
+# %%
|
|
| 10 |
+# This program is free software: you can redistribute it and/or modify
|
|
| 11 |
+# it under the terms of the GNU General Public License as
|
|
| 12 |
+# published by the Free Software Foundation, either version 3 of the
|
|
| 13 |
+# License, or (at your option) any later version.
|
|
| 14 |
+#
|
|
| 15 |
+# This program is distributed in the hope that it will be useful,
|
|
| 16 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 17 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 18 |
+# GNU General Public License for more details.
|
|
| 19 |
+#
|
|
| 20 |
+# You should have received a copy of the GNU General Public
|
|
| 21 |
+# License along with this program. If not, see
|
|
| 22 |
+# <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 23 |
+# #L%
|
|
| 24 |
+###
|
|
| 25 |
+#!/bin/sh
|
|
| 26 |
+# Pour mettre à jour une base server (le schéma sera mis à jour si nécessaire)
|
|
| 27 |
+ |
|
| 28 |
+java -Xmx1536M -Xms512M -jar ../${project.build.finalName}.jar --server-admin update
|
|
| \ No newline at end of file |
| ... | ... | @@ -176,7 +176,39 @@ public class ObserveCLAction { |
| 176 | 176 |
getConfig().setObstunaCanMigrate(true);
|
| 177 | 177 |
}
|
| 178 | 178 |
|
| 179 |
- RemoteUILauncher launcher = operation.newLauncher(context, null);
|
|
| 179 |
+ RemoteUILauncher launcher = operation.newLauncher(context, null, false);
|
|
| 180 |
+ |
|
| 181 |
+ Runnable runnable = createRunnable(launcher, "start");
|
|
| 182 |
+ launchAction(t(launcher.getTitle()), runnable);
|
|
| 183 |
+ }
|
|
| 184 |
+ |
|
| 185 |
+ @SuppressWarnings("unused")
|
|
| 186 |
+ public void launchServerAdminUI(String operationName) throws InterruptedException {
|
|
| 187 |
+ |
|
| 188 |
+ disableMainUI();
|
|
| 189 |
+ |
|
| 190 |
+ EnumSet<ObstunaAdminAction> operations = EnumSet.allOf(ObstunaAdminAction.class);
|
|
| 191 |
+ |
|
| 192 |
+ ObstunaAdminAction operation = ObstunaAdminAction.valueOfIgnoreCase(operationName);
|
|
| 193 |
+ if (operation == null) {
|
|
| 194 |
+ if (log.isErrorEnabled()) {
|
|
| 195 |
+ log.error(operationName + " is not a known obstuna admin operation.");
|
|
| 196 |
+ log.error("Use one of these ones : " + operations);
|
|
| 197 |
+ }
|
|
| 198 |
+ return;
|
|
| 199 |
+ }
|
|
| 200 |
+ |
|
| 201 |
+ ObserveSwingApplicationContext context = ObserveSwingApplicationContext.get();
|
|
| 202 |
+ |
|
| 203 |
+ // FIXME
|
|
| 204 |
+// getConfig().setOption(AbstractDataSourceMigration.AUTO_MIGRATE, "false");
|
|
| 205 |
+ |
|
| 206 |
+ if (operation == ObstunaAdminAction.UPDATE ||
|
|
| 207 |
+ operation == ObstunaAdminAction.CREATE) {
|
|
| 208 |
+ getConfig().setObstunaCanMigrate(true);
|
|
| 209 |
+ }
|
|
| 210 |
+ |
|
| 211 |
+ RemoteUILauncher launcher = operation.newLauncher(context, null, true);
|
|
| 180 | 212 |
|
| 181 | 213 |
Runnable runnable = createRunnable(launcher, "start");
|
| 182 | 214 |
launchAction(t(launcher.getTitle()), runnable);
|
| ... | ... | @@ -21,7 +21,6 @@ |
| 21 | 21 |
*/
|
| 22 | 22 |
package fr.ird.observe.client.ui.storage;
|
| 23 | 23 |
|
| 24 |
-import com.google.common.base.Preconditions;
|
|
| 25 | 24 |
import com.google.common.collect.ImmutableSet;
|
| 26 | 25 |
import fr.ird.observe.client.ObserveSwingApplicationContext;
|
| 27 | 26 |
import fr.ird.observe.client.constants.DbMode;
|
| ... | ... | @@ -44,6 +43,7 @@ import org.nuiton.jaxx.runtime.JAXXContext; |
| 44 | 43 |
import org.nuiton.version.Version;
|
| 45 | 44 |
|
| 46 | 45 |
import java.awt.Window;
|
| 46 |
+import java.util.Objects;
|
|
| 47 | 47 |
import java.util.stream.Collectors;
|
| 48 | 48 |
|
| 49 | 49 |
import static org.nuiton.i18n.I18n.t;
|
| ... | ... | @@ -64,8 +64,8 @@ public enum ObstunaAdminAction { |
| 64 | 64 |
*/
|
| 65 | 65 |
CREATE() {
|
| 66 | 66 |
@Override
|
| 67 |
- public RemoteUILauncher newLauncher(JAXXContext context, Window frame) {
|
|
| 68 |
- return new RemoteUILauncher(this, context, frame, I18nEnumHelper.getLabel(this)) {
|
|
| 67 |
+ public RemoteUILauncher newLauncher(JAXXContext context, Window frame, boolean serverMode) {
|
|
| 68 |
+ return new RemoteUILauncher(this, context, frame, I18nEnumHelper.getLabel(this),serverMode ) {
|
|
| 69 | 69 |
|
| 70 | 70 |
DataSourceCreateConfigurationDto createConfigurationDto;
|
| 71 | 71 |
ObserveSwingDataSource dataSource;
|
| ... | ... | @@ -83,19 +83,9 @@ public enum ObstunaAdminAction { |
| 83 | 83 |
|
| 84 | 84 |
void checkImportDbVersion(StorageUIModel model, ObserveDataSourceConfiguration dataSourceConfig) throws DatabaseConnexionNotAuthorizedException, DatabaseNotFoundException, BabModelVersionException {
|
| 85 | 85 |
|
| 86 |
- ObserveSwingDataSource importDataSource = ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(dataSourceConfig);
|
|
| 87 |
- |
|
| 88 |
- Preconditions.checkState(importDataSource != null, "Can't select data on a null dataSource");
|
|
| 89 |
- |
|
| 90 |
- try {
|
|
| 91 |
- |
|
| 92 |
- importDataSource.open();
|
|
| 93 |
- |
|
| 94 |
- model.checkImportDbVersion(importDataSource);
|
|
| 95 |
- |
|
| 96 |
- } finally {
|
|
| 97 |
- |
|
| 98 |
- importDataSource.close();
|
|
| 86 |
+ try (ObserveSwingDataSource importDataSource = Objects.requireNonNull(ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(dataSourceConfig))) {
|
|
| 87 |
+ importDataSource.open();
|
|
| 88 |
+ model.checkImportDbVersion(importDataSource);
|
|
| 99 | 89 |
}
|
| 100 | 90 |
|
| 101 | 91 |
}
|
| ... | ... | @@ -189,8 +179,8 @@ public enum ObstunaAdminAction { |
| 189 | 179 |
*/
|
| 190 | 180 |
UPDATE() {
|
| 191 | 181 |
@Override
|
| 192 |
- public RemoteUILauncher newLauncher(JAXXContext context, Window frame) {
|
|
| 193 |
- return new RemoteUILauncher(this, context, frame, I18nEnumHelper.getLabel(this)) {
|
|
| 182 |
+ public RemoteUILauncher newLauncher(JAXXContext context, Window frame, boolean serverMode) {
|
|
| 183 |
+ return new RemoteUILauncher(this, context, frame, I18nEnumHelper.getLabel(this),serverMode ) {
|
|
| 194 | 184 |
|
| 195 | 185 |
ObserveSwingDataSource dataSource;
|
| 196 | 186 |
ObserveDataSourceInformation dataSourceInformation;
|
| ... | ... | @@ -248,8 +238,8 @@ public enum ObstunaAdminAction { |
| 248 | 238 |
*/
|
| 249 | 239 |
SECURITY() {
|
| 250 | 240 |
@Override
|
| 251 |
- public RemoteUILauncher newLauncher(JAXXContext context, Window frame) {
|
|
| 252 |
- return new RemoteUILauncher(this, context, frame, I18nEnumHelper.getLabel(this)) {
|
|
| 241 |
+ public RemoteUILauncher newLauncher(JAXXContext context, Window frame, boolean serverMode) {
|
|
| 242 |
+ return new RemoteUILauncher(this, context, frame, I18nEnumHelper.getLabel(this),serverMode ) {
|
|
| 253 | 243 |
|
| 254 | 244 |
ObserveSwingDataSource dataSource;
|
| 255 | 245 |
ImmutableSet<ObserveDbUserDto> users;
|
| ... | ... | @@ -291,7 +281,7 @@ public enum ObstunaAdminAction { |
| 291 | 281 |
return null;
|
| 292 | 282 |
}
|
| 293 | 283 |
|
| 294 |
- public abstract RemoteUILauncher newLauncher(JAXXContext context, Window frame);
|
|
| 284 |
+ public abstract RemoteUILauncher newLauncher(JAXXContext context, Window frame, boolean serverMode);
|
|
| 295 | 285 |
|
| 296 | 286 |
@Override
|
| 297 | 287 |
public String toString() {
|
| ... | ... | @@ -310,7 +300,6 @@ public enum ObstunaAdminAction { |
| 310 | 300 |
dataSource = ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(pgConfig);
|
| 311 | 301 |
} else {
|
| 312 | 302 |
ObserveDataSourceConfigurationRest restConfig = model.getRestConfig();
|
| 313 |
- |
|
| 314 | 303 |
dataSource = ObserveSwingApplicationContext.get().getDataSourcesManager().newDataSource(restConfig);
|
| 315 | 304 |
}
|
| 316 | 305 |
return dataSource;
|
| ... | ... | @@ -6,15 +6,15 @@ |
| 6 | 6 |
* %%
|
| 7 | 7 |
* This program is free software: you can redistribute it and/or modify
|
| 8 | 8 |
* it under the terms of the GNU General Public License as
|
| 9 |
- * published by the Free Software Foundation, either version 3 of the
|
|
| 9 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 10 | 10 |
* License, or (at your option) any later version.
|
| 11 |
- *
|
|
| 11 |
+ *
|
|
| 12 | 12 |
* This program is distributed in the hope that it will be useful,
|
| 13 | 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | 15 |
* GNU General Public License for more details.
|
| 16 |
- *
|
|
| 17 |
- * You should have received a copy of the GNU General Public
|
|
| 16 |
+ *
|
|
| 17 |
+ * You should have received a copy of the GNU General Public
|
|
| 18 | 18 |
* License along with this program. If not, see
|
| 19 | 19 |
* <http://www.gnu.org/licenses/gpl-3.0.html>.
|
| 20 | 20 |
* #L%
|
| ... | ... | @@ -43,15 +43,17 @@ public abstract class RemoteUILauncher extends StorageUILauncher { |
| 43 | 43 |
|
| 44 | 44 |
/** Logger */
|
| 45 | 45 |
private static final Log log = LogFactory.getLog(RemoteUILauncher.class);
|
| 46 |
- |
|
| 46 |
+ private final boolean serverMode;
|
|
| 47 | 47 |
protected ObstunaAdminAction action;
|
| 48 | 48 |
|
| 49 | 49 |
public RemoteUILauncher(ObstunaAdminAction action,
|
| 50 | 50 |
JAXXContext context,
|
| 51 | 51 |
Window frame,
|
| 52 |
- String title) {
|
|
| 52 |
+ String title,
|
|
| 53 |
+ boolean serverMode) {
|
|
| 53 | 54 |
super(context, frame, title);
|
| 54 | 55 |
this.action = action;
|
| 56 |
+ this.serverMode = serverMode;
|
|
| 55 | 57 |
}
|
| 56 | 58 |
|
| 57 | 59 |
@Override
|
| ... | ... | @@ -63,7 +65,7 @@ public abstract class RemoteUILauncher extends StorageUILauncher { |
| 63 | 65 |
model.setCanUseLocalService(false);
|
| 64 | 66 |
model.setCanUseRemoteService(true);
|
| 65 | 67 |
model.setCanUseServerService(true);
|
| 66 |
- model.setDbMode(DbMode.USE_REMOTE);
|
|
| 68 |
+ model.setDbMode(serverMode ? DbMode.USE_SERVER : DbMode.USE_REMOTE);
|
|
| 67 | 69 |
model.setAdminAction(action);
|
| 68 | 70 |
|
| 69 | 71 |
List<StorageStep> steps = new ArrayList<>();
|
| ... | ... | @@ -36,7 +36,8 @@ log4j.appender.file.layout.ConversionPattern=%-5p %d{ISO8601} [%t] %40C{1} :%4L |
| 36 | 36 |
log4j.logger.fr.ird.observe=INFO
|
| 37 | 37 |
log4j.logger.fr.ird.observe.client.validators=WARN
|
| 38 | 38 |
log4j.logger.io.ultreia=INFO
|
| 39 |
-log4j.logger.org.nuiton.topia.migration=INFO
|
|
| 39 |
+log4j.logger.org.nuiton.topia.service.sql=INFO
|
|
| 40 |
+log4j.logger.org.nuiton.topia.service.migration=INFO
|
|
| 40 | 41 |
log4j.logger.org.hibernate.orm.deprecation=ERROR
|
| 41 | 42 |
log4j.logger.com.zaxxer.hikari.HikariDataSource=ERROR
|
| 42 | 43 |
log4j.logger.com.opensymphony.xwork2.validator.validators=ERROR
|
| ... | ... | @@ -127,7 +127,7 @@ public class DataSourceServiceRestApi extends GeneratedDataSourceServiceRestApi |
| 127 | 127 |
@Override
|
| 128 | 128 |
public void migrateData(ObserveDataSourceConfiguration dataSourceConfiguration) {
|
| 129 | 129 |
ObserveDataSourceConfiguration dataSourceConfigurationTopia = getTopiaDataSourceConfiguration(dataSourceConfiguration);
|
| 130 |
- getAnonymousService(dataSourceConfigurationTopia).migrateData(dataSourceConfiguration);
|
|
| 130 |
+ getAnonymousService(dataSourceConfigurationTopia).migrateData(dataSourceConfigurationTopia);
|
|
| 131 | 131 |
}
|
| 132 | 132 |
|
| 133 | 133 |
protected ObserveDataSourceConfiguration getTopiaDataSourceConfiguration(ObserveDataSourceConfiguration dataSourceConfigurationFromRequest) {
|
| ... | ... | @@ -61,7 +61,7 @@ public interface DataSourceService extends ObserveService, Closeable { |
| 61 | 61 |
@Get(addAuthtoken = false)
|
| 62 | 62 |
void applySecurity(ObserveDataSourceConfiguration dataSourceConfiguration, ImmutableSet<ObserveDbUserDto> users);
|
| 63 | 63 |
|
| 64 |
- @Get(addAuthtoken = false)
|
|
| 64 |
+ @Get(addAuthtoken = false, timeOut = 1000)
|
|
| 65 | 65 |
void migrateData(ObserveDataSourceConfiguration dataSourceConfiguration);
|
| 66 | 66 |
|
| 67 | 67 |
@Get
|