diff --git a/back/pom.xml b/back/pom.xml
index bbbbd1e..be39dee 100644
--- a/back/pom.xml
+++ b/back/pom.xml
@@ -20,7 +20,7 @@
kangaroo-and-rabbit
archidata
- 0.20.0
+ 0.20.2
diff --git a/back/src/org/kar/karusic/WebLauncher.java b/back/src/org/kar/karusic/WebLauncher.java
index 058f527..9a9ad63 100755
--- a/back/src/org/kar/karusic/WebLauncher.java
+++ b/back/src/org/kar/karusic/WebLauncher.java
@@ -39,7 +39,6 @@ import org.kar.karusic.migration.Migration20240225;
import org.kar.karusic.migration.Migration20240226;
import org.kar.karusic.migration.Migration20240907;
import org.kar.karusic.migration.Migration20250104;
-import org.kar.karusic.migration.Migration20250105;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.bridge.SLF4JBridgeHandler;
@@ -50,15 +49,15 @@ public class WebLauncher {
final static Logger LOGGER = LoggerFactory.getLogger(WebLauncher.class);
protected UpdateJwtPublicKey keyUpdater = null;
protected HttpServer server = null;
-
+
public WebLauncher() {
ConfigBaseVariable.bdDatabase = "karusic";
}
-
+
private static URI getBaseURI() {
return UriBuilder.fromUri(ConfigBaseVariable.getlocalAddress()).build();
}
-
+
public void migrateDB() throws Exception {
WebLauncher.LOGGER.info("Create migration engine");
final MigrationEngine migrationEngine = new MigrationEngine();
@@ -70,21 +69,20 @@ public class WebLauncher {
migrationEngine.add(new Migration20240226());
migrationEngine.add(new Migration20240907());
migrationEngine.add(new Migration20250104());
- migrationEngine.add(new Migration20250105());
WebLauncher.LOGGER.info("Migrate the DB [START]");
migrationEngine.migrateWaitAdmin(new DbConfig());
WebLauncher.LOGGER.info("Migrate the DB [STOP]");
}
-
+
public static void main(final String[] args) throws Exception {
// Loop-back of logger JDK logging API to SLF4J
LogManager.getLogManager().reset();
SLF4JBridgeHandler.install();
-
+
WebLauncher.LOGGER.info("[START] application wake UP");
final WebLauncher launcher = new WebLauncher();
launcher.migrateDB();
-
+
launcher.process();
WebLauncher.LOGGER.info("end-configure the server & wait finish process:");
Thread.currentThread().join();
@@ -92,7 +90,7 @@ public class WebLauncher {
launcher.stopOther();
WebLauncher.LOGGER.info("STOP the REST server:");
}
-
+
public void plop(final String aaa) {
// List available Image Readers
WebLauncher.LOGGER.trace("Available Image Readers:");
@@ -103,7 +101,7 @@ public class WebLauncher {
WebLauncher.LOGGER.trace("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
// ImageIO.deregisterServiceProvider(reader.getOriginatingProvider());
}
-
+
// List available Image Writers
WebLauncher.LOGGER.trace("\nAvailable Image Writers:");
final Iterator writers = ImageIO.getImageWritersByFormatName(aaa);
@@ -113,9 +111,9 @@ public class WebLauncher {
WebLauncher.LOGGER.trace("Writer CN: " + writer.getOriginatingProvider().getPluginClassName());
}
}
-
+
public void process() throws InterruptedException, DataAccessException {
-
+
ImageIO.scanForPlugins();
plop("jpeg");
plop("png");
@@ -125,7 +123,7 @@ public class WebLauncher {
// Configure resources
// ===================================================================
final ResourceConfig rc = new ResourceConfig();
-
+
// add multipart models ..
rc.register(MultiPartFeature.class);
// global authentication system
@@ -145,17 +143,17 @@ public class WebLauncher {
rc.register(TrackResource.class);
rc.register(DataResource.class);
rc.register(ProxyResource.class);
-
+
rc.register(HealthCheck.class);
rc.register(Front.class);
-
+
ContextGenericTools.addJsr310(rc);
-
+
// add jackson to be discover when we are ins standalone server
rc.register(JacksonFeature.class);
// enable this to show low level request
// rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName());
-
+
// System.out.println("Connect on the BDD:");
// System.out.println(" getDBHost: '" + ConfigVariable.getDBHost() + "'");
// System.out.println(" getDBPort: '" + ConfigVariable.getDBPort() + "'");
@@ -173,13 +171,13 @@ public class WebLauncher {
serverLink.shutdownNow();
}
}, "shutdownHook"));
-
+
// ===================================================================
// start periodic update of the token ...
// ===================================================================
this.keyUpdater = new UpdateJwtPublicKey();
this.keyUpdater.start();
-
+
// ===================================================================
// run JERSEY
// ===================================================================
@@ -191,14 +189,14 @@ public class WebLauncher {
e.printStackTrace();
}
}
-
+
public void stop() {
if (this.server != null) {
this.server.shutdownNow();
this.server = null;
}
}
-
+
public void stopOther() {
this.keyUpdater.kill();
try {
diff --git a/back/src/org/kar/karusic/migration/Migration20250105.java b/back/src/org/kar/karusic/migration/Migration20250105.java
deleted file mode 100644
index 1668394..0000000
--- a/back/src/org/kar/karusic/migration/Migration20250105.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.kar.karusic.migration;
-
-import org.kar.archidata.migration.MigrationSqlStep;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class Migration20250105 extends MigrationSqlStep {
- private static final Logger LOGGER = LoggerFactory.getLogger(Migration20240907.class);
-
- public static final int KARSO_INITIALISATION_ID = 1;
-
- @Override
- public String getName() {
- return "migration-2025-01-05: remove old UUID";
- }
-
- @Override
- public void generateStep() throws Exception {
- // addAction("""
- // ALTER TABLE `data` DROP INDEX `PRIMARY`;
- // """);
- // addAction("""
- // ALTER TABLE `data` CHANGE `id` `uuid` binary(16) DEFAULT (UUID_TO_BIN(UUID(), TRUE));
- // """);
- // addAction("""
- // ALTER TABLE `data` ADD PRIMARY KEY `uuid` (`uuid`);
- // """);
-
- }
-
-}
diff --git a/back/test/src/test/kar/karusic/TestBase.java b/back/test/src/test/kar/karusic/TestBase.java
index d315a4c..6e6b283 100644
--- a/back/test/src/test/kar/karusic/TestBase.java
+++ b/back/test/src/test/kar/karusic/TestBase.java
@@ -1,10 +1,9 @@
package test.kar.karusic;
-import java.util.UUID;
-
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.extension.ExtendWith;
import org.kar.archidata.tools.ConfigBaseVariable;
@@ -21,8 +20,6 @@ public class TestBase {
static WebLauncherTest webInterface = null;
static RESTApi api = null;
- private static UUID idTest;
-
@BeforeAll
public static void configureWebServer() throws Exception {
ConfigureDb.configure();
@@ -45,4 +42,9 @@ public class TestBase {
ConfigureDb.clear();
}
+ @Test
+ public static void TestEmpty() throws Exception {
+
+ }
+
}
diff --git a/back/test/src/test/kar/karusic/TestMongoDb.java b/back/test/src/test/kar/karusic/TestMongoDb.java
deleted file mode 100644
index f24a63a..0000000
--- a/back/test/src/test/kar/karusic/TestMongoDb.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package test.kar.karusic;
-
-import static org.bson.codecs.configuration.CodecRegistries.fromProviders;
-import static org.bson.codecs.configuration.CodecRegistries.fromRegistries;
-
-import java.io.IOException;
-
-import org.bson.codecs.configuration.CodecRegistry;
-import org.bson.codecs.pojo.PojoCodecProvider;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.MethodOrderer;
-import org.junit.jupiter.api.Order;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestMethodOrder;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.kar.karusic.model.Track;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.mongodb.ConnectionString;
-import com.mongodb.MongoClientSettings;
-import com.mongodb.client.MongoClient;
-import com.mongodb.client.MongoClients;
-import com.mongodb.client.MongoCollection;
-import com.mongodb.client.MongoDatabase;
-
-@ExtendWith(StepwiseExtension.class)
-@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
-public class TestMongoDb {
- final static private Logger LOGGER = LoggerFactory.getLogger(TestMongoDb.class);
-
- @BeforeAll
- public static void configureWebServer() throws Exception {}
-
- @AfterAll
- public static void removeDataBase() throws IOException {
-
- }
-
- @Order(1)
- @Test
- public void testCreateTable() throws Exception {
- final ConnectionString connectionString = new ConnectionString("mongodb://localhost:27017");// System.getProperty("mongodb.uri"));
- // Configure the CodecRegistry to include a codec to handle the translation to and from BSON for our POJOs.
- final CodecRegistry pojoCodecRegistry = fromProviders(PojoCodecProvider.builder().automatic(true).build());
- // Add the default codec registry, which contains all the default codecs. They can handle all the major types in
- // Java-like Boolean, Double, String, BigDecimal, etc.
- final CodecRegistry codecRegistry = fromRegistries(MongoClientSettings.getDefaultCodecRegistry(), pojoCodecRegistry);
- // Wrap all my settings together using MongoClientSettings.
- final MongoClientSettings clientSettings = MongoClientSettings.builder().applyConnectionString(connectionString).codecRegistry(codecRegistry).build();
- // Initiate the connection with MongoDB.
- try (MongoClient mongoClient = MongoClients.create(clientSettings)) {
- final MongoDatabase db = mongoClient.getDatabase("sample_training");
- final MongoCollection