pzampino commented on a change in pull request #431:
URL: https://github.com/apache/knox/pull/431#discussion_r608902838
##########
File path:
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/hive/HiveServiceModelGenerator.java
##########
@@ -115,11 +116,16 @@ protected String getHttpPath(ApiConfigList roleConfig) {
protected void checkHiveServer2HTTPMode(ApiConfigList roleConfig,
ServiceModelGeneratorHandleResponse response) {
final String hiveServer2SafetyValve = getRoleConfigValue(roleConfig,
SAFETY_VALVE);
final String hiveServer2TransportMode = hiveServer2SafetyValve == null ?
null : getSafetyValveValue(hiveServer2SafetyValve, TRANSPORT_MODE);
- if (hiveServer2TransportMode == null ) {
- response.addConfigurationIssue("Missing configuration: " +
TRANSPORT_MODE);
- } else if (!TRANSPORT_MODE_HTTP.equals(hiveServer2TransportMode)) {
- response.addConfigurationIssue("Invalid configuration: " +
TRANSPORT_MODE + ". Expected=" + TRANSPORT_MODE_HTTP + "; Found=" +
hiveServer2TransportMode);
- }
+ validateTransportMode(TRANSPORT_MODE, hiveServer2TransportMode, response);
}
+ protected void validateTransportMode(final String configPropName,
+ final String transportMode,
+ final
ServiceModelGeneratorHandleResponse response) {
+ if (transportMode == null ) {
+ response.addConfigurationIssue("Missing configuration: " +
configPropName);
+ } else if (!TRANSPORT_MODE_HTTP.equalsIgnoreCase(transportMode) &&
!TRANSPORT_MODE_ALL.equalsIgnoreCase(transportMode)) {
+ response.addConfigurationIssue("Invalid configuration: " +
configPropName + ". Expected=" + TRANSPORT_MODE_HTTP + "; Found=" +
transportMode);
Review comment:
Ughh! Yes, it should. That change got lost in my refactoring. Thanks for
noticing.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]