Skip to content

Commit

Permalink
code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BalakrishnaV committed May 29, 2020
1 parent dcff753 commit d9e24e7
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 23 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private Map<String, String> getConnectionProperties(Map server) {

private String getPassword(Map server, String normal_password) {
String encryptionPassword = Util.convertToString(server.get("encryptedPassword"), "");
String encryptionKey = Util.convertToString(server.get("encryptionKey"), "");
String encryptionKey = Util.convertToString(getContextConfiguration().getConfigYml().get("encryptionKey"), "");
String password;
if (!Strings.isNullOrEmpty(encryptionKey) && !Strings.isNullOrEmpty(encryptionPassword)) {
password = getEncryptedPassword(encryptionKey, encryptionPassword);
Expand All @@ -148,6 +148,4 @@ private String getEncryptedPassword(String encryptionKey, String encryptedPasswo
cryptoMap.put(Constants.ENCRYPTION_KEY, encryptionKey);
return CryptoUtils.getPassword(cryptoMap);
}


}
24 changes: 21 additions & 3 deletions src/main/resources/conf/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ dbServers:
#Needs to be used in conjunction with `encryptionKey`. Please read the extension documentation to generate encrypted password
# encryptedPassword: "9XdTa7+McBwP2g2xSpyNsg=="

#Needs to be used in conjunction with `encryptedPassword`. Please read the extension documentation to generate encrypted password
# encryptionKey: "myKey"

# Replaces characters in metric name with the specified characters.
# "replace" takes any regular expression
# "replaceWith" takes the string to replace the matched characters
Expand Down Expand Up @@ -115,3 +112,24 @@ numberOfThreads: 5
# taskSchedule:
# numberOfThreads: 1
# taskDelaySeconds: 10

# Default information needs to be updated
controllerInfo:
controllerHost: "controller"
controllerPort: 8080
account: "customer1"
username: "user1"
password: "welcome"
encryptedPassword: ""
controllerSslEnabled: false
enableOrchestration: false
uniqueHostId: ""
accountAccessKey: ""
machinePath: ""
simEnabled: true
applicationName: ""
tierName: ""
nodeName: ""


encryptionKey: "myKey"
24 changes: 21 additions & 3 deletions src/test/resources/conf/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ dbServers:
#Needs to be used in conjunction with `encryptionKey`. Please read the extension documentation to generate encrypted password
encryptedPassword: "9XdTa7+McBwP2g2xSpyNsg=="

#Needs to be used in conjunction with `encryptedPassword`. Please read the extension documentation to generate encrypted password
encryptionKey: "myKey"

# Replaces characters in metric name with the specified characters.
# "replace" takes any regular expression
# "replaceWith" takes the string to replace the matched characters
Expand Down Expand Up @@ -72,3 +69,24 @@ numberOfThreads: 5
taskSchedule:
numberOfThreads: 1
taskDelaySeconds: 10


controllerInfo:
controllerHost: "controller"
controllerPort: 8080
account: "customer1"
username: "user1"
password: "welcome"
encryptedPassword: ""
controllerSslEnabled: false
enableOrchestration: false
uniqueHostId: ""
accountAccessKey: ""
machinePath: ""
simEnabled: true
applicationName: ""
tierName: ""
nodeName: ""


encryptionKey: "myKey"
26 changes: 22 additions & 4 deletions src/test/resources/conf/config1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ dbServers:
#Needs to be used in conjunction with `encryptionKey`. Please read the extension documentation to generate encrypted password
#encryptedPassword: ""

#Needs to be used in conjunction with `encryptedPassword`. Please read the extension documentation to generate encrypted password
#encryptionKey: "welcome"

# Replaces characters in metric name with the specified characters.
# "replace" takes any regular expression
# "replaceWith" takes the string to replace the matched characters
Expand All @@ -45,4 +42,25 @@ dbServers:
type: "metricValue"

- name: "EVENT_POSTED_COUNT"
type: "metricValue"
type: "metricValue"

# Default information needs to be updated
controllerInfo:
controllerHost: "controller"
controllerPort: 8080
account: "customer1"
username: "user1"
password: "welcome"
encryptedPassword: ""
controllerSslEnabled: false
enableOrchestration: false
uniqueHostId: ""
accountAccessKey: ""
machinePath: ""
simEnabled: true
applicationName: ""
tierName: ""
nodeName: ""


encryptionKey: "myKey"
23 changes: 22 additions & 1 deletion src/test/resources/conf/config_convert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,25 @@ columns:
"READY" : 3
"UNSAFE" : 4
"SHUTDOWN" : 5
"RECOVERING" : 6
"RECOVERING" : 6

# Default information needs to be updated
controllerInfo:
controllerHost: "controller"
controllerPort: 8080
account: "customer1"
username: "user1"
password: "welcome"
encryptedPassword: ""
controllerSslEnabled: false
enableOrchestration: false
uniqueHostId: ""
accountAccessKey: ""
machinePath: ""
simEnabled: true
applicationName: ""
tierName: ""
nodeName: ""


encryptionKey: "myKey"
24 changes: 23 additions & 1 deletion src/test/resources/conf/config_for_columns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,26 @@ columns:
type: "metricValue"

- name: "AVERAGE_CPU_USAGE_PERCENT"
type: "metricValue"
type: "metricValue"


# Default information needs to be updated
controllerInfo:
controllerHost: "controller"
controllerPort: 8080
account: "customer1"
username: "user1"
password: "welcome"
encryptedPassword: ""
controllerSslEnabled: false
enableOrchestration: false
uniqueHostId: ""
accountAccessKey: ""
machinePath: ""
simEnabled: true
applicationName: ""
tierName: ""
nodeName: ""


encryptionKey: "myKey"
23 changes: 20 additions & 3 deletions src/test/resources/conf/config_generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ dbServers:
#Needs to be used in conjunction with `encryptionKey`. Please read the extension documentation to generate encrypted password
#encryptedPassword: ""

#Needs to be used in conjunction with `encryptedPassword`. Please read the extension documentation to generate encrypted password
#encryptionKey: "welcome"

# Replaces characters in metric name with the specified characters.
# "replace" takes any regular expression
# "replaceWith" takes the string to replace the matched characters
Expand Down Expand Up @@ -317,3 +314,23 @@ dbServers:

numberOfThreads: 5

# Default information needs to be updated
controllerInfo:
controllerHost: "controller"
controllerPort: 8080
account: "customer1"
username: "user1"
password: "welcome"
encryptedPassword: ""
controllerSslEnabled: false
enableOrchestration: false
uniqueHostId: ""
accountAccessKey: ""
machinePath: ""
simEnabled: true
applicationName: ""
tierName: ""
nodeName: ""


encryptionKey: "myKey"
25 changes: 22 additions & 3 deletions src/test/resources/conf/config_query.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ dbServers:
#Needs to be used in conjunction with `encryptionKey`. Please read the extension documentation to generate encrypted password
#encryptedPassword: ""

#Needs to be used in conjunction with `encryptedPassword`. Please read the extension documentation to generate encrypted password
#encryptionKey: "welcome"

# Replaces characters in metric name with the specified characters.
# "replace" takes any regular expression
# "replaceWith" takes the string to replace the matched characters
Expand Down Expand Up @@ -313,3 +310,25 @@ dbServers:

- name: "TOTAL_ROW_COUNT"
type: "metricValue"


# Default information needs to be updated
controllerInfo:
controllerHost: "controller"
controllerPort: 8080
account: "customer1"
username: "user1"
password: "welcome"
encryptedPassword: ""
controllerSslEnabled: false
enableOrchestration: false
uniqueHostId: ""
accountAccessKey: ""
machinePath: ""
simEnabled: true
applicationName: ""
tierName: ""
nodeName: ""


encryptionKey: "myKey"

0 comments on commit d9e24e7

Please sign in to comment.