-
Notifications
You must be signed in to change notification settings - Fork 165
/
DataLakeComponentConfiguration.java
540 lines (461 loc) · 15.4 KB
/
DataLakeComponentConfiguration.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
/*
* 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.camel.component.azure.storage.datalake.springboot;
import java.nio.file.OpenOption;
import java.time.Duration;
import java.util.Set;
import com.azure.core.credential.AzureSasCredential;
import com.azure.identity.ClientSecretCredential;
import com.azure.storage.common.StorageSharedKeyCredential;
import com.azure.storage.file.datalake.DataLakeServiceClient;
import org.apache.camel.component.azure.storage.datalake.CredentialType;
import org.apache.camel.component.azure.storage.datalake.DataLakeComponent;
import org.apache.camel.component.azure.storage.datalake.DataLakeConfiguration;
import org.apache.camel.component.azure.storage.datalake.DataLakeOperationsDefinition;
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Sends and receives files to/from Azure Data Lake Storage.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@ConfigurationProperties(prefix = "camel.component.azure-storage-datalake")
public class DataLakeComponentConfiguration
extends
ComponentConfigurationPropertiesCommon {
/**
* Whether to enable auto configuration of the azure-storage-datalake
* component. This is enabled by default.
*/
private Boolean enabled;
/**
* client id for azure account
*/
private String clientId;
/**
* Whether or not a file changed event raised indicates completion (true) or
* modification (false)
*/
private Boolean close;
/**
* check for closing stream after read
*/
private Boolean closeStreamAfterRead;
/**
* configuration object for data lake. The option is a
* org.apache.camel.component.azure.storage.datalake.DataLakeConfiguration
* type.
*/
private DataLakeConfiguration configuration;
/**
* Determines the credential strategy to adopt
*/
private CredentialType credentialType = CredentialType.CLIENT_SECRET;
/**
* count number of bytes to download
*/
private Long dataCount;
/**
* directory of the file to be handled in component
*/
private String directoryName;
/**
* download link expiration time
*/
private Long downloadLinkExpiration;
/**
* expression for queryInputStream
*/
private String expression;
/**
* directory of file to do operations in the local system
*/
private String fileDir;
/**
* name of file to be handled in component
*/
private String fileName;
/**
* offset position in file for different operations
*/
private Long fileOffset;
/**
* maximum number of results to show at a time
*/
private Integer maxResults;
/**
* no of retries to a given request
*/
private Integer maxRetryRequests;
/**
* set open options for creating file
*/
private Set<OpenOption> openOptions;
/**
* path in azure data lake for operations
*/
private String path;
/**
* permission string for the file
*/
private String permission;
/**
* This parameter allows the caller to upload data in parallel and control
* the order in which it is appended to the file.
*/
private Long position;
/**
* recursively include all paths
*/
private Boolean recursive;
/**
* regular expression for matching file names
*/
private String regex;
/**
* Whether or not uncommitted data is to be retained after the operation
*/
private Boolean retainUncommitedData;
/**
* data lake service client for azure storage data lake. The option is a
* com.azure.storage.file.datalake.DataLakeServiceClient type.
*/
private DataLakeServiceClient serviceClient;
/**
* shared key credential for azure data lake gen2. The option is a
* com.azure.storage.common.StorageSharedKeyCredential type.
*/
private StorageSharedKeyCredential sharedKeyCredential;
/**
* tenant id for azure account
*/
private String tenantId;
/**
* Timeout for operation
*/
private Duration timeout;
/**
* umask permission for file
*/
private String umask;
/**
* whether or not to use upn
*/
private Boolean userPrincipalNameReturned;
/**
* Allows for bridging the consumer to the Camel routing Error Handler,
* which mean any exceptions (if possible) occurred while the Camel consumer
* is trying to pickup incoming messages, or the likes, will now be
* processed as a message and handled by the routing Error Handler.
* Important: This is only possible if the 3rd party component allows Camel
* to be alerted if an exception was thrown. Some components handle this
* internally only, and therefore bridgeErrorHandler is not possible. In
* other situations we may improve the Camel component to hook into the 3rd
* party component and make this possible for future releases. By default
* the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
* with exceptions, that will be logged at WARN or ERROR level and ignored.
*/
private Boolean bridgeErrorHandler = false;
/**
* Whether the producer should be started lazy (on the first message). By
* starting lazy you can use this to allow CamelContext and routes to
* startup in situations where a producer may otherwise fail during starting
* and cause the route to fail being started. By deferring this startup to
* be lazy then the startup failure can be handled during routing messages
* via Camel's routing error handlers. Beware that when the first message is
* processed then creating and starting the producer may take a little time
* and prolong the total processing time of the processing.
*/
private Boolean lazyStartProducer = false;
/**
* operation to be performed
*/
private DataLakeOperationsDefinition operation = DataLakeOperationsDefinition.listFileSystem;
/**
* Whether autowiring is enabled. This is used for automatic autowiring
* options (the option must be marked as autowired) by looking up in the
* registry to find if there is a single instance of matching type, which
* then gets configured on the component. This can be used for automatic
* configuring JDBC data sources, JMS connection factories, AWS Clients,
* etc.
*/
private Boolean autowiredEnabled = true;
/**
* Used for enabling or disabling all consumer based health checks from this
* component
*/
private Boolean healthCheckConsumerEnabled = true;
/**
* Used for enabling or disabling all producer based health checks from this
* component. Notice: Camel has by default disabled all producer based
* health-checks. You can turn on producer checks globally by setting
* camel.health.producersEnabled=true.
*/
private Boolean healthCheckProducerEnabled = true;
/**
* account key for authentication
*/
private String accountKey;
/**
* client secret for azure account
*/
private String clientSecret;
/**
* client secret credential for authentication. The option is a
* com.azure.identity.ClientSecretCredential type.
*/
private ClientSecretCredential clientSecretCredential;
/**
* SAS token credential. The option is a
* com.azure.core.credential.AzureSasCredential type.
*/
private AzureSasCredential sasCredential;
/**
* SAS token signature
*/
private String sasSignature;
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public Boolean getClose() {
return close;
}
public void setClose(Boolean close) {
this.close = close;
}
public Boolean getCloseStreamAfterRead() {
return closeStreamAfterRead;
}
public void setCloseStreamAfterRead(Boolean closeStreamAfterRead) {
this.closeStreamAfterRead = closeStreamAfterRead;
}
public DataLakeConfiguration getConfiguration() {
return configuration;
}
public void setConfiguration(DataLakeConfiguration configuration) {
this.configuration = configuration;
}
public CredentialType getCredentialType() {
return credentialType;
}
public void setCredentialType(CredentialType credentialType) {
this.credentialType = credentialType;
}
public Long getDataCount() {
return dataCount;
}
public void setDataCount(Long dataCount) {
this.dataCount = dataCount;
}
public String getDirectoryName() {
return directoryName;
}
public void setDirectoryName(String directoryName) {
this.directoryName = directoryName;
}
public Long getDownloadLinkExpiration() {
return downloadLinkExpiration;
}
public void setDownloadLinkExpiration(Long downloadLinkExpiration) {
this.downloadLinkExpiration = downloadLinkExpiration;
}
public String getExpression() {
return expression;
}
public void setExpression(String expression) {
this.expression = expression;
}
public String getFileDir() {
return fileDir;
}
public void setFileDir(String fileDir) {
this.fileDir = fileDir;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public Long getFileOffset() {
return fileOffset;
}
public void setFileOffset(Long fileOffset) {
this.fileOffset = fileOffset;
}
public Integer getMaxResults() {
return maxResults;
}
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
public Integer getMaxRetryRequests() {
return maxRetryRequests;
}
public void setMaxRetryRequests(Integer maxRetryRequests) {
this.maxRetryRequests = maxRetryRequests;
}
public Set<OpenOption> getOpenOptions() {
return openOptions;
}
public void setOpenOptions(Set<OpenOption> openOptions) {
this.openOptions = openOptions;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public String getPermission() {
return permission;
}
public void setPermission(String permission) {
this.permission = permission;
}
public Long getPosition() {
return position;
}
public void setPosition(Long position) {
this.position = position;
}
public Boolean getRecursive() {
return recursive;
}
public void setRecursive(Boolean recursive) {
this.recursive = recursive;
}
public String getRegex() {
return regex;
}
public void setRegex(String regex) {
this.regex = regex;
}
public Boolean getRetainUncommitedData() {
return retainUncommitedData;
}
public void setRetainUncommitedData(Boolean retainUncommitedData) {
this.retainUncommitedData = retainUncommitedData;
}
public DataLakeServiceClient getServiceClient() {
return serviceClient;
}
public void setServiceClient(DataLakeServiceClient serviceClient) {
this.serviceClient = serviceClient;
}
public StorageSharedKeyCredential getSharedKeyCredential() {
return sharedKeyCredential;
}
public void setSharedKeyCredential(
StorageSharedKeyCredential sharedKeyCredential) {
this.sharedKeyCredential = sharedKeyCredential;
}
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public Duration getTimeout() {
return timeout;
}
public void setTimeout(Duration timeout) {
this.timeout = timeout;
}
public String getUmask() {
return umask;
}
public void setUmask(String umask) {
this.umask = umask;
}
public Boolean getUserPrincipalNameReturned() {
return userPrincipalNameReturned;
}
public void setUserPrincipalNameReturned(Boolean userPrincipalNameReturned) {
this.userPrincipalNameReturned = userPrincipalNameReturned;
}
public Boolean getBridgeErrorHandler() {
return bridgeErrorHandler;
}
public void setBridgeErrorHandler(Boolean bridgeErrorHandler) {
this.bridgeErrorHandler = bridgeErrorHandler;
}
public Boolean getLazyStartProducer() {
return lazyStartProducer;
}
public void setLazyStartProducer(Boolean lazyStartProducer) {
this.lazyStartProducer = lazyStartProducer;
}
public DataLakeOperationsDefinition getOperation() {
return operation;
}
public void setOperation(DataLakeOperationsDefinition operation) {
this.operation = operation;
}
public Boolean getAutowiredEnabled() {
return autowiredEnabled;
}
public void setAutowiredEnabled(Boolean autowiredEnabled) {
this.autowiredEnabled = autowiredEnabled;
}
public Boolean getHealthCheckConsumerEnabled() {
return healthCheckConsumerEnabled;
}
public void setHealthCheckConsumerEnabled(Boolean healthCheckConsumerEnabled) {
this.healthCheckConsumerEnabled = healthCheckConsumerEnabled;
}
public Boolean getHealthCheckProducerEnabled() {
return healthCheckProducerEnabled;
}
public void setHealthCheckProducerEnabled(Boolean healthCheckProducerEnabled) {
this.healthCheckProducerEnabled = healthCheckProducerEnabled;
}
public String getAccountKey() {
return accountKey;
}
public void setAccountKey(String accountKey) {
this.accountKey = accountKey;
}
public String getClientSecret() {
return clientSecret;
}
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public ClientSecretCredential getClientSecretCredential() {
return clientSecretCredential;
}
public void setClientSecretCredential(
ClientSecretCredential clientSecretCredential) {
this.clientSecretCredential = clientSecretCredential;
}
public AzureSasCredential getSasCredential() {
return sasCredential;
}
public void setSasCredential(AzureSasCredential sasCredential) {
this.sasCredential = sasCredential;
}
public String getSasSignature() {
return sasSignature;
}
public void setSasSignature(String sasSignature) {
this.sasSignature = sasSignature;
}
}