Added Redis Support
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-tca / src / main / java / org / onap / dcae / apod / analytics / cdap / tca / validator / TCAPreferencesValidator.java
index 261b74d..0eb96c4 100644 (file)
@@ -79,6 +79,17 @@ public class TCAPreferencesValidator implements CDAPAppSettingsValidator<TCAAppP
             }
         }
 
+        final Boolean enableRedisCaching = appPreferences.getEnableRedisCaching();
+
+        // if redis distributed caching is enabled then redis Hosts must be provided
+        if(enableRedisCaching) {
+            final String redisHosts = appPreferences.getRedisHosts();
+            if(isEmpty(redisHosts)) {
+                validationResponse.addErrorMessage("redisHosts",
+                        "Redis Caching is enabled but no redis hosts are provided");
+            }
+        }
+
         return validationResponse;
     }
 }