This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch 
4172-use-domain-storage-interfaces-instead-of-crudstorage-in-inosqlstorage
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 8529d32370ad579b8483bd9a9efd61cde279c4db
Author: Philipp Zehnder <[email protected]>
AuthorDate: Thu Feb 12 21:48:36 2026 +0100

    refactor(#4172): introduce ITransformationScriptTemplateStorage and migrate 
getTransformationScriptTemplateStorage to typed interface
---
 .../TransformationScriptTemplateResource.java      |  4 +--
 .../streampipes/storage/api/INoSqlStorage.java     |  3 +-
 .../api/ITransformationScriptTemplateStorage.java  | 23 +++++++++++++++
 .../storage/couchdb/CouchDbStorageManager.java     | 10 +++----
 .../TransformationScriptTemplateStorageImpl.java   | 34 ++++++++++++++++++++++
 5 files changed, 64 insertions(+), 10 deletions(-)

diff --git 
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/TransformationScriptTemplateResource.java
 
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/TransformationScriptTemplateResource.java
index cef431bf98..459d94509b 100644
--- 
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/TransformationScriptTemplateResource.java
+++ 
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/TransformationScriptTemplateResource.java
@@ -20,7 +20,7 @@ package org.apache.streampipes.rest.impl.connect;
 
 import 
org.apache.streampipes.model.connect.ConnectTransformationScriptTemplate;
 import 
org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
-import org.apache.streampipes.storage.api.CRUDStorage;
+import org.apache.streampipes.storage.api.ITransformationScriptTemplateStorage;
 import org.apache.streampipes.storage.management.StorageDispatcher;
 
 import org.springframework.http.MediaType;
@@ -39,7 +39,7 @@ import java.util.List;
 @RequestMapping("/api/v2/connect/master/script-templates")
 public class TransformationScriptTemplateResource extends 
AbstractAuthGuardedRestResource {
 
-  private final CRUDStorage<ConnectTransformationScriptTemplate> 
templateStorage = StorageDispatcher
+  private final ITransformationScriptTemplateStorage templateStorage = 
StorageDispatcher
       .INSTANCE.getNoSqlStore().getTransformationScriptTemplateStorage();
 
   @GetMapping(
diff --git 
a/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
 
b/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
index 6c40f0c6d8..9b4ab19ac5 100644
--- 
a/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
+++ 
b/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/INoSqlStorage.java
@@ -17,7 +17,6 @@
  */
 package org.apache.streampipes.storage.api;
 
-import 
org.apache.streampipes.model.connect.ConnectTransformationScriptTemplate;
 
 public interface INoSqlStorage {
 
@@ -79,5 +78,5 @@ public interface INoSqlStorage {
 
   IAssetStorage getAssetStorage();
 
-  CRUDStorage<ConnectTransformationScriptTemplate> 
getTransformationScriptTemplateStorage();
+  ITransformationScriptTemplateStorage 
getTransformationScriptTemplateStorage();
 }
diff --git 
a/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/ITransformationScriptTemplateStorage.java
 
b/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/ITransformationScriptTemplateStorage.java
new file mode 100644
index 0000000000..153715350f
--- /dev/null
+++ 
b/streampipes-storage-api/src/main/java/org/apache/streampipes/storage/api/ITransformationScriptTemplateStorage.java
@@ -0,0 +1,23 @@
+/*
+ * 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.streampipes.storage.api;
+
+import 
org.apache.streampipes.model.connect.ConnectTransformationScriptTemplate;
+
+public interface ITransformationScriptTemplateStorage extends 
CRUDStorage<ConnectTransformationScriptTemplate> {
+}
diff --git 
a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
 
b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
index 3e02ae4b2f..e06aed99e2 100644
--- 
a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
+++ 
b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/CouchDbStorageManager.java
@@ -46,6 +46,7 @@ import org.apache.streampipes.storage.api.IPipelineStorage;
 import org.apache.streampipes.storage.api.IPrivilegeStorage;
 import org.apache.streampipes.storage.api.IRoleStorage;
 import org.apache.streampipes.storage.api.ISpCoreConfigurationStorage;
+import org.apache.streampipes.storage.api.ITransformationScriptTemplateStorage;
 import org.apache.streampipes.storage.api.IUserActivationTokenStorage;
 import org.apache.streampipes.storage.api.IUserGroupStorage;
 import org.apache.streampipes.storage.api.IUserStorage;
@@ -77,6 +78,7 @@ import 
org.apache.streampipes.storage.couchdb.impl.PipelineElementTemplateStorag
 import org.apache.streampipes.storage.couchdb.impl.PipelineStorageImpl;
 import org.apache.streampipes.storage.couchdb.impl.PrivilegeStorageImpl;
 import org.apache.streampipes.storage.couchdb.impl.RoleStorageImpl;
+import 
org.apache.streampipes.storage.couchdb.impl.TransformationScriptTemplateStorageImpl;
 import 
org.apache.streampipes.storage.couchdb.impl.UserActivationTokenStorageImpl;
 import org.apache.streampipes.storage.couchdb.impl.UserGroupStorageImpl;
 import org.apache.streampipes.storage.couchdb.impl.UserStorage;
@@ -233,11 +235,7 @@ public class CouchDbStorageManager implements 
INoSqlStorage {
   }
 
   @Override
-  public CRUDStorage<ConnectTransformationScriptTemplate> 
getTransformationScriptTemplateStorage() {
-    return new DefaultViewCrudStorage<>(
-        () -> Utils.getCouchDbGsonClient("genericstorage"),
-        ConnectTransformationScriptTemplate.class,
-        "transformation-scripts/all-transformations"
-    );
+  public ITransformationScriptTemplateStorage 
getTransformationScriptTemplateStorage() {
+    return new TransformationScriptTemplateStorageImpl();
   }
 }
diff --git 
a/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/impl/TransformationScriptTemplateStorageImpl.java
 
b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/impl/TransformationScriptTemplateStorageImpl.java
new file mode 100644
index 0000000000..553cc0352a
--- /dev/null
+++ 
b/streampipes-storage-couchdb/src/main/java/org/apache/streampipes/storage/couchdb/impl/TransformationScriptTemplateStorageImpl.java
@@ -0,0 +1,34 @@
+/*
+ * 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.streampipes.storage.couchdb.impl;
+
+import 
org.apache.streampipes.model.connect.ConnectTransformationScriptTemplate;
+import org.apache.streampipes.storage.api.ITransformationScriptTemplateStorage;
+import org.apache.streampipes.storage.couchdb.utils.Utils;
+
+public class TransformationScriptTemplateStorageImpl extends 
DefaultViewCrudStorage<ConnectTransformationScriptTemplate>
+    implements ITransformationScriptTemplateStorage {
+
+  public TransformationScriptTemplateStorageImpl() {
+    super(
+        () -> Utils.getCouchDbGsonClient("genericstorage"),
+        ConnectTransformationScriptTemplate.class,
+        "transformation-scripts/all-transformations"
+    );
+  }
+}

Reply via email to