bossenti commented on code in PR #1290: URL: https://github.com/apache/streampipes/pull/1290#discussion_r1207896415
########## streampipes-extensions-api/src/main/java/org/apache/streampipes/extensions/api/extractor/IParameterExtractor.java: ########## @@ -0,0 +1,119 @@ +/* + * 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.extensions.api.extractor; + +import org.apache.streampipes.commons.exceptions.SpRuntimeException; +import org.apache.streampipes.model.base.InvocableStreamPipesEntity; +import org.apache.streampipes.model.schema.EventProperty; +import org.apache.streampipes.model.schema.EventPropertyPrimitive; +import org.apache.streampipes.model.schema.PropertyScope; +import org.apache.streampipes.model.staticproperty.StaticProperty; +import org.apache.streampipes.model.staticproperty.StaticPropertyGroup; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +public interface IParameterExtractor<T extends InvocableStreamPipesEntity> { + String measurementUnit(String runtimeName, Integer streamIndex); + + String inputTopic(Integer streamIndex); + + Object singleValueParameter(EventPropertyPrimitive targetType, String internalName); + + <V> V singleValueParameter(String internalName, Class<V> targetClass); + + String textParameter(String internalName); + + String secretValue(String internalName); + + boolean slideToggleValue(String internalName); + + String codeblockValue(String internalName); + + String selectedColor(String internalName); + + @Deprecated(since = "0.90.0", forRemoval = true) + String fileContentsAsString(String internalName) throws IOException; Review Comment: Do we keep this for compatibility reasons? Or why do we introduce new code that is directly marked as deprecated? ########## streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/connect/adapter/parser/util/JsonEventProperty.java: ########## @@ -77,13 +79,15 @@ public static EventProperty getEventProperty(String key, Object o) { ((EventPropertyList) resultProperty).setEventProperty(arrayContent); resultProperty.setRuntimeName(key); + } if (resultProperty == null) { LOG.error("Property Type was not detected in JsonParser for the schema detection. " - + "This should never happen!"); + + "This should never happen!"); } + resultProperty.setDescription(""); Review Comment: Can't we retrieve the description from somewhere or could we pass it to the method? ########## streampipes-extensions-api/src/main/java/org/apache/streampipes/extensions/api/extractor/IStaticPropertyExtractor.java: ########## @@ -0,0 +1,24 @@ +/* + * 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.extensions.api.extractor; + +import org.apache.streampipes.model.graph.DataSinkInvocation; + +public interface IStaticPropertyExtractor extends IParameterExtractor<DataSinkInvocation> { +} Review Comment: Do we need this level of abstraction? Does it introduce anything than the naming? -- 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]
