org.apache.commons
@@ -178,13 +183,6 @@
cfg
migration
-
-
- src/main/resources/org.apache.unomi.start.cfg
-
- cfg
- start
-
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Setup.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Setup.java
new file mode 100644
index 000000000..9d4c3acd8
--- /dev/null
+++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Setup.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.shell.actions;
+
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.unomi.shell.services.UnomiManagementService;
+
+@Command(scope = "unomi", name = "setup", description = "This will setup some Apache Unomi runtime options")
+@Service
+public class Setup implements Action {
+
+ @Reference
+ UnomiManagementService unomiManagementService;
+
+ @Option(name = "-d", aliases = "--distribution", description = "Unomi Distribution feature to configure", required = true, multiValued = false)
+ String distribution = "unomi-distribution-elasticsearch";
+
+ @Option(name = "-f", aliases = "--force", description = "Force setting up distribution feature name even if already exists (use with caution)", required = false, multiValued = false)
+ boolean force = false;
+
+ public Object execute() throws Exception {
+ System.out.println("Setting up Apache Unomi distribution: " + distribution);
+ unomiManagementService.setupUnomiDistribution(distribution, force);
+ return null;
+ }
+
+}
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Start.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Start.java
index 3e1c3e89e..98c5b85a9 100644
--- a/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Start.java
+++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Start.java
@@ -31,20 +31,12 @@ public class Start implements Action {
@Reference
UnomiManagementService unomiManagementService;
- @Argument(name = "startFeatures", description = "Start features configuration to use (elasticsearch/opensearch)", valueToShowInHelp = "elasticsearch")
- private String selectedStartFeatures = "elasticsearch";
-
- @Option(name = "-i", aliases = "--install-only", description = "Only install features, don't start them", required = false, multiValued = false)
+ @Option(name = "-i", aliases = "--install-only", description = "Only install distribution feature's dependencies, don't start them", required = false, multiValued = false)
boolean installOnly = false;
public Object execute() throws Exception {
- if (!selectedStartFeatures.equals("elasticsearch") &&
- !selectedStartFeatures.equals("opensearch")) {
- System.err.println("Invalid value '"+selectedStartFeatures+"' specified for start features configuration, will default to elasticsearch");
- selectedStartFeatures = "elasticsearch";
- }
- System.out.println("Starting Apache Unomi with start features configuration: " + selectedStartFeatures);
- unomiManagementService.startUnomi(selectedStartFeatures, !installOnly);
+ System.out.println("Starting Apache Unomi");
+ unomiManagementService.startUnomi(!installOnly);
return null;
}
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Stop.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Stop.java
index 8b8cad5e6..ca87002e5 100644
--- a/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Stop.java
+++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/actions/Stop.java
@@ -31,7 +31,6 @@ public class Stop implements Action {
public Object execute() throws Exception {
unomiManagementService.stopUnomi();
-
return null;
}
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/UnomiManagementService.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/UnomiManagementService.java
index a92bf2bd2..607f08729 100644
--- a/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/UnomiManagementService.java
+++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/UnomiManagementService.java
@@ -16,6 +16,7 @@
*/
package org.apache.unomi.shell.services;
+import org.apache.unomi.shell.services.internal.UnomiSetup;
import org.osgi.framework.BundleException;
/**
@@ -25,32 +26,38 @@
public interface UnomiManagementService {
/**
- * This method will start Apache Unomi with the specified start features configuration
- * @param selectedStartFeatures the start features configuration to use
+ * This method will set up Unomi distribution's feature name
+ * @param distribution the distribution feature name to set up
+ * @param overwrite to force setup even if already exists
+ * @throws BundleException if the setup already exists and overwrite is false
+ */
+ void setupUnomiDistribution(String distribution, boolean overwrite) throws Exception;
+
+ /**
+ * This method will start Apache Unomi
* @param mustStartFeatures true if features should be started, false if they should not
- * @throws BundleException if there was an error starting Unomi's bundles
+ * @throws Exception if there was an error starting Unomi's bundles
*/
- void startUnomi(String selectedStartFeatures, boolean mustStartFeatures) throws Exception;
+ void startUnomi(boolean mustStartFeatures) throws Exception;
/**
- * This method will start Apache Unomi with the specified start features configuration
- * @param selectedStartFeatures the start features configuration to use
+ * This method will start Apache Unomi
* @param mustStartFeatures true if features should be started, false if they should not
* @param waitForCompletion true if the method should wait for completion, false if it should not
- * @throws BundleException if there was an error starting Unomi's bundles
+ * @throws Exception if there was an error starting Unomi's bundles
*/
- void startUnomi(String selectedStartFeatures, boolean mustStartFeatures, boolean waitForCompletion) throws Exception;
+ void startUnomi(boolean mustStartFeatures, boolean waitForCompletion) throws Exception;
/**
* This method will stop Apache Unomi
- * @throws BundleException if there was an error stopping Unomi's bundles
+ * @throws Exception if there was an error stopping Unomi's bundles
*/
void stopUnomi() throws Exception;
/**
* This method will stop Apache Unomi
* @param waitForCompletion true if the method should wait for completion, false if it should not
- * @throws BundleException if there was an error stopping Unomi's bundles
+ * @throws Exception if there was an error stopping Unomi's bundles
*/
void stopUnomi(boolean waitForCompletion) throws Exception;
}
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceConfiguration.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceConfiguration.java
deleted file mode 100644
index fc6152985..000000000
--- a/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceConfiguration.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.unomi.shell.services.internal;
-
-import org.osgi.service.metatype.annotations.AttributeDefinition;
-import org.osgi.service.metatype.annotations.ObjectClassDefinition;
-
-/**
- * OSGi metatype configuration for the Unomi Management service.
- *
- * Allows specifying a list of feature sets to start when the management
- * service initializes. Each entry is a string that maps a logical key to
- * one or more features.
- */
-@ObjectClassDefinition(
- name = "Unomi Management Configuration",
- description = "Configuration for Unomi Management Service"
-)
-public @interface UnomiManagementServiceConfiguration {
-
- @AttributeDefinition(
- name = "Start Features",
- description = "An array of strings representing start features in the format '[\"key=feature1,feature2\", \"key2:feature3\"]'."
- )
- /**
- * Defines one or more feature sets to start.
- *
- * Each element is a string using one of these forms:
- * - key=featureA,featureB (comma-separated list assigned to a key)
- * - key:featureC (single feature assigned to a key)
- *
- * Example: ["ui=feature1,feature2", "backend:feature3"].
- *
- * @return an array of feature-set descriptors; empty by default
- */
- String[] startFeatures() default "";
-
-}
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceImpl.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceImpl.java
index 87a89c1b1..aaa0447b9 100644
--- a/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceImpl.java
+++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceImpl.java
@@ -17,6 +17,7 @@
package org.apache.unomi.shell.services.internal;
import org.apache.commons.lang3.StringUtils;
+import org.apache.karaf.features.Dependency;
import org.apache.karaf.features.Feature;
import org.apache.karaf.features.FeatureState;
import org.apache.karaf.features.FeaturesService;
@@ -24,12 +25,14 @@
import org.apache.unomi.shell.migration.MigrationService;
import org.apache.unomi.shell.services.UnomiManagementService;
import org.osgi.framework.BundleContext;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.*;
-import org.osgi.service.metatype.annotations.Designate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.IOException;
import java.util.*;
import java.util.concurrent.*;
@@ -81,56 +84,58 @@
* @see org.apache.karaf.features.FeaturesService
* @see org.apache.karaf.features.Feature
*/
-@Component(service = UnomiManagementService.class, immediate = true, configurationPid = "org.apache.unomi.start", configurationPolicy = ConfigurationPolicy.REQUIRE)
-@Designate(ocd = UnomiManagementServiceConfiguration.class)
+@Component(service = UnomiManagementService.class, immediate = true)
public class UnomiManagementServiceImpl implements UnomiManagementService {
private static final Logger LOGGER = LoggerFactory.getLogger(UnomiManagementServiceImpl.class.getName());
private static final int DEFAULT_TIMEOUT = 300; // 5 minutes timeout
- private final ExecutorService executor = Executors.newSingleThreadExecutor();
-
+ private static final String UNOMI_SETUP_PID = "org.apache.unomi.setup";
private static final String CDP_GRAPHQL_FEATURE = "cdp-graphql-feature";
- private BundleContext bundleContext;
-
@Reference(cardinality = ReferenceCardinality.MANDATORY)
private MigrationService migrationService;
+ @Reference(cardinality = ReferenceCardinality.MANDATORY)
+ private ConfigurationAdmin configurationAdmin;
+
@Reference(cardinality = ReferenceCardinality.MANDATORY)
private FeaturesService featuresService;
@Reference(cardinality = ReferenceCardinality.MANDATORY)
private BundleWatcher bundleWatcher;
- private Map> startFeatures = new HashMap>();
- private final List installedFeatures = new ArrayList<>();
- private final List startedFeatures = new ArrayList<>();
+ private final ExecutorService executor = Executors.newSingleThreadExecutor();
+ private final List installedDistributionDependencies = new ArrayList<>();
+ private final List startedDistributionDependencies = new ArrayList<>();
@Activate
- public void init(ComponentContext componentContext, UnomiManagementServiceConfiguration config) throws Exception {
- LOGGER.info("Initializing Unomi management service with configuration {}", config);
+ public void init(ComponentContext componentContext) throws Exception {
+ LOGGER.info("Initializing Unomi management service");
try {
- this.bundleContext = componentContext.getBundleContext();
- this.startFeatures = parseStartFeatures(config.startFeatures());
+ BundleContext bundleContext = componentContext.getBundleContext();
+
+ UnomiSetup setup = getUnomiSetup();
+ if (setup == null) {
+ LOGGER.info("No previously setup distribution found");
+ //We are setting a default distribution if none is set to avoid the need of calling setup manually after installation
+ if (StringUtils.isNotBlank(bundleContext.getProperty("unomi.distribution"))) {
+ setup = createUnomiSetup(bundleContext.getProperty("unomi.distribution"));
+ LOGGER.info("UnomiSetup created for distribution provided from context: {}", setup.getDistribution());
+ } else {
+ setup = createUnomiSetup("unomi-distribution-elasticsearch");
+ LOGGER.info("UnomiSetup created for default distribution: {}", setup.getDistribution());
+ }
+ }
if (StringUtils.isNotBlank(bundleContext.getProperty("unomi.autoMigrate"))) {
migrationService.migrateUnomi(bundleContext.getProperty("unomi.autoMigrate"), true, null);
}
- String autoStart = bundleContext.getProperty("unomi.autoStart");
- if (StringUtils.isNotBlank(autoStart)) {
- String resolvedAutoStart = autoStart;
- if ("true".equals(autoStart)) {
- resolvedAutoStart = "elasticsearch";
- } if ("elasticsearch".equals(autoStart)) {
- resolvedAutoStart = "elasticsearch";
- } if ("opensearch".equals(autoStart)) {
- resolvedAutoStart = "opensearch";
- }
- LOGGER.info("Auto-starting unomi management service with start features configuration: {}", resolvedAutoStart);
+ if (StringUtils.isNotBlank(bundleContext.getProperty("unomi.autoStart")) && bundleContext.getProperty("unomi.autoStart").equals("true")) {
+ LOGGER.info("Auto-starting unomi management service for unomi distribution: {}", setup.getDistribution());
// Don't wait for completion during initialization
- startUnomi(resolvedAutoStart, true, false);
+ startUnomi(true, false);
}
} catch (Exception e) {
LOGGER.error("Error during Unomi startup:", e);
@@ -138,46 +143,39 @@ public void init(ComponentContext componentContext, UnomiManagementServiceConfig
}
}
- private List getAdditionalFeaturesToInstall() {
- List featuresToInstall = new ArrayList<>();
- if (Boolean.parseBoolean(bundleContext.getProperty("org.apache.unomi.graphql.feature.activated"))) {
- featuresToInstall.add(CDP_GRAPHQL_FEATURE);
- bundleWatcher.addRequiredBundle("org.apache.unomi.cdp-graphql-api-impl");
- bundleWatcher.addRequiredBundle("org.apache.unomi.graphql-ui");
- }
- return featuresToInstall;
+ private UnomiSetup getUnomiSetup() throws IOException {
+ Configuration configuration = configurationAdmin.getConfiguration(UNOMI_SETUP_PID, "?");
+ return UnomiSetup.fromDictionary(configuration.getProperties());
}
- private Map> parseStartFeatures(String[] startFeaturesConfig) {
- Map> startFeatures = new HashMap<>();
- if (startFeaturesConfig == null) {
- return startFeatures;
- }
+ private UnomiSetup createUnomiSetup(String distribution) throws IOException {
+ Configuration configuration = configurationAdmin.getConfiguration(UNOMI_SETUP_PID, "?");
+ UnomiSetup setup = UnomiSetup.init().withDistribution(distribution);
+ configuration.update(setup.toProperties());
+ return setup;
+ }
- for (String entry : startFeaturesConfig) {
- String[] parts = entry.split("=");
- if (parts.length == 2) {
- String key = parts[0].trim();
- List features = new ArrayList<>(Arrays.asList(parts[1].split(",")));
- startFeatures.put(key, features);
- } else {
- LOGGER.warn("Invalid start feature entry: {}", entry);
- }
+ @Override
+ public void setupUnomiDistribution(String distribution, boolean overwrite) throws Exception {
+ UnomiSetup existingSetup = getUnomiSetup();
+ if (existingSetup != null && !overwrite) {
+ throw new IllegalStateException("Unomi distribution is already set up with distribution: " + existingSetup.getDistribution());
}
- return startFeatures;
+ createUnomiSetup(distribution);
}
@Override
- public void startUnomi(String selectedStartFeatures, boolean mustStartFeatures) throws Exception {
+ public void startUnomi(boolean mustStartFeatures) throws Exception {
// Default to waiting for completion
- startUnomi(selectedStartFeatures, mustStartFeatures, true);
+ startUnomi(mustStartFeatures, true);
}
@Override
- public void startUnomi(String selectedStartFeatures, boolean mustStartFeatures, boolean waitForCompletion) throws Exception {
+ public void startUnomi(boolean mustStartFeatures, boolean waitForCompletion) throws Exception {
+ UnomiSetup setup = getUnomiSetup();
Future> future = executor.submit(() -> {
try {
- doStartUnomi(selectedStartFeatures, mustStartFeatures);
+ doStartUnomi(setup.getDistribution(), mustStartFeatures);
} catch (Exception e) {
LOGGER.error("Error starting Unomi:", e);
throw new RuntimeException(e);
@@ -194,47 +192,40 @@ public void startUnomi(String selectedStartFeatures, boolean mustStartFeatures,
}
}
- private void doStartUnomi(String selectedStartFeatures, boolean mustStartFeatures) throws Exception {
- List features = startFeatures.get(selectedStartFeatures);
- if (features == null || features.isEmpty()) {
- LOGGER.warn("No features configured for start features configuration: {}", selectedStartFeatures);
+ private void doStartUnomi(String distribution, boolean mustStartDistribution) throws Exception {
+ if (distribution == null || distribution.isEmpty()) {
+ LOGGER.warn("No distribution provided, unable to start Unomi.");
return;
}
- features.addAll(getAdditionalFeaturesToInstall());
-
- LOGGER.info("Installing features for start features configuration: {}", selectedStartFeatures);
- for (String featureName : features) {
- try {
- Feature feature = featuresService.getFeature(featureName);
- if (feature == null) {
- LOGGER.error("Feature not found: {}", featureName);
- continue;
- }
-
- if (!installedFeatures.contains(featureName)) {
- LOGGER.info("Installing feature: {}", featureName);
- featuresService.installFeature(featureName, EnumSet.of(FeaturesService.Option.NoAutoStartBundles));
- installedFeatures.add(featureName);
+ try {
+ Feature feature = featuresService.getFeature(distribution);
+ if (feature == null) {
+ LOGGER.error("Distribution feature not found: {}", distribution);
+ return;
+ }
+ for (Dependency dependency : feature.getDependencies()) {
+ if (!installedDistributionDependencies.contains(dependency.getName())) {
+ LOGGER.info("Installing distribution feature's dependency: {}", dependency.getName());
+ featuresService.installFeature(dependency.getName(), dependency.getVersion(), EnumSet.of(FeaturesService.Option.NoAutoStartBundles));
+ installedDistributionDependencies.add(dependency.getName());
}
- } catch (Exception e) {
- LOGGER.error("Error installing feature: {}", featureName, e);
}
+ } catch (Exception e) {
+ LOGGER.error("Error installing distribution: {}", distribution, e);
}
- if (mustStartFeatures) {
- LOGGER.info("Starting features for start features configuration: {}", selectedStartFeatures);
- for (String featureName : features) {
+ if (mustStartDistribution) {
+ LOGGER.info("Starting distribution: {}", distribution);
+ for (String featureName : installedDistributionDependencies) {
try {
Feature feature = featuresService.getFeature(featureName);
if (feature == null) {
- LOGGER.error("Feature not found: {}", featureName);
+ LOGGER.error("Distribution feature's dependency not found: {}", featureName);
continue;
}
- if (mustStartFeatures) {
- LOGGER.info("Starting feature: {}", featureName);
- startFeature(featureName);
- startedFeatures.add(featureName); // Keep track of started features
- }
+ LOGGER.info("Starting dependency: {}", featureName);
+ startFeature(featureName);
+ startedDistributionDependencies.add(featureName); // Keep track of started distribution dependencies
} catch (Exception e) {
LOGGER.error("Error starting feature: {}", featureName, e);
}
@@ -270,11 +261,11 @@ public void stopUnomi(boolean waitForCompletion) throws Exception {
}
private void doStopUnomi() throws Exception {
- if (startedFeatures.isEmpty()) {
+ if (startedDistributionDependencies.isEmpty()) {
LOGGER.info("No features to stop.");
} else {
LOGGER.info("Stopping features in reverse order...");
- ListIterator iterator = startedFeatures.listIterator(startedFeatures.size());
+ ListIterator iterator = startedDistributionDependencies.listIterator(startedDistributionDependencies.size());
while (iterator.hasPrevious()) {
String featureName = iterator.previous();
try {
@@ -285,13 +276,13 @@ private void doStopUnomi() throws Exception {
}
}
- startedFeatures.clear(); // Clear the list after stopping all features
+ startedDistributionDependencies.clear(); // Clear the list after stopping all features
}
- if (installedFeatures.isEmpty()) {
+ if (installedDistributionDependencies.isEmpty()) {
LOGGER.info("No features to uninstall.");
} else {
LOGGER.info("Stopping features in reverse order...");
- ListIterator iterator = installedFeatures.listIterator(installedFeatures.size());
+ ListIterator iterator = installedDistributionDependencies.listIterator(installedDistributionDependencies.size());
while (iterator.hasPrevious()) {
String featureName = iterator.previous();
try {
@@ -301,7 +292,7 @@ private void doStopUnomi() throws Exception {
LOGGER.error("Error uninstalling feature: {}", featureName, e);
}
}
- installedFeatures.clear(); // Clear the list after stopping all features
+ installedDistributionDependencies.clear(); // Clear the list after stopping all features
}
}
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiSetup.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiSetup.java
new file mode 100644
index 000000000..d00d4361d
--- /dev/null
+++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiSetup.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2002-2025 Jahia Solutions Group SA. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.shell.services.internal;
+
+import java.util.Date;
+import java.util.Dictionary;
+import java.util.Objects;
+
+/**
+ * @author Jerome Blanchard
+ */
+public class UnomiSetup {
+
+ private String date;
+ private String distribution;
+
+ public UnomiSetup() {
+ }
+
+ public String getDate() {
+ return date;
+ }
+
+ private void setDate(String date) {
+ this.date = date;
+ }
+
+ public String getDistribution() {
+ return distribution;
+ }
+
+ public void setDistribution(String distribution) {
+ this.distribution = distribution;
+ }
+
+ public UnomiSetup withDistribution(String distribution) {
+ this.distribution = distribution;
+ return this;
+ }
+
+ public Dictionary toProperties() {
+ Dictionary properties = new java.util.Hashtable<>();
+ properties.put("unomi.setup.date", date);
+ properties.put("unomi.setup.distribution", distribution);
+ return properties;
+ }
+
+ public static UnomiSetup init() {
+ UnomiSetup setup = new UnomiSetup();
+ setup.setDate(new Date().toString());
+ return setup;
+ }
+
+ public static UnomiSetup fromDictionary(Dictionary properties) {
+ UnomiSetup setup = new UnomiSetup();
+ if (properties == null) {
+ return null;
+ }
+ setup.setDate(Objects.toString(properties.get("unomi.setup.date"), null));
+ setup.setDistribution(Objects.toString(properties.get("unomi.setup.distribution"), null));
+ return setup;
+ }
+
+}
diff --git a/tools/shell-commands/src/main/resources/org.apache.unomi.start.cfg b/tools/shell-commands/src/main/resources/org.apache.unomi.start.cfg
deleted file mode 100644
index c9158a9d6..000000000
--- a/tools/shell-commands/src/main/resources/org.apache.unomi.start.cfg
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-startFeatures = [ "elasticsearch=unomi-base,unomi-startup,unomi-elasticsearch-core,unomi-persistence-core,unomi-services,unomi-rest-api,unomi-cxs-lists-extension,unomi-cxs-geonames-extension,unomi-cxs-privacy-extension,unomi-elasticsearch-conditions,unomi-plugins-base,unomi-plugins-request,unomi-plugins-mail,unomi-plugins-optimization-test,unomi-shell-dev-commands,unomi-wab,unomi-web-tracker,unomi-healthcheck,unomi-router-karaf-feature,unomi-groovy-actions,unomi-rest-ui,unomi-startup-complete", \
- "opensearch=unomi-base,unomi-startup,unomi-opensearch-core,unomi-persistence-core,unomi-services,unomi-rest-api,unomi-cxs-lists-extension,unomi-cxs-geonames-extension,unomi-cxs-privacy-extension,unomi-opensearch-conditions,unomi-plugins-base,unomi-plugins-request,unomi-plugins-mail,unomi-plugins-optimization-test,unomi-shell-dev-commands,unomi-wab,unomi-web-tracker,unomi-healthcheck,unomi-router-karaf-feature,unomi-groovy-actions,unomi-rest-ui,unomi-startup-complete" ]