tenthe commented on code in PR #2645:
URL: https://github.com/apache/streampipes/pull/2645#discussion_r1542445945


##########
streampipes-model/src/main/java/org/apache/streampipes/model/extensions/ExtensionAsset.java:
##########
@@ -15,15 +15,11 @@
  * limitations under the License.
  *
  */
-package org.apache.streampipes.svcdiscovery.api.model;
 
-import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceTag;
-import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceTagPrefix;
+package org.apache.streampipes.model.extensions;
 
-public class DefaultSpServiceTags {
+public class ExtensionAsset {

Review Comment:
   Suggestion: Rename to ExtensionAssetTypes



##########
streampipes-service-extensions/src/main/java/org/apache/streampipes/service/extensions/StreamPipesExtensionsServiceBase.java:
##########
@@ -98,22 +126,50 @@ private void registerService(SpServiceRegistration 
serviceRegistration) {
     new CoreRequestSubmitter().submitRegistrationRequest(client, 
serviceRegistration);
   }
 
-  protected List<SpServiceTag> getServiceTags() {
-    List<SpServiceTag> tags = new ArrayList<>();
+  protected Set<SpServiceTag> getServiceTags(Set<ExtensionItemDescription> 
extensions) {
+    Set<SpServiceTag> tags = new HashSet<>();
     if (DeclarersSingleton.getInstance().getServiceDefinition() != null) {
       tags.add(SpServiceTag.create(SpServiceTagPrefix.SP_GROUP,
           
DeclarersSingleton.getInstance().getServiceDefinition().getServiceGroup()));
     }
-    tags.addAll(getExtensionsServiceTags());
+    tags.addAll(getExtensionsServiceTags(extensions));
     return tags;
   }
 
+  private Set<ExtensionItemDescription> getAllExtensions() {

Review Comment:
   This method is quite hard to read. Maybe it can be rafacored.



##########
streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/endpoint/AvailableExtensionsProvider.java:
##########
@@ -0,0 +1,108 @@
+/*
+ * 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.manager.endpoint;
+
+import org.apache.streampipes.model.SpDataStream;
+import org.apache.streampipes.model.base.NamedStreamPipesEntity;
+import org.apache.streampipes.model.connect.adapter.AdapterDescription;
+import org.apache.streampipes.model.extensions.ExtensionItemDescription;
+import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceStatus;
+import org.apache.streampipes.model.graph.DataProcessorDescription;
+import org.apache.streampipes.model.graph.DataSinkDescription;
+import org.apache.streampipes.storage.api.INoSqlStorage;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+public class AvailableExtensionsProvider {
+
+  private final INoSqlStorage storage;
+
+  public AvailableExtensionsProvider(INoSqlStorage storage) {
+    this.storage = storage;
+  }
+

Review Comment:
   Maybe the method can also be renamed to `getExtensionItemDescriptions` or 
`getExtensionItems`. What do you think?



##########
streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceDiscoveryCore.java:
##########
@@ -74,9 +75,14 @@ private String makeServiceUrl(SpServiceRegistration service) 
{
 
   private boolean allFiltersSupported(SpServiceRegistration service,

Review Comment:
   ```suggestion
   /**
   * Checks if all the tags specified in the filter are supported by the 
service.
   */
     private boolean allFiltersSupported(SpServiceRegistration service,
   ```



##########
streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/api/extensions/IExtensionsProvider.java:
##########
@@ -16,17 +16,13 @@
  *
  */
 
-package org.apache.streampipes.storage.api;
+package org.apache.streampipes.manager.api.extensions;
 
-import org.apache.streampipes.model.client.endpoint.ExtensionsServiceEndpoint;
+import org.apache.streampipes.model.extensions.ExtensionItemDescription;
 
 import java.util.List;
 
-public interface IExtensionsServiceEndpointStorage {

Review Comment:
   This interface seems not to be used anymore, can  it be deleted? 



##########
streampipes-service-extensions/src/main/java/org/apache/streampipes/service/extensions/StreamPipesExtensionsServiceBase.java:
##########
@@ -98,22 +126,50 @@ private void registerService(SpServiceRegistration 
serviceRegistration) {
     new CoreRequestSubmitter().submitRegistrationRequest(client, 
serviceRegistration);
   }
 
-  protected List<SpServiceTag> getServiceTags() {
-    List<SpServiceTag> tags = new ArrayList<>();
+  protected Set<SpServiceTag> getServiceTags(Set<ExtensionItemDescription> 
extensions) {
+    Set<SpServiceTag> tags = new HashSet<>();
     if (DeclarersSingleton.getInstance().getServiceDefinition() != null) {
       tags.add(SpServiceTag.create(SpServiceTagPrefix.SP_GROUP,
           
DeclarersSingleton.getInstance().getServiceDefinition().getServiceGroup()));
     }
-    tags.addAll(getExtensionsServiceTags());
+    tags.addAll(getExtensionsServiceTags(extensions));
     return tags;
   }
 
+  private Set<ExtensionItemDescription> getAllExtensions() {
+    return Stream.concat(
+            DeclarersSingleton.getInstance().getDeclarers().values().stream()
+                .map(declarer -> declarer.declareConfig().getDescription()),
+            DeclarersSingleton.getInstance().getAdapters().stream().map(a -> 
a.declareConfig().getAdapterDescription())
+        )
+        .peek(entity -> {
+          try {
+            if (entity.isIncludesLocales()) {
+              var labelGenerator = new LabelGenerator<>(entity);
+              entity.setName(labelGenerator.getElementTitle());
+              entity.setDescription(labelGenerator.getElementDescription());
+            }
+          } catch (IOException e) {
+

Review Comment:
   Here is an empty catch block. The exception should be logged



##########
streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/endpoint/AvailableExtensionsProvider.java:
##########
@@ -0,0 +1,108 @@
+/*
+ * 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.manager.endpoint;
+
+import org.apache.streampipes.model.SpDataStream;
+import org.apache.streampipes.model.base.NamedStreamPipesEntity;
+import org.apache.streampipes.model.connect.adapter.AdapterDescription;
+import org.apache.streampipes.model.extensions.ExtensionItemDescription;
+import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceStatus;
+import org.apache.streampipes.model.graph.DataProcessorDescription;
+import org.apache.streampipes.model.graph.DataSinkDescription;
+import org.apache.streampipes.storage.api.INoSqlStorage;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+public class AvailableExtensionsProvider {
+
+  private final INoSqlStorage storage;
+
+  public AvailableExtensionsProvider(INoSqlStorage storage) {
+    this.storage = storage;
+  }
+
+  public List<ExtensionItemDescription> getExtensions() {

Review Comment:
   Can you provide a few comments what is going on in this method? For me it is 
not quite clear what the logic is to geht all ExtensionItemDescriptions.



##########
ui/src/app/add/components/endpoint-item/endpoint-item.component.ts:
##########
@@ -47,12 +48,19 @@ export class EndpointItemComponent implements OnInit {
     iconReady = false;
     iconError = false;
 
+    cssMapper: Record<string, string> = {
+        ADAPTER: 'adapter',
+        DATA_STREAM: 'stream',
+        DATA_PROCESSOR: 'sepa',

Review Comment:
   Is it possible to replace sepa with processor? If the changes would be too 
big we should create a PR for this task



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to