exceptionfactory commented on a change in pull request #4863:
URL: https://github.com/apache/nifi/pull/4863#discussion_r697378737



##########
File path: 
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/services/azure/storage/ADLSCredentialsControllerService.java
##########
@@ -183,35 +171,35 @@ public void onEnabled(ConfigurationContext context) {
     public ADLSCredentialsDetails getCredentialsDetails(Map<String, String> 
attributes) {
         ADLSCredentialsDetails.Builder credentialsBuilder = 
ADLSCredentialsDetails.Builder.newBuilder();
 
-        setValue(credentialsBuilder, ACCOUNT_NAME, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setAccountName, attributes);
-        setValue(credentialsBuilder, AzureStorageUtils.ACCOUNT_KEY, 
PropertyValue::getValue, ADLSCredentialsDetails.Builder::setAccountKey, 
attributes);
-        setValue(credentialsBuilder, AzureStorageUtils.PROP_SAS_TOKEN, 
PropertyValue::getValue, ADLSCredentialsDetails.Builder::setSasToken, 
attributes);
-        setValue(credentialsBuilder, ENDPOINT_SUFFIX, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setEndpointSuffix, attributes);
-        setValue(credentialsBuilder, USE_MANAGED_IDENTITY, 
PropertyValue::asBoolean, 
ADLSCredentialsDetails.Builder::setUseManagedIdentity, attributes);
-        setValue(credentialsBuilder, SERVICE_PRINCIPAL_TENANT_ID, 
PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setServicePrincipalTenantId, attributes);
-        setValue(credentialsBuilder, SERVICE_PRINCIPAL_CLIENT_ID, 
PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setServicePrincipalClientId, attributes);
-        setValue(credentialsBuilder, SERVICE_PRINCIPAL_CLIENT_SECRET, 
PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setServicePrincipalClientSecret, attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, ACCOUNT_NAME, 
PropertyValue::getValue, ADLSCredentialsDetails.Builder::setAccountName, 
attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, 
AzureStorageUtils.ACCOUNT_KEY, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setAccountKey, attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, 
AzureStorageUtils.PROP_SAS_TOKEN, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setSasToken, attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, 
AzureStorageUtils.ADLS_ENDPOINT_SUFFIX, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setEndpointSuffix, attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, 
USE_MANAGED_IDENTITY, PropertyValue::asBoolean, 
ADLSCredentialsDetails.Builder::setUseManagedIdentity, attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, 
SERVICE_PRINCIPAL_TENANT_ID, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setServicePrincipalTenantId, attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, 
SERVICE_PRINCIPAL_CLIENT_ID, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setServicePrincipalClientId, attributes);
+        AzureStorageUtils.setValue(context, credentialsBuilder, 
SERVICE_PRINCIPAL_CLIENT_SECRET, PropertyValue::getValue, 
ADLSCredentialsDetails.Builder::setServicePrincipalClientSecret, attributes);
 
         return credentialsBuilder.build();
     }
 
-    private <T> void setValue(
-            ADLSCredentialsDetails.Builder credentialsBuilder,
-            PropertyDescriptor propertyDescriptor, Function<PropertyValue, T> 
getPropertyValue,
-            BiConsumer<ADLSCredentialsDetails.Builder, T> setBuilderValue, 
Map<String, String> attributes
-    ) {
-        PropertyValue property = context.getProperty(propertyDescriptor);
-
-        if (property.isSet()) {
-            if (propertyDescriptor.isExpressionLanguageSupported()) {
-                if (propertyDescriptor.getExpressionLanguageScope() == 
ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) {
-                    property = 
property.evaluateAttributeExpressions(attributes);
-                } else {
-                    property = property.evaluateAttributeExpressions();
-                }
-            }
-            T value = getPropertyValue.apply(property);
-            setBuilderValue.accept(credentialsBuilder, value);
-        }
-    }
+//    private <T> void setValue(
+//            ADLSCredentialsDetails.Builder credentialsBuilder,
+//            PropertyDescriptor propertyDescriptor, Function<PropertyValue, 
T> getPropertyValue,
+//            BiConsumer<ADLSCredentialsDetails.Builder, T> setBuilderValue, 
Map<String, String> attributes
+//    ) {
+//        PropertyValue property = context.getProperty(propertyDescriptor);
+//
+//        if (property.isSet()) {
+//            if (propertyDescriptor.isExpressionLanguageSupported()) {
+//                if (propertyDescriptor.getExpressionLanguageScope() == 
ExpressionLanguageScope.FLOWFILE_ATTRIBUTES) {
+//                    property = 
property.evaluateAttributeExpressions(attributes);
+//                } else {
+//                    property = property.evaluateAttributeExpressions();
+//                }
+//            }
+//            T value = getPropertyValue.apply(property);
+//            setBuilderValue.accept(credentialsBuilder, value);
+//        }
+//    }

Review comment:
       Is there a reason for leaving this code commented out? If it is not 
used, it should be removed.




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