Skip to content

Commit

Permalink
Updated names in component definitions
Browse files Browse the repository at this point in the history
Signed-off-by: pierantoniomerlino <[email protected]>
  • Loading branch information
pierantoniomerlino committed Sep 2, 2024
1 parent fb9f508 commit 5d938e3
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 47 deletions.
19 changes: 19 additions & 0 deletions kura/distrib/src/main/ant/build_equinox_distrib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
<antcall target="linux.usb-config" />
<antcall target="bluetooth-config" />
<antcall target="linux.watchdog-config" />
<antcall target="h2db-config" />

<!-- Added Camel bundles configs -->
<antcall target="camel-config" />
Expand Down Expand Up @@ -701,6 +702,7 @@ fi]]>
<antcall target="emulator-gpio-jar" />
<antcall target="emulator-jars" />
<antcall target="linux-network-jars" />
<antcall target="h2db-jars" />

<echo message="Building Kura Distribution for ${build.name}-jars..." />

Expand Down Expand Up @@ -1281,6 +1283,14 @@ fi]]>
</propertyfile>
</target>

<target name="h2db-config">
<propertyfile
file="${project.build.directory}/${build.output.name}/config.ini">
<entry key="osgi.bundles" operation="+"
value=", reference:file:${kura.install.dir}/${kura.symlink}/${plugins.folder}/org.eclipse.kura.db.h2db.provider_${org.eclipse.kura.db.h2db.provider.version}.jar@4" />
</propertyfile>
</target>

<target name="asset-jar">
<zip destfile="${project.build.directory}/${build.output.name}.zip"
update="true">
Expand Down Expand Up @@ -1754,6 +1764,15 @@ fi]]>
todir="${build.install.dir.kura}/kura/plugins" />
</target>

<target name="h2db-jars">
<zip destfile="${project.build.directory}/${build.output.name}.zip"
update="true">
<zipfileset
file="${project.build.directory}/plugins/org.eclipse.kura.db.h2db.provider_${org.eclipse.kura.db.h2db.provider.version}.jar"
prefix="${build.output.name}/${plugins.folder}" />
</zip>
</target>

<target name="misc-config">
<propertyfile
file="${project.build.directory}/${build.output.name}/config.ini">
Expand Down
1 change: 1 addition & 0 deletions kura/org.eclipse.kura.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Import-Package: javax.crypto,
org.eclipse.kura.data;version="[1.1,2.0)",
org.eclipse.kura.data.listener;version="[1.0,2.0)",
org.eclipse.kura.data.transport.listener;version="[1.0,2.0)",
org.eclipse.kura.db;version="[2.0,2.1)",
org.eclipse.kura.executor;version="[1.0,2.0)",
org.eclipse.kura.message.store;version="[1.0,2.0)",
org.eclipse.kura.message.store.provider;version="[1.0,1.1)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ public Object addingService(ServiceReference<Object> reference) {

if (service instanceof MessageStoreProvider) {
setMessageStoreProvider((MessageStoreProvider) service);
// } else if (service instanceof H2DbService) {
// setH2DbService((H2DbService) service);
} else {
DataServiceImpl.this.componentContext.getBundleContext().ungetService(reference);
return null;
Expand Down Expand Up @@ -341,36 +339,6 @@ public synchronized void unsetMessageStoreProvider() {

}

// public synchronized void setH2DbService(H2DbService dbService) {
// setMessageStoreProvider(new MessageStoreProvider() {
//
// @SuppressWarnings("restriction")
// @Override
// public MessageStore openMessageStore(String name) throws KuraStoreException {
// return new H2DbMessageStoreImpl(new ConnectionProvider() {
//
// @Override
// public <T> T withConnection(final SQLFunction<Connection, T> task) throws SQLException {
// return dbService.withConnection(task::call);
// }
// }, name);
// }
//
// @Override
// public void addListener(ConnectionListener listener) {
// // Do nothing
//
// }
//
// @Override
// public void removeListener(ConnectionListener listener) {
// // Do nothing
//
// }
// });
//
// }

public synchronized void unsetH2DbService(H2DbService dbService) {
unsetMessageStoreProvider();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2023 Eurotech and/or its affiliates and others
* Copyright (c) 2017, 2024 Eurotech and/or its affiliates and others
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -12,19 +12,18 @@
*******************************************************************************/
package org.eclipse.kura.core.data;

import static java.util.Objects.requireNonNull;

import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;

import org.eclipse.kura.configuration.ConfigurationService;
import org.eclipse.kura.db.H2DbService;
import org.quartz.CronExpression;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static java.util.Objects.requireNonNull;

public class DataServiceOptions {

private static final Logger logger = LoggerFactory.getLogger(DataServiceOptions.class);
Expand Down Expand Up @@ -55,7 +54,7 @@ public class DataServiceOptions {
private static final boolean AUTOCONNECT_PROP_DEFAULT = false;
private static final int CONNECT_DELAY_DEFAULT = 60;
private static final int DISCONNECT_DELAY_DEFAULT = 10;
private static final String DB_SERVICE_INSTANCE_DEFAULT = H2DbService.DEFAULT_INSTANCE_PID;
private static final String DB_SERVICE_INSTANCE_DEFAULT = "org.eclipse.kura.db.H2DbService";
private static final int STORE_HOUSEKEEPER_INTERVAL_DEFAULT = 900;
private static final int STORE_PURGE_AGE_DEFAULT = 60;
private static final int STORE_CAPACITY_DEFAULT = 10000;
Expand Down Expand Up @@ -181,11 +180,11 @@ public boolean isConnectionScheduleEnabled() {
}

public Optional<CronExpression> getConnectionScheduleExpression() {

if (!this.isConnectionScheduleEnabled()) {
return Optional.empty();
}

try {
return Optional.of(new CronExpression((String) this.properties.get(CONNECTION_SCHECULE_EXPRESSION)));
} catch (final Exception e) {
Expand Down
4 changes: 2 additions & 2 deletions kura/org.eclipse.kura.db.h2db.provider/OSGI-INF/h2db.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017, 2023 Eurotech and/or its affiliates and others
Copyright (c) 2017, 2024 Eurotech and/or its affiliates and others
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,7 +14,7 @@
-->
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" enabled="true" activate="activate" configuration-policy="require" deactivate="deactivate" modified="updated" name="org.eclipse.kura.core.db.H2DbService">
<implementation class="org.eclipse.kura.core.db.H2DbServiceImpl"/>
<implementation class="org.eclipse.kura.internal.db.h2db.provider.H2DbServiceImpl"/>
<service>
<provide interface="org.eclipse.kura.configuration.ConfigurableComponent"/>
<provide interface="org.eclipse.kura.db.BaseDbService"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017, 2020 Eurotech and/or its affiliates and others
Copyright (c) 2017, 2024 Eurotech and/or its affiliates and others
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,6 +14,6 @@
-->
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" immediate="true" name="org.eclipse.kura.core.db.H2DbHelper">
<implementation class="org.eclipse.kura.core.db.H2DbHelper"/>
<implementation class="org.eclipse.kura.internal.db.h2db.provider.H2DbHelper"/>
<reference bind="setConfigurationService" cardinality="1..1" interface="org.eclipse.kura.configuration.ConfigurationService" name="ConfigurationService" policy="static" unbind="unsetConfigurationService"/>
</scr:component>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017, 2020 Eurotech and/or its affiliates and others
Copyright (c) 2017, 2024 Eurotech and/or its affiliates and others
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
Expand All @@ -14,7 +14,7 @@
-->
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" configuration-policy="require" deactivate="deactivate" immediate="true" modified="updated" name="org.eclipse.kura.core.db.H2DbServer">
<implementation class="org.eclipse.kura.core.db.H2DbServer"/>
<implementation class="org.eclipse.kura.internal.db.h2db.provider.H2DbServer"/>
<property name="service.pid" type="String" value="org.eclipse.kura.core.db.H2DbServer"/>
<service>
<provide interface="org.eclipse.kura.configuration.ConfigurableComponent"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017, 2020 Eurotech and/or its affiliates and others
Copyright (c) 2017, 2024 Eurotech and/or its affiliates and others
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017, 2020 Eurotech and/or its affiliates and others
Copyright (c) 2017, 2024 Eurotech and/or its affiliates and others
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
Expand Down

0 comments on commit 5d938e3

Please sign in to comment.