takraj commented on code in PR #8892:
URL: https://github.com/apache/nifi/pull/8892#discussion_r1678063677


##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-parameter-providers/src/main/java/org/apache/nifi/parameter/DatabaseParameterProvider.java:
##########
@@ -38,37 +26,34 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.ServiceLoader;
 import java.util.stream.Collectors;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.ConfigVerificationResult;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.PropertyDescriptor.Builder;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.db.DatabaseAdapter;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.util.StringUtils;
 
 @Tags({"database", "dbcp", "sql"})
 @CapabilityDescription("Fetches parameters from database tables")
 
 public class DatabaseParameterProvider extends AbstractParameterProvider 
implements VerifiableParameterProvider {
 
-    protected final static Map<String, DatabaseAdapter> dbAdapters = new 
HashMap<>();
-
-    public static final PropertyDescriptor DB_TYPE;
-
-    static {
-        // Load the DatabaseAdapters
-        ArrayList<AllowableValue> dbAdapterValues = new ArrayList<>();
-        ServiceLoader<DatabaseAdapter> dbAdapterLoader = 
ServiceLoader.load(DatabaseAdapter.class);
-        dbAdapterLoader.forEach(it -> {
-            dbAdapters.put(it.getName(), it);
-            dbAdapterValues.add(new AllowableValue(it.getName(), it.getName(), 
it.getDescription()));
-        });
-
-        DB_TYPE = new PropertyDescriptor.Builder()
-                .name("db-type")
-                .displayName("Database Type")
-                .description("The type/flavor of database, used for generating 
database-specific code. In many cases the Generic type "
-                        + "should suffice, but some databases (such as Oracle) 
require custom SQL clauses. ")
-                .allowableValues(dbAdapterValues.toArray(new 
AllowableValue[dbAdapterValues.size()]))
-                .defaultValue("Generic")
-                .required(true)
-                .build();
-    }
+    // TODO: There was no migration facility for Parameter Providers by the 
time of introducing this property,

Review Comment:
   @joewitt , @exceptionfactory 
   
   I have a draft PR that attempts to add the missing, property migration 
feature to the Parameter Provider component. Currently it is only 
half-complete, becuase I can't really find where is the proper place to call 
the `migrateProperties()` method. The place where I've now inserted it, seems 
to not get called. I assume it is because Parameter Providers do not belong to 
Process Groups.
   
   Could you please have a look?
   
   [Pull Request #9080](https://github.com/apache/nifi/pull/9080)



-- 
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