You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cg...@apache.org on 2024/09/16 11:49:17 UTC
(plc4x-extras) branch feature/merlot updated: More cleaning code.
This is an automated email from the ASF dual-hosted git repository.
cgarcia pushed a commit to branch feature/merlot
in repository https://gitbox.apache.org/repos/asf/plc4x-extras.git
The following commit(s) were added to refs/heads/feature/merlot by this push:
new 5c2151b More cleaning code.
5c2151b is described below
commit 5c2151bedec03642ecf3f7640add6987e690ea35
Author: César García <ce...@ceos.com.ve>
AuthorDate: Mon Sep 16 07:48:32 2024 -0400
More cleaning code.
---
.../merlot/org.apache.plc4x.merlot.das.api/pom.xml | 11 +-
.../org/apache/plc4x/merlot/api/PlcSecureBoot.java | 83 ++++++++
.../merlot/api/command/PlcPersistCommand.java | 47 +++++
.../merlot/api/impl/PlcGeneralFunctionImpl.java | 5 +-
.../plc4x/merlot/api/impl/PlcSecureBootImpl.java | 211 +++++++++++++++++++++
.../resources/OSGI-INF/blueprint/api-service.xml | 31 ++-
.../plc4x/merlot/db/impl/DBRPCSecurityImpl.java | 111 +++++++++++
.../resources/OSGI-INF/blueprint/db-service.xml | 10 +-
.../src/main/feature/feature.xml | 120 ++++++------
.../merlot/org.apache.plc4x.merlot.uns/pom.xml | 3 +-
.../merlot/uns/core/LdapEmbeddedServerV2.java | 46 +++++
.../plc4x/merlot/uns/core/ModelRPCService.java | 4 -
.../resources/OSGI-INF/blueprint/uns-service.xml | 4 +-
plc4j/tools/merlot/pom.xml | 5 +-
14 files changed, 617 insertions(+), 74 deletions(-)
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/pom.xml b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/pom.xml
index 6741101..1c087f8 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/pom.xml
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/pom.xml
@@ -79,7 +79,7 @@
<Export-Package>org.apache.plc4x.merlot.api*;version=0.13.0-SNAPSHOT;-noimport:=true</Export-Package>
<Import-Package>*</Import-Package>
<Karaf-Commands>org.apache.plc4x.merlot.api.command*</Karaf-Commands>
-<!-- <_removeheaders>Import-Service,Export-Service</_removeheaders> -->
+ <_removeheaders>Import-Service,Export-Service</_removeheaders>
</instructions>
</configuration>
</plugin>
@@ -88,8 +88,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.8</source>
- <target>1.8</target>
+ <source>18</source>
+ <target>18</target>
<maxmem>256M</maxmem>
</configuration>
</plugin>
@@ -203,5 +203,10 @@
<artifactId>plc4j-spi</artifactId>
<version>0.13.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.xerial</groupId>
+ <artifactId>sqlite-jdbc</artifactId>
+ <version>3.46.1.0</version>
+ </dependency>
</dependencies>
</project>
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/PlcSecureBoot.java b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/PlcSecureBoot.java
new file mode 100644
index 0000000..3576e06
--- /dev/null
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/PlcSecureBoot.java
@@ -0,0 +1,83 @@
+/*
+ * 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.plc4x.merlot.api;
+
+import org.apache.plc4x.java.api.PlcDriver;
+import org.osgi.service.jdbc.DataSourceFactory;
+
+/*
+* During the boot process, the sequential order of the boot must be
+* guaranteed based on the available infrastructure.
+* The implemented services must monitor the PlcDriver type services and
+* from these deploy the associated PlcDevice, PlcGroup and PlcItem.
+* In future implementations, security aspects must be added such as digital
+* signature (MD5, CRC, etc.) of each record in such a way as to minimize
+* the possibility that the data is correct or has been altered.
+*/
+public interface PlcSecureBoot {
+
+ /*
+ * Initializes the database connection if the factory is available.
+ * It is initially called by the BluePrint container.
+ * In case the connection is not created, the "init()" is called
+ * when the factory is assigned.
+ */
+ public void init();
+
+ /*
+ * Releases all allocated resources and closes the connection to
+ * the database if connected.
+ */
+ public void destroy();
+
+ /*
+ * This service checks the availability of each PlcDriver available
+ * in the environment. Upon receiving the availability,
+ * it will try to create the associated groups, items and records.
+ */
+ public void bindPlcDriver(PlcDriver plcDriver);
+
+ /*
+ * No action is taken when a PlcDriver is dynamically removed.
+ */
+ public void unbindPlcDriver(PlcDriver plcDriver);
+
+ /*
+ * Factory for creating the connection to the database and the
+ * associated tables.
+ * This is planned to be SqlLite, however it could be another implementation.
+ */
+ public void bindDataSourceFactory(DataSourceFactory dsFactory);
+
+ /*
+ * Stores all the information in memory related to the PlcDriver,
+ * that is, PlcDevice, PlcGroups, PlcItems and, if the services are
+ * available, the PlcRecords
+ */
+ public void persist();
+
+ /*
+ * Stores all resources assigned to the designated PlcDriver.
+ */
+ public void store(String plcDriver);
+
+ /*
+ * Restores all resources assigned to the designated PlcDriver.
+ */
+ public void restore(String plcDriver);
+
+}
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/command/PlcPersistCommand.java b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/command/PlcPersistCommand.java
new file mode 100644
index 0000000..66549a1
--- /dev/null
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/command/PlcPersistCommand.java
@@ -0,0 +1,47 @@
+/*
+ * 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
+ *
+ * https://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.plc4x.merlot.api.command;
+
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.plc4x.merlot.api.PlcGeneralFunction;
+import org.apache.plc4x.merlot.api.PlcSecureBoot;
+
+@Command(scope = "plc4x", name = "persist", description = "Securely stores all information associated with the Devices.")
+@Service
+public class PlcPersistCommand implements Action {
+
+ @Reference
+ PlcGeneralFunction plcGeneralFunction;
+
+ @Reference
+ PlcSecureBoot plcSecureBoot;
+
+
+ @Override
+ public Object execute() throws Exception {
+
+ plcSecureBoot.persist();
+
+ return null;
+ }
+
+}
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/impl/PlcGeneralFunctionImpl.java b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/impl/PlcGeneralFunctionImpl.java
index a5c222e..c9a8f5e 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/impl/PlcGeneralFunctionImpl.java
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/impl/PlcGeneralFunctionImpl.java
@@ -44,7 +44,7 @@ import org.osgi.service.dal.PropertyMetadata;
import org.slf4j.LoggerFactory;
import org.apache.plc4x.merlot.api.PlcGeneralFunction;
-/*
+/*DriverName
*
*/
public class PlcGeneralFunctionImpl implements PlcGeneralFunction {
@@ -297,7 +297,8 @@ public class PlcGeneralFunctionImpl implements PlcGeneralFunction {
putDescription("uuid").
putLongDescription("String representing the UUID of the device.").
build()).
- build();
+ build(); private static final String SQL_SELECT_GROUPS =
+ "SELECT * FROM DEVICES WHERE DriverName = ? AND DeviceName = ?";
private static final PlcOperationMetadata OP_READ_META = new PlcOperationMetadata.
PlcOperationMetaDataBuilder().
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/impl/PlcSecureBootImpl.java b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/impl/PlcSecureBootImpl.java
new file mode 100644
index 0000000..641b9de
--- /dev/null
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/java/org/apache/plc4x/merlot/api/impl/PlcSecureBootImpl.java
@@ -0,0 +1,211 @@
+/*
+ * 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
+ *
+ * https://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.plc4x.merlot.api.impl;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.sql.DataSource;
+import org.apache.plc4x.java.api.PlcDriver;
+import org.apache.plc4x.merlot.api.PlcGeneralFunction;
+import org.apache.plc4x.merlot.api.PlcSecureBoot;
+import org.apache.plc4x.merlot.scheduler.api.Job;
+import org.apache.plc4x.merlot.scheduler.api.JobContext;
+import org.osgi.service.jdbc.DataSourceFactory;
+import org.slf4j.LoggerFactory;
+
+
+public class PlcSecureBootImpl implements PlcSecureBoot, Job {
+ private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(PlcSecureBootImpl.class);
+ private static final String DB_URL = "jdbc:sqlite:data/boot.db";
+
+ private static final String SQL_CREATE_TABLE_DEVICES =
+ "CREATE TABLE IF NOT EXISTS Devices("
+ + "DeviceId INTEGER PRIMARY KEY,"
+ + "DriverName TEXT,"
+ + "DeviceName TEXT,"
+ + "DeviceId TEXT,"
+ + "ShortName TEXT,"
+ + "Description TEXT,"
+ + "Md5 TEXT)";
+
+ private static final String SQL_CREATE_TABLE_GROUPS =
+ "CREATE TABLE IF NOT EXISTS Groups("
+ + "GroupId INTEGER PRIMARY KEY,"
+ + "DeviceId INTEGER,"
+ + "GroupName TEXT,"
+ + "GroupDescripcion TEXT,"
+ + "GroupScantime TEXT,"
+ + "Md5 TEXT)";
+
+ private static final String SQL_CREATE_TABLE_ITEMS =
+ "CREATE TABLE IF NOT EXISTS Items("
+ + "ItemId INTEGER PRIMARY KEY,"
+ + "DeviceId INTEGER,"
+ + "GroupId INTEGER,"
+ + "ItemName TEXT,"
+ + "ItemDescripcion TEXT,"
+ + "ItemTag TEXT,"
+ + "Md5 TEXT)";
+
+ private static final String SQL_SELECT_DEVICES =
+ "SELECT * FROM Devices WHERE DriverName = ?";
+
+ private static final String SQL_SELECT_GROUPS =
+ "SELECT * FROM Groups WHERE DeviceId = ?";
+
+ private static final String SQL_SELECT_ITEMS =
+ "SELECT * FROM WHERE GroupId = ?";
+
+
+ private Map<String, PlcDriver> delayedBootPlcDivers = new ConcurrentHashMap<>();
+
+ private final PlcGeneralFunction plcGeneralFunction;
+
+ DataSourceFactory dsFactory = null;
+ Connection dbConnection = null;
+
+ public PlcSecureBootImpl(PlcGeneralFunction plcGeneralFunction) {
+ this.plcGeneralFunction = plcGeneralFunction;
+ }
+
+ @Override
+ public void init() {
+ if (null != dsFactory) {
+ Properties props = new Properties();
+ props.setProperty(DataSourceFactory.JDBC_URL, DB_URL);
+
+ try {
+ DataSource ds = dsFactory.createDataSource(props);
+ dbConnection = ds.getConnection();
+ if (null != dbConnection) {
+ var databaseMetaData = dbConnection.getMetaData();
+ LOGGER.info("Boot driver name is {}.", databaseMetaData.getDriverName());
+ createTables();
+ //Catalog,Schema, Table pattern,types of tables
+ try(ResultSet resultSet = databaseMetaData.getTables(null, null, null, new String[]{"TABLE"})){
+ while(resultSet.next()) {
+ String tableName = resultSet.getString("TABLE_NAME");
+ String remarks = resultSet.getString("REMARKS");
+ }
+ }
+
+ }
+ } catch (SQLException ex) {
+ LOGGER.info(ex.getMessage());
+ }
+ }
+ }
+
+ @Override
+ public void destroy() {
+ if (null != dbConnection) {
+ try {
+ dbConnection.close();
+ } catch (SQLException ex) {
+ LOGGER.info(ex.getMessage());
+ }
+ }
+ }
+
+ @Override
+ public void bindPlcDriver(PlcDriver plcDriver) {
+ LOGGER.info("Loading driver: {}",plcDriver.getProtocolCode());
+ if (null != dbConnection) {
+
+ } else {
+ LOGGER.info("Delayed start of driver {}.",plcDriver.getProtocolCode());
+ delayedBootPlcDivers.put(plcDriver.getProtocolCode(), plcDriver);
+ }
+ }
+
+ @Override
+ public void unbindPlcDriver(PlcDriver plcDriver) {
+
+ }
+
+ @Override
+ public void bindDataSourceFactory(DataSourceFactory dsFactory) {
+ this.dsFactory = dsFactory;
+ init();
+ }
+
+
+ @Override
+ public void execute(JobContext context) {
+ if (null != dbConnection) {
+ if (!delayedBootPlcDivers.isEmpty()) {
+ Set<String> keys = delayedBootPlcDivers.keySet();
+ for (String key:keys) {
+ delayedBootPlcDivers.remove(key);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void persist() {
+ var plcDrivers = plcGeneralFunction.getPlcDrivers();
+ plcDrivers.forEach( (k, d) -> store(k));
+ }
+
+ @Override
+ public void store(String plcDriver) {
+ var plcDevices = plcGeneralFunction.getPlcDevices(plcDriver);
+ plcDevices.forEach((duid, dname) ->{
+ var plcDevice = plcGeneralFunction.getPlcDevice(duid);
+ //Store Device
+ var plcGroups = plcGeneralFunction.getPlcDeviceGroups(duid);
+ plcGroups.forEach((guid, gname) -> {
+ var plcGroup = plcGeneralFunction.getPlcGroup(guid);
+ //Store Group
+ var plcItems = plcGeneralFunction.getPlcGroupItems(guid);
+ plcItems.forEach((iuid, iname) -> {
+ var plcItem = plcGeneralFunction.getPlcItem(iuid);
+ //Store item
+
+ });
+ });
+
+ });
+ }
+
+ @Override
+ public void restore(String plcDriver) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+
+
+ private void createTables() throws SQLException{
+ Statement statement;
+ statement = dbConnection.createStatement();
+
+ statement.execute(SQL_CREATE_TABLE_DEVICES);
+ statement.execute(SQL_CREATE_TABLE_GROUPS);
+ statement.execute(SQL_CREATE_TABLE_ITEMS);
+ }
+
+}
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/resources/OSGI-INF/blueprint/api-service.xml b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/resources/OSGI-INF/blueprint/api-service.xml
index e4cfb89..9cb84a8 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/resources/OSGI-INF/blueprint/api-service.xml
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.das.api/src/main/resources/OSGI-INF/blueprint/api-service.xml
@@ -44,7 +44,15 @@
interface="org.apache.plc4x.java.api.PlcDriver"
availability="mandatory">
<reference-listener bind-method="bind" unbind-method="unbind" ref="beanPlcDriverAdmin" />
- </reference-list>
+ <reference-listener bind-method="bindPlcDriver" unbind-method="unbindPlcDriver" ref="PlcSecureBootImplBean" />
+ </reference-list>
+
+ <reference id="servDataSourceFactory"
+ interface="org.osgi.service.jdbc.DataSourceFactory"
+ availability="optional"
+ filter="(osgi.jdbc.driver.name=sqlite)">
+ <reference-listener bind-method="bindDataSourceFactory" ref="PlcSecureBootImplBean"/>
+ </reference>
<!--
-->
@@ -111,7 +119,16 @@
activation="eager">
<argument ref="blueprintBundleContext" />
<argument ref="servScheduler" />
- </bean>
+ </bean>
+
+ <bean id="PlcSecureBootImplBean"
+ class="org.apache.plc4x.merlot.api.impl.PlcSecureBootImpl"
+ scope="singleton"
+ init-method = "init"
+ destroy-method = "destroy"
+ activation="eager">
+ <argument ref="beanPlcGeneralFunction" />
+ </bean>
<!--
-->
@@ -214,6 +231,16 @@
-->
<service ref="beanPlcItemClientService" interface="org.apache.plc4x.merlot.api.core.PlcItemClientService">
</service>
+
+ <service ref="PlcSecureBootImplBean" auto-export="interfaces">
+ <service-properties>
+ <entry key="service.pid" value="org.apache.plc4x.merlot.api.PlcSecureBoot"/>
+ <entry key="scheduler.name" value="PlcSecureBootService"/>
+ <entry key="scheduler.period" value="5000"/>
+ <entry key="scheduler.immediate" value="true"/>
+ <entry key="scheduler.concurrent" value="false"/>
+ </service-properties>
+ </service>
<!--
-->
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.db/src/main/java/org/apache/plc4x/merlot/db/impl/DBRPCSecurityImpl.java b/plc4j/tools/merlot/org.apache.plc4x.merlot.db/src/main/java/org/apache/plc4x/merlot/db/impl/DBRPCSecurityImpl.java
new file mode 100644
index 0000000..ffe1a16
--- /dev/null
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.db/src/main/java/org/apache/plc4x/merlot/db/impl/DBRPCSecurityImpl.java
@@ -0,0 +1,111 @@
+/*
+ * 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
+ *
+ * https://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.plc4x.merlot.db.impl;
+
+import org.epics.nt.NTScalar;
+import org.epics.nt.NTScalarBuilder;
+import org.epics.pvaccess.server.rpc.RPCRequestException;
+import org.epics.pvaccess.server.rpc.RPCService;
+import org.epics.pvaccess.server.rpc.Service;
+import org.epics.pvdata.factory.FieldFactory;
+import org.epics.pvdata.factory.PVDataFactory;
+import org.epics.pvdata.pv.FieldCreate;
+import org.epics.pvdata.pv.PVDataCreate;
+import org.epics.pvdata.pv.PVLong;
+import org.epics.pvdata.pv.PVString;
+import org.epics.pvdata.pv.PVStructure;
+import org.epics.pvdata.pv.ScalarType;
+import org.epics.pvdata.pv.Status;
+import org.epics.pvdatabase.PVRecord;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class DBRPCSecurityImpl extends PVRecord implements RPCService {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DBRPCSecurityImpl.class);
+ private static final String RPC_NAME = "security";
+
+ private PVStructure pvTop;
+ private long request_counter = 0;
+
+ public static DBRPCSecurityImpl create() {
+ FieldCreate fieldCreate = FieldFactory.getFieldCreate();
+ PVDataCreate pvDataCreate = PVDataFactory.getPVDataCreate();
+ NTScalarBuilder ntScalarBuilder = NTScalar.createBuilder();
+
+ PVStructure pvTop = ntScalarBuilder
+ .value(ScalarType.pvLong)
+ .add("res", fieldCreate.createScalarArray(ScalarType.pvString))
+ .addTimeStamp()
+ .createPVStructure();
+
+ DBRPCSecurityImpl pvRecord = new DBRPCSecurityImpl(RPC_NAME, pvTop);
+ return pvRecord;
+ }
+
+ private DBRPCSecurityImpl(String recordName, PVStructure pvStructure) {
+ super(recordName, pvStructure);
+ this.pvTop = pvStructure;
+ }
+
+ @Override
+ public Service getService(PVStructure pvRequest) {
+ System.out.println("GETSERVICE");
+ return this;
+ }
+
+ @Override
+ public PVStructure request(PVStructure pvs) throws RPCRequestException {
+ System.out.println("REQUEST");
+ System.out.println("Request: " + pvs.toString());
+ PVString pvOp = pvs.getSubField(PVString.class, "op");
+ PVString pvQuery = pvs.getSubField(PVString.class, "query");
+
+ if (pvOp == null) {
+ throw new RPCRequestException(Status.StatusType.ERROR,
+ "PVString field with name 'op' expected.");
+ }
+ if (pvQuery == null) {
+ throw new RPCRequestException(Status.StatusType.ERROR,
+ "PVString field with name 'query' expected.");
+ }
+ return execute(pvOp, pvQuery);
+ }
+
+ @Override
+ public void process() {
+ super.process();
+ System.out.println("PROCESS");
+ request_counter++;
+ PVLong pvCounter = pvTop.getSubField(PVLong.class, "value");
+ pvCounter.put(request_counter);
+ }
+
+ //TODO: lock() unlock()
+ private PVStructure execute(PVString op, PVString query) {
+ PVLong pvLong = (PVLong) pvTop.getScalarArrayField("value", ScalarType.pvLong);
+ System.out.println("EXECUTE");
+ pvLong.put(123L);
+ process();
+ PVStructure pvResult = PVDataFactory.getPVDataCreate().createPVStructure(pvTop);
+ return pvResult;
+
+ }
+
+}
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.db/src/main/resources/OSGI-INF/blueprint/db-service.xml b/plc4j/tools/merlot/org.apache.plc4x.merlot.db/src/main/resources/OSGI-INF/blueprint/db-service.xml
index cf9d78a..1c5278c 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.db/src/main/resources/OSGI-INF/blueprint/db-service.xml
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.db/src/main/resources/OSGI-INF/blueprint/db-service.xml
@@ -76,7 +76,13 @@
class="org.epics.pvaccess.ServerFactory"
init-method="start">
</bean>
-
+
+ <bean id="DBRPCSecurityBean"
+ class="org.apache.plc4x.merlot.db.impl.DBRPCSecurityImpl"
+ scope="singleton"
+ factory-method="create">
+ </bean>
+
<reference-list id="refRPCService"
interface="org.epics.pvaccess.server.rpc.RPCService"
availability="optional">
@@ -201,6 +207,8 @@
interface="org.epics.pvaccess.client.ChannelProvider"/>
<service ref="DBWriterHandlerImpl" interface="org.apache.plc4x.merlot.db.api.DBWriterHandler" />
+
+ <service ref="DBRPCSecurityBean" auto-export="interfaces" />
<!-- <service id="MasterDBControl" ref="DBControl" auto-export="interfaces">
<service-properties>
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml b/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml
index 13ec510..5719af0 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.features/src/main/feature/feature.xml
@@ -27,6 +27,7 @@
<!-- Top level feature -->
<feature prerequisite="true">aries-blueprint</feature>
<feature prerequisite="true">spifly</feature>
+ <feature prerequisite="true">pax-jdbc-sqlite</feature>
<bundle>wrap:mvn:org.osgi/org.osgi.service.device/1.1.0/$Export-Package=*;version="1.1.0",!*</bundle>
@@ -39,6 +40,7 @@
<!-- Mandatory librarys -->
+
<!-- Apache librarys -->
<bundle start-level="30">wrap:mvn:org.apache.commons/commons-lang3/${commons-lang3.version}/$Export-Package=*;version="${commons-lang3.version}",!*</bundle>
<bundle start-level="28">mvn:commons-codec/commons-codec/${commons-codec.version}</bundle>
@@ -101,7 +103,8 @@
<bundle start-level="60">mvn:org.apache.plc4x.merlot.db/org.apache.plc4x.merlot.db/${project.version}</bundle>
<!-- <bundle start-level="40">mvn:org.apache.plc4x.dummy/org.apache.plc4x.dummy/${project.version}</bundle> -->
- <feature>plc4x-drivers</feature>
+ <feature>plc4x-drivers</feature>
+
</feature>
<feature name="plc4x-core" version="${project.version}">
@@ -509,28 +512,29 @@ dataSourceName=rtdb
</feature>
<feature name='plc4x-uns-xx' description='${project.name}' version='${project.version}'>
- <bundle>wrap:mvn:org.apache.directory.server/apacheds-all/2.0.0.AM26/$Bundle-SymbolicName=apacheds-all&Bundle-Version=2.0.0.AM26&Bundle-ManifestVersion="2"&Export-Package=*;version="2.0.0.AM26",!*</bundle>
+ <bundle>wrap:mvn:org.apache.directory.server/apacheds-all/2.0.0.AM27/$Bundle-SymbolicName=apacheds-all&Bundle-Version=2.0.0.AM27&Bundle-ManifestVersion="2"&Export-Package=*;version="2.0.0.AM27",!*</bundle>
<!--<bundle>mvn:org.apache.directory.server/apacheds-all/2.0.0.AM26</bundle>-->
- <bundle>wrap:mvn:org.apache.directory.api/api-all/2.1.4/$Bundle-SymbolicName=api-all&Bundle-Version=2.1.4&Bundle-ManifestVersion="2"&Export-Package=*;version="2.1.4",!*</bundle>
+ <bundle>wrap:mvn:org.apache.directory.api/api-all/2.1.7/$Bundle-SymbolicName=api-all&Bundle-Version=2.1.7&Bundle-ManifestVersion="2"&Export-Package=*;version="2.1.7",!*</bundle>
<!--<bundle>mvn:org.apache.directory.api/api-all/2.1.4</bundle>-->
<bundle start-level="80">mvn:org.apache.plc4x.merlot.uns/org.apache.plc4x.merlot.uns/${project.version}</bundle>
</feature>
<feature name='plc4x-uns' description='${project.name}' version='${project.version}'>
- <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
+ <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/3.5.3_1</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-collections/3.2.1_3</bundle>
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-lang/2.4_6</bundle>
- <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool/1.5.4_3</bundle>
+ <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-pool/1.5.4_4</bundle>
<!--<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr-runtime/3.5.3_1</bundle>-->
-<!-- <bundle>mvn:org.apache.directory.studio/org.antlr.antlr/2.7.7</bundle> -->
+<!-- <bundle>mvn:org.apache.directory.studio/org.antlr.antlr/2.7.7</bundle> -->
+ <!--<bundle>wrap:mvn:org.apache.directory.studio/org.antlr.antlr/2.7.7/$Bundle-SymbolicName=org.antlr.antlr&Bundle-Version=2.7.7&Bundle-ManifestVersion="2"&Export-Package=*,antlr.*;version="2.7.7",!*</bundle>-->
<bundle>wrap:mvn:junit/junit/4.13.2/$Bundle-SymbolicName=junit&Bundle-Version=4.13.2&Bundle-ManifestVersion="2"&Export-Package=*;version="4.13.2",!*</bundle>
- <bundle>mvn:org.apache.directory.api/api-asn1-api/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-asn1-ber/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-i18n/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-util/2.1.4</bundle>
+ <bundle>mvn:org.apache.directory.api/api-asn1-api/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-asn1-ber/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-i18n/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-util/2.1.7</bundle>
<bundle>mvn:org.apache.mina/mina-core/2.2.2</bundle>
@@ -540,52 +544,54 @@ dataSourceName=rtdb
<bundle>wrap:mvn:com.guicedee.services/commons-collections4/62/$Bundle-SymbolicName=collections4&Bundle-Version=62&Bundle-ManifestVersion="2"&Export-Package=*;version="62",!*</bundle>
<bundle>mvn:org.apache.commons/commons-pool2/2.12.0</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-model/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-codec-core/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-schema-data/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-extras-aci/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-extras-util/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-extras-codec-api/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-extras-codec/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-extras-trigger/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-extras-sp/2.1.4</bundle>
- <bundle>mvn:org.apache.directory.api/api-ldap-client-api/2.1.4</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-model/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-codec-core/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-schema-data/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-extras-aci/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-extras-util/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-extras-codec-api/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-extras-codec/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-extras-trigger/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-extras-sp/2.1.7</bundle>
+ <bundle>mvn:org.apache.directory.api/api-ldap-client-api/2.1.7</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-i18n/2.0.0.AM26</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-i18n/2.0.0.AM27</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core-shared/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core-annotations/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core-api/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core-avl/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core-constants/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core-jndi/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-core-integ/2.0.0.AM26</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core-shared/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core-annotations/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core-api/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core-avl/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core-constants/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core-jndi/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-core-integ/2.0.0.AM27</bundle>
<bundle>wrap:mvn:org.apache.directory.server/apacheds-core-entry/1.5.7/$Bundle-SymbolicName=kerberos-shared&Bundle-Version=1.5.7&Bundle-ManifestVersion="2"&Export-Package=*;version="1.5.7",!*</bundle>
<!--<bundle>mvn:org.apache.directory.server/apacheds-core-entry/1.5.7</bundle>-->
-
- <bundle>mvn:org.apache.directory.server/apacheds-interceptor-kerberos/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-admin/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-authn/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-authz/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-changelog/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-collective/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-event/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-exception/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-journal/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-normalization/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-operational/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-referral/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-schema/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-subtree/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-interceptors-trigger/2.0.0.AM26</bundle>
+ <bundle>wrap:mvn:org.apache.directory.server/apacheds-all/2.0.0.AM27/$Bundle-SymbolicName=apacheds-all&Bundle-Version=2.0.0.AM27&Bundle-ManifestVersion="2"&Export-Package=*;version="2.0.0.AM27",!*</bundle>
+
+
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptor-kerberos/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-admin/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-authn/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-authz/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-changelog/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-collective/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-event/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-exception/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-journal/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-normalization/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-operational/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-referral/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-schema/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-subtree/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-interceptors-trigger/2.0.0.AM27</bundle>
<bundle>mvn:org.apache.directory.server/apacheds-jdbm/2.0.0-M5</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-jdbm-partition/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-mavibot-partition/2.0.0.AM26</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-jdbm-partition/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-mavibot-partition/2.0.0.AM27</bundle>
<!--<bundle>mvn:org.apache.directory.server/apacheds-mavibotv2-partition/2.0.0.AM26</bundle>-->
<bundle>mvn:org.apache.directory.mavibot/mavibot/1.0.0-M8</bundle>
@@ -593,28 +599,28 @@ dataSourceName=rtdb
<bundle>wrap:mvn:org.apache.directory.server/apacheds-kerberos-shared/1.5.7/$Bundle-SymbolicName=kerberos-shared&Bundle-Version=1.5.7&Bundle-ManifestVersion="2"&Export-Package=*;version="1.5.7",!*</bundle>
<!--<bundle>mvn:org.apache.directory.server/apacheds-kerberos-shared/1.5.7</bundle>-->
- <bundle>mvn:org.apache.directory.server/apacheds-ldif-partition/2.0.0.AM26</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-ldif-partition/2.0.0.AM27</bundle>
<bundle>wrap:mvn:org.apache.directory.server/apacheds-protocol-changepw/1.5.7/$Bundle-SymbolicName=changepw4&Bundle-Version=1.5.7&Bundle-ManifestVersion="2"&Export-Package=*;version="1.5.7",!*</bundle>
<!--<bundle>mvn:org.apache.directory.server/apacheds-protocol-changepw/1.5.7</bundle>-->
- <bundle>mvn:org.apache.directory.server/apacheds-protocol-dhcp/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-protocol-dns/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-kerberos-codec/2.0.0.AM26</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-protocol-dhcp/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-protocol-dns/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-kerberos-codec/2.0.0.AM27</bundle>
<bundle>mvn:org.apache.directory.server/apacheds-protocol-kerberos/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-protocol-ldap/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-protocol-ntp/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-protocol-shared/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-server-annotations/2.0.0.AM26</bundle>
- <bundle>mvn:org.apache.directory.server/apacheds-server-jndi/2.0.0.AM26</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-protocol-ldap/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-protocol-ntp/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-protocol-shared/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-server-annotations/2.0.0.AM27</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-server-jndi/2.0.0.AM27</bundle>
<!--<bundle>mvn:org.apache.directory.server/apacheds-server-replication/2.0.0.AM26</bundle>-->
<!--<bundle>mvn:org.apache.directory.server/apacheds-test-framework/2.0.0.AM26</bundle>-->
- <bundle>mvn:org.apache.directory.server/apacheds-xdbm-partition/2.0.0.AM26</bundle>
+ <bundle>mvn:org.apache.directory.server/apacheds-xdbm-partition/2.0.0.AM27</bundle>
<bundle start-level="80">mvn:org.apache.plc4x.merlot.uns/org.apache.plc4x.merlot.uns/${project.version}</bundle>
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/pom.xml b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/pom.xml
index fbbe29c..40215b0 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/pom.xml
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/pom.xml
@@ -51,7 +51,8 @@
<Bundle-Version>0.13.0-SNAPSHOT</Bundle-Version>
<Export-Package>org.apache.plc4x.merlot.uns*;version=0.13.0-SNAPSHOT</Export-Package>
<Import-Package>*</Import-Package>
- <Karaf-Commands>org.apache.plc4x.merlot.uns.command*</Karaf-Commands>
+ <Karaf-Commands>org.apache.plc4x.merlot.uns.command*</Karaf-Commands>
+ <_removeheaders>Import-Service,Export-Service</_removeheaders>
</instructions>
</configuration>
</plugin>
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/java/org/apache/plc4x/merlot/uns/core/LdapEmbeddedServerV2.java b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/java/org/apache/plc4x/merlot/uns/core/LdapEmbeddedServerV2.java
new file mode 100644
index 0000000..5048017
--- /dev/null
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/java/org/apache/plc4x/merlot/uns/core/LdapEmbeddedServerV2.java
@@ -0,0 +1,46 @@
+/*
+ * 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
+ *
+ * https://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.plc4x.merlot.uns.core;
+
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifFiles;
+import org.apache.directory.server.core.annotations.CreateDS;
+import org.apache.directory.server.core.annotations.CreatePartition;
+
+
+@CreateDS(name = "myDS",
+ partitions = {
+ @CreatePartition(name = "test", suffix = "dc=myorg,dc=com")
+ })
+@CreateLdapServer(transports = { @CreateTransport(protocol = "LDAP", address = "localhost", port=10359)})
+@ApplyLdifFiles(value = {"data/autentia-identity-repository.ldif"})
+public class LdapEmbeddedServerV2 {
+
+ public void init(){
+ System.out.println("Inicalizo el servidor...");
+ }
+
+ public void destroy() {
+ System.out.println("Destruye el servidor...");
+ }
+
+
+
+}
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/java/org/apache/plc4x/merlot/uns/core/ModelRPCService.java b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/java/org/apache/plc4x/merlot/uns/core/ModelRPCService.java
index 0e64ca0..02b368f 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/java/org/apache/plc4x/merlot/uns/core/ModelRPCService.java
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/java/org/apache/plc4x/merlot/uns/core/ModelRPCService.java
@@ -30,15 +30,11 @@ import org.epics.pvdata.factory.PVDataFactory;
import org.epics.pvdata.pv.FieldCreate;
import org.epics.pvdata.pv.PVDataCreate;
import org.epics.pvdata.pv.PVLong;
-import org.epics.pvdata.pv.PVScalarArray;
import org.epics.pvdata.pv.PVString;
import org.epics.pvdata.pv.PVStringArray;
import org.epics.pvdata.pv.PVStructure;
import org.epics.pvdata.pv.ScalarType;
import org.epics.pvdata.pv.Status;
-import org.epics.pvdata.pv.Structure;
-import org.epics.pvdatabase.PVDatabase;
-import org.epics.pvdatabase.PVDatabaseFactory;
import org.epics.pvdatabase.PVRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/resources/OSGI-INF/blueprint/uns-service.xml b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/resources/OSGI-INF/blueprint/uns-service.xml
index 8346f68..5dca3f4 100644
--- a/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/resources/OSGI-INF/blueprint/uns-service.xml
+++ b/plc4j/tools/merlot/org.apache.plc4x.merlot.uns/src/main/resources/OSGI-INF/blueprint/uns-service.xml
@@ -49,8 +49,8 @@
<argument ref="MerlotModel" />
</bean>
- <bean id="beanLdapServer"
- class="org.apache.plc4x.merlot.uns.core.LdapEmbeddedServer"
+ <bean id="LdapServerBean"
+ class="org.apache.plc4x.merlot.uns.core.LdapEmbeddedServerV2"
scope="singleton"
init-method="init" destroy-method="destroy">
</bean>
diff --git a/plc4j/tools/merlot/pom.xml b/plc4j/tools/merlot/pom.xml
index e3ffc75..edac304 100644
--- a/plc4j/tools/merlot/pom.xml
+++ b/plc4j/tools/merlot/pom.xml
@@ -45,13 +45,13 @@ under the License.
<c3p0.version>0.9.5.5</c3p0.version>
<commons-codec.version>1.17.1</commons-codec.version>
<commons-net.version>3.11.1</commons-net.version>
- <commons-lang3.version>3.16.0</commons-lang3.version>
+ <commons-lang3.version>3.17.0</commons-lang3.version>
<hikaricp.version>2.7.9</hikaricp.version>
<netty.version>4.1.104.Final</netty.version>
<quartz.version>2.3.2</quartz.version>
<slf4j.version>2.0.3</slf4j.version>
<spifly.version>1.3.6</spifly.version>
- <jackson.version>2.16.1</jackson.version>
+ <jackson.version>2.17.2</jackson.version>
<jakarta.xml.bind.version>2.3.3</jakarta.xml.bind.version>
<parser-ng.version>0.1.8</parser-ng.version>
<vavr.version>0.10.4</vavr.version>
@@ -62,6 +62,7 @@ under the License.
<!-- Database used in Pax-jdbc -->
<derby.version>10.14.2.0</derby.version>
<h2.version>2.1.210</h2.version>
+ <sqlite-jdbc.version>3.46.1.0</sqlite-jdbc.version>
<!-- Remove GPL licence -->
<javaluator.version>3.0.3</javaluator.version>