MultilangDaemon: creating validation for cloudwatch metrics factory validation
This commit is contained in:
parent
d576d5932d
commit
d9f22731ea
1 changed files with 30 additions and 0 deletions
|
|
@ -289,6 +289,16 @@ public class KinesisClientLibConfiguration {
|
|||
throw new IllegalArgumentException("The specified region name is not valid");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkIsCloudWatchMetricsFactoryNameValid(String cloudWatchMetricsFactoryName) {
|
||||
if ("CWMetricsFactory".equals(cloudWatchMetricsFactoryName) ||
|
||||
"NullMetricsFactory".equals(cloudWatchMetricsFactoryName) ||
|
||||
"LogMetricsFactory".equals(cloudWatchMetricsFactoryName) ){
|
||||
return;
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException("The specified Cloud Watch Metrics Factory Name is not valid");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Name of the application
|
||||
|
|
@ -459,6 +469,13 @@ public class KinesisClientLibConfiguration {
|
|||
return regionName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Custom CloudWatch Metrics Factory Name.
|
||||
*/
|
||||
public String getCustomCloudWatchMetricsFactoryName() {
|
||||
return customCloudWatchMetricsFactoryName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Custom CloudWatch Metrics Factory. In case of the default MetricsFactory CWMetricsFactory, null is returned.
|
||||
*/
|
||||
|
|
@ -677,4 +694,17 @@ public class KinesisClientLibConfiguration {
|
|||
this.regionName = regionName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param customCloudWatchMetricsFactoryName The region name for the service
|
||||
* @return KinesisClientLibConfiguration
|
||||
*/
|
||||
// CHECKSTYLE:IGNORE HiddenFieldCheck FOR NEXT 2 LINES
|
||||
public KinesisClientLibConfiguration withCustomCloudWatchMetricsFactoryName(String customCloudWatchMetricsFactoryName) {
|
||||
checkIsCloudWatchMetricsFactoryNameValid(customCloudWatchMetricsFactoryName);
|
||||
this.customCloudWatchMetricsFactoryName = customCloudWatchMetricsFactoryName;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue