Skip to content

Commit f73153d

Browse files
authored
NIFI-15018 Standardized Property Names in email, enrich, evtx, extension-utils, and flow-registry-client bundles (#10362)
Signed-off-by: David Handermann <[email protected]>
1 parent 95ec7da commit f73153d

File tree

57 files changed

+415
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+415
-158
lines changed

nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/ListS3.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ public void migrateProperties(PropertyConfiguration config) {
392392
config.renameProperty("requester-pays", REQUESTER_PAYS.getName());
393393
config.renameProperty("write-s3-user-metadata", WRITE_USER_METADATA.getName());
394394
config.renameProperty("record-writer", RECORD_WRITER.getName());
395+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_STATE_CACHE_PROPERTY_NAME, TRACKING_STATE_CACHE.getName());
396+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_TIME_WINDOW_PROPERTY_NAME, TRACKING_TIME_WINDOW.getName());
397+
config.renameProperty(ListedEntityTracker.OLD_INITIAL_LISTING_TARGET_PROPERTY_NAME, INITIAL_LISTING_TARGET.getName());
395398
}
396399

397400
protected ListedEntityTracker<ListableEntityWrapper<S3VersionSummary>> createListedEntityTracker() {

nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/ListAzureBlobStorage_v12.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ public void migrateProperties(PropertyConfiguration config) {
173173
config.renameProperty(AzureStorageUtils.OLD_CONTAINER_DESCRIPTOR_NAME, CONTAINER.getName());
174174
config.renameProperty(AzureStorageUtils.OLD_BLOB_STORAGE_CREDENTIALS_SERVICE_DESCRIPTOR_NAME, AzureStorageUtils.BLOB_STORAGE_CREDENTIALS_SERVICE.getName());
175175
config.renameProperty("blob-name-prefix", BLOB_NAME_PREFIX.getName());
176+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_STATE_CACHE_PROPERTY_NAME, TRACKING_STATE_CACHE.getName());
177+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_TIME_WINDOW_PROPERTY_NAME, TRACKING_TIME_WINDOW.getName());
178+
config.renameProperty(ListedEntityTracker.OLD_INITIAL_LISTING_TARGET_PROPERTY_NAME, INITIAL_LISTING_TARGET.getName());
176179
}
177180

178181
@Override

nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/ListAzureDataLakeStorage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.apache.nifi.migration.PropertyConfiguration;
4444
import org.apache.nifi.processor.ProcessContext;
4545
import org.apache.nifi.processor.util.StandardValidators;
46+
import org.apache.nifi.processor.util.list.ListedEntityTracker;
4647
import org.apache.nifi.processors.azure.storage.utils.ADLSFileInfo;
4748
import org.apache.nifi.processors.azure.storage.utils.AzureStorageUtils;
4849
import org.apache.nifi.processors.azure.storage.utils.DataLakeServiceClientFactory;
@@ -203,6 +204,9 @@ public void migrateProperties(PropertyConfiguration config) {
203204
config.renameProperty("file-filter", FILE_FILTER.getName());
204205
config.renameProperty("path-filter", PATH_FILTER.getName());
205206
config.renameProperty("include-temporary-files", INCLUDE_TEMPORARY_FILES.getName());
207+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_STATE_CACHE_PROPERTY_NAME, TRACKING_STATE_CACHE.getName());
208+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_TIME_WINDOW_PROPERTY_NAME, TRACKING_TIME_WINDOW.getName());
209+
config.renameProperty(ListedEntityTracker.OLD_INITIAL_LISTING_TARGET_PROPERTY_NAME, INITIAL_LISTING_TARGET.getName());
206210
}
207211

208212
@Override

nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/test/java/org/apache/nifi/processors/azure/storage/TestListAzureBlobStorage_v12.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.nifi.processors.azure.storage;
1818

19+
import org.apache.nifi.processor.util.list.ListedEntityTracker;
1920
import org.apache.nifi.processors.azure.storage.utils.AzureStorageUtils;
2021
import org.apache.nifi.util.PropertyMigrationResult;
2122
import org.apache.nifi.util.TestRunner;
@@ -34,8 +35,12 @@ void testMigration() {
3435
final Map<String, String> expectedRenamed =
3536
Map.of(AzureStorageUtils.OLD_CONTAINER_DESCRIPTOR_NAME, ListAzureBlobStorage_v12.CONTAINER.getName(),
3637
AzureStorageUtils.OLD_BLOB_STORAGE_CREDENTIALS_SERVICE_DESCRIPTOR_NAME, AzureStorageUtils.BLOB_STORAGE_CREDENTIALS_SERVICE.getName(),
37-
"blob-name-prefix", ListAzureBlobStorage_v12.BLOB_NAME_PREFIX.getName());
38+
"blob-name-prefix", ListAzureBlobStorage_v12.BLOB_NAME_PREFIX.getName(),
39+
ListedEntityTracker.OLD_TRACKING_STATE_CACHE_PROPERTY_NAME, ListAzureBlobStorage_v12.TRACKING_STATE_CACHE.getName(),
40+
ListedEntityTracker.OLD_TRACKING_TIME_WINDOW_PROPERTY_NAME, ListAzureBlobStorage_v12.TRACKING_TIME_WINDOW.getName(),
41+
ListedEntityTracker.OLD_INITIAL_LISTING_TARGET_PROPERTY_NAME, ListAzureBlobStorage_v12.INITIAL_LISTING_TARGET.getName());
3842

39-
assertEquals(expectedRenamed, propertyMigrationResult.getPropertiesRenamed());
43+
final Map<String, String> actualRenamed = propertyMigrationResult.getPropertiesRenamed();
44+
expectedRenamed.forEach((key, value) -> assertEquals(actualRenamed.get(key), value));
4045
}
4146
}

nifi-extension-bundles/nifi-box-bundle/nifi-box-processors/src/main/java/org/apache/nifi/processors/box/ListBoxFile.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ public void migrateProperties(PropertyConfiguration config) {
174174
config.renameProperty("box-folder-id", FOLDER_ID.getName());
175175
config.renameProperty("recursive-search", RECURSIVE_SEARCH.getName());
176176
config.renameProperty("min-age", MIN_AGE.getName());
177+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_STATE_CACHE_PROPERTY_NAME, TRACKING_STATE_CACHE.getName());
178+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_TIME_WINDOW_PROPERTY_NAME, TRACKING_TIME_WINDOW.getName());
179+
config.renameProperty(ListedEntityTracker.OLD_INITIAL_LISTING_TARGET_PROPERTY_NAME, INITIAL_LISTING_TARGET.getName());
177180
}
178181

179182
@Override

nifi-extension-bundles/nifi-dropbox-bundle/nifi-dropbox-processors/src/main/java/org/apache/nifi/processors/dropbox/ListDropbox.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ public void migrateProperties(PropertyConfiguration config) {
168168
config.renameProperty("folder", FOLDER.getName());
169169
config.renameProperty("recursive-search", RECURSIVE_SEARCH.getName());
170170
config.renameProperty("min-age", MIN_AGE.getName());
171+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_STATE_CACHE_PROPERTY_NAME, TRACKING_STATE_CACHE.getName());
172+
config.renameProperty(ListedEntityTracker.OLD_TRACKING_TIME_WINDOW_PROPERTY_NAME, TRACKING_TIME_WINDOW.getName());
173+
config.renameProperty(ListedEntityTracker.OLD_INITIAL_LISTING_TARGET_PROPERTY_NAME, INITIAL_LISTING_TARGET.getName());
171174
}
172175

173176
@Override

nifi-extension-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/AbstractEmailProcessor.java

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.nifi.components.PropertyDescriptor;
2323
import org.apache.nifi.expression.ExpressionLanguageScope;
2424
import org.apache.nifi.flowfile.FlowFile;
25+
import org.apache.nifi.migration.PropertyConfiguration;
2526
import org.apache.nifi.oauth2.AccessToken;
2627
import org.apache.nifi.oauth2.OAuth2AccessTokenProvider;
2728
import org.apache.nifi.processor.AbstractProcessor;
@@ -70,48 +71,42 @@ abstract class AbstractEmailProcessor<T extends AbstractMailReceiver> extends Ab
7071
"Use OAuth2 to acquire access token"
7172
);
7273
public static final PropertyDescriptor HOST = new PropertyDescriptor.Builder()
73-
.name("host")
74-
.displayName("Host Name")
74+
.name("Host Name")
7575
.description("Network address of Email server (e.g., pop.gmail.com, imap.gmail.com . . .)")
7676
.required(true)
7777
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
7878
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
7979
.build();
8080
public static final PropertyDescriptor PORT = new PropertyDescriptor.Builder()
81-
.name("port")
82-
.displayName("Port")
81+
.name("Port")
8382
.description("Numeric value identifying Port of Email server (e.g., 993)")
8483
.required(true)
8584
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
8685
.addValidator(StandardValidators.PORT_VALIDATOR)
8786
.build();
8887
public static final PropertyDescriptor AUTHORIZATION_MODE = new PropertyDescriptor.Builder()
89-
.name("authorization-mode")
90-
.displayName("Authorization Mode")
88+
.name("Authorization Mode")
9189
.description("How to authorize sending email on the user's behalf.")
9290
.required(true)
9391
.allowableValues(PASSWORD_BASED_AUTHORIZATION_MODE, OAUTH_AUTHORIZATION_MODE)
9492
.defaultValue(PASSWORD_BASED_AUTHORIZATION_MODE)
9593
.build();
9694
public static final PropertyDescriptor OAUTH2_ACCESS_TOKEN_PROVIDER = new PropertyDescriptor.Builder()
97-
.name("oauth2-access-token-provider")
98-
.displayName("OAuth2 Access Token Provider")
95+
.name("OAuth2 Access Token Provider")
9996
.description("OAuth2 service that can provide access tokens.")
10097
.identifiesControllerService(OAuth2AccessTokenProvider.class)
10198
.dependsOn(AUTHORIZATION_MODE, OAUTH_AUTHORIZATION_MODE)
10299
.required(true)
103100
.build();
104101
public static final PropertyDescriptor USER = new PropertyDescriptor.Builder()
105-
.name("user")
106-
.displayName("User Name")
102+
.name("User Name")
107103
.description("User Name used for authentication and authorization with Email server.")
108104
.required(true)
109105
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
110106
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
111107
.build();
112108
public static final PropertyDescriptor PASSWORD = new PropertyDescriptor.Builder()
113-
.name("password")
114-
.displayName("Password")
109+
.name("Password")
115110
.description("Password used for authentication and authorization with Email server.")
116111
.dependsOn(AUTHORIZATION_MODE, PASSWORD_BASED_AUTHORIZATION_MODE)
117112
.required(true)
@@ -120,35 +115,31 @@ abstract class AbstractEmailProcessor<T extends AbstractMailReceiver> extends Ab
120115
.sensitive(true)
121116
.build();
122117
public static final PropertyDescriptor FOLDER = new PropertyDescriptor.Builder()
123-
.name("folder")
124-
.displayName("Folder")
118+
.name("Folder")
125119
.description("Email folder to retrieve messages from (e.g., INBOX)")
126120
.required(true)
127121
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
128122
.defaultValue("INBOX")
129123
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
130124
.build();
131125
public static final PropertyDescriptor FETCH_SIZE = new PropertyDescriptor.Builder()
132-
.name("fetch.size")
133-
.displayName("Fetch Size")
126+
.name("Fetch Size")
134127
.description("Specify the maximum number of Messages to fetch per call to Email Server.")
135128
.required(true)
136129
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
137130
.defaultValue("10")
138131
.addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
139132
.build();
140133
public static final PropertyDescriptor SHOULD_DELETE_MESSAGES = new PropertyDescriptor.Builder()
141-
.name("delete.messages")
142-
.displayName("Delete Messages")
134+
.name("Delete Messages")
143135
.description("Specify whether mail messages should be deleted after retrieval.")
144136
.required(true)
145137
.allowableValues("true", "false")
146138
.defaultValue("false")
147139
.addValidator(StandardValidators.BOOLEAN_VALIDATOR)
148140
.build();
149141
static final PropertyDescriptor CONNECTION_TIMEOUT = new PropertyDescriptor.Builder()
150-
.name("connection.timeout")
151-
.displayName("Connection timeout")
142+
.name("Connection Timeout")
152143
.description("The amount of time to wait to connect to Email server")
153144
.required(true)
154145
.addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
@@ -238,6 +229,20 @@ public void onTrigger(ProcessContext context, ProcessSession processSession) thr
238229
}
239230
}
240231

232+
@Override
233+
public void migrateProperties(PropertyConfiguration config) {
234+
config.renameProperty("host", HOST.getName());
235+
config.renameProperty("port", PORT.getName());
236+
config.renameProperty("authorization-mode", AUTHORIZATION_MODE.getName());
237+
config.renameProperty("oauth2-access-token-provider", OAUTH2_ACCESS_TOKEN_PROVIDER.getName());
238+
config.renameProperty("user", USER.getName());
239+
config.renameProperty("password", PASSWORD.getName());
240+
config.renameProperty("folder", FOLDER.getName());
241+
config.renameProperty("fetch.size", FETCH_SIZE.getName());
242+
config.renameProperty("delete.messages", SHOULD_DELETE_MESSAGES.getName());
243+
config.renameProperty("connection.timeout", CONNECTION_TIMEOUT.getName());
244+
}
245+
241246
@Override
242247
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final String propertyDescriptorName) {
243248
return new PropertyDescriptor.Builder()

nifi-extension-bundles/nifi-email-bundle/nifi-email-processors/src/main/java/org/apache/nifi/processors/email/ExtractEmailHeaders.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.apache.nifi.expression.ExpressionLanguageScope;
5353
import org.apache.nifi.flowfile.FlowFile;
5454
import org.apache.nifi.logging.ComponentLog;
55+
import org.apache.nifi.migration.PropertyConfiguration;
5556
import org.apache.nifi.processor.AbstractProcessor;
5657
import org.apache.nifi.processor.ProcessContext;
5758
import org.apache.nifi.processor.ProcessSession;
@@ -87,8 +88,7 @@ public class ExtractEmailHeaders extends AbstractProcessor {
8788
public static final String EMAIL_ATTACHMENT_COUNT = "email.attachment_count";
8889

8990
public static final PropertyDescriptor CAPTURED_HEADERS = new PropertyDescriptor.Builder()
90-
.name("CAPTURED_HEADERS")
91-
.displayName("Additional Header List")
91+
.name("Additional Header List")
9292
.description("COLON separated list of additional headers to be extracted from the flowfile content." +
9393
"NOTE the header key is case insensitive and will be matched as lower-case." +
9494
" Values will respect email contents.")
@@ -103,8 +103,7 @@ public class ExtractEmailHeaders extends AbstractProcessor {
103103
private static final AllowableValue NONSTRICT_ADDRESSING = new AllowableValue("false", "Non-Strict Address Parsing",
104104
"Accept emails, even if the address is poorly formed and doesn't strictly comply with RFC Validation.");
105105
public static final PropertyDescriptor STRICT_PARSING = new PropertyDescriptor.Builder()
106-
.name("STRICT_ADDRESS_PARSING")
107-
.displayName("Email Address Parsing")
106+
.name("Email Address Parsing")
108107
.description("If \"strict\", strict address format parsing rules are applied to mailbox and mailbox list fields, " +
109108
"such as \"to\" and \"from\" headers, and FlowFiles with poorly formed addresses will be routed " +
110109
"to the failure relationship, similar to messages that fail RFC compliant format validation. " +
@@ -229,6 +228,12 @@ public final List<PropertyDescriptor> getSupportedPropertyDescriptors() {
229228
return PROPERTY_DESCRIPTORS;
230229
}
231230

231+
@Override
232+
public void migrateProperties(PropertyConfiguration config) {
233+
config.renameProperty("CAPTURED_HEADERS", CAPTURED_HEADERS.getName());
234+
config.renameProperty("STRICT_ADDRESS_PARSING", STRICT_PARSING.getName());
235+
}
236+
232237
private static void putAddressListInAttributes(
233238
Map<String, String> attributes,
234239
final String attributePrefix,

nifi-extension-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/AbstractEnrichIP.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.apache.nifi.components.resource.ResourceType;
2525
import org.apache.nifi.expression.AttributeExpression;
2626
import org.apache.nifi.expression.ExpressionLanguageScope;
27+
import org.apache.nifi.migration.PropertyConfiguration;
2728
import org.apache.nifi.processor.AbstractProcessor;
2829
import org.apache.nifi.processor.ProcessContext;
2930
import org.apache.nifi.processor.Relationship;
@@ -46,10 +47,7 @@
4647
public abstract class AbstractEnrichIP extends AbstractProcessor {
4748

4849
public static final PropertyDescriptor GEO_DATABASE_FILE = new PropertyDescriptor.Builder()
49-
// Name has been left untouched so that we don't cause a breaking change
50-
// but ideally this should be renamed to MaxMind Database File or something similar
51-
.name("Geo Database File")
52-
.displayName("MaxMind Database File")
50+
.name("MaxMind Database File")
5351
.description("Path to Maxmind IP Enrichment Database File")
5452
.required(true)
5553
.identifiesExternalResource(ResourceCardinality.SINGLE, ResourceType.FILE, ResourceType.DIRECTORY)
@@ -133,6 +131,11 @@ protected void loadDatabaseFile() throws IOException {
133131
databaseReaderRef.set(reader);
134132
}
135133

134+
@Override
135+
public void migrateProperties(PropertyConfiguration config) {
136+
config.renameProperty("Geo Database File", GEO_DATABASE_FILE.getName());
137+
}
138+
136139
@OnStopped
137140
public void closeReader() throws IOException {
138141
final DatabaseReader reader = databaseReaderRef.get();

0 commit comments

Comments
 (0)