DImuthuUpe commented on code in PR #99:
URL: https://github.com/apache/airavata-mft/pull/99#discussion_r1166284254
##########
core/src/main/java/org/apache/airavata/mft/core/api/ConnectorConfig.java:
##########
@@ -90,6 +90,40 @@ public void setTransportConfig(Map transportConfig) {
this.transportConfig = transportConfig;
}
+ public static final class LocalConfigs {
+ public LocalConfigs() {
+ }
+
+ public final static String DMA_ENABLED = "local.dma";
+ public final static String BUFF_LEN = "local.buffLen";
+ }
+
+ public Boolean getBooleanTransportProperty(String key, Boolean
defaultValue){
+ if(key == LocalConfigs.DMA_ENABLED){
Review Comment:
Why do you have a check like this?
##########
core/src/main/java/org/apache/airavata/mft/core/api/ConnectorConfig.java:
##########
@@ -90,6 +90,40 @@ public void setTransportConfig(Map transportConfig) {
this.transportConfig = transportConfig;
}
+ public static final class LocalConfigs {
+ public LocalConfigs() {
+ }
+
+ public final static String DMA_ENABLED = "local.dma";
+ public final static String BUFF_LEN = "local.buffLen";
+ }
+
+ public Boolean getBooleanTransportProperty(String key, Boolean
defaultValue){
+ if(key == LocalConfigs.DMA_ENABLED){
+ if (!this.transportConfig.get(key).toString().isEmpty()) return
Boolean.getBoolean(this.transportConfig.get(key).toString());
Review Comment:
This logic throws an error if the key is not in the map. I would suggest the
following logic
`return this.transportConfig.containesKey(key)?
Boolean.parseBoolean(this.transportConfig.get(key)): defaultValue`
##########
core/src/main/java/org/apache/airavata/mft/core/api/ConnectorConfig.java:
##########
@@ -90,6 +90,40 @@ public void setTransportConfig(Map transportConfig) {
this.transportConfig = transportConfig;
}
+ public static final class LocalConfigs {
+ public LocalConfigs() {
+ }
+
+ public final static String DMA_ENABLED = "local.dma";
+ public final static String BUFF_LEN = "local.buffLen";
+ }
+
+ public Boolean getBooleanTransportProperty(String key, Boolean
defaultValue){
+ if(key == LocalConfigs.DMA_ENABLED){
+ if (!this.transportConfig.get(key).toString().isEmpty()) return
Boolean.getBoolean(this.transportConfig.get(key).toString());
+ }
+ return defaultValue;
+ }
+
+ public int getIntTransportProperty(String key, int defaultValue){
+ if(key == LocalConfigs.BUFF_LEN){
+ if (!this.transportConfig.get(key).toString().isEmpty()) return
Integer.valueOf(this.transportConfig.get(key).toString());
+ }
+ return defaultValue;
+ }
+
+ public Long getLongTransportProperty(String key, Long defaultValue){
+ return defaultValue;
Review Comment:
Implement these methods
--
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]