summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java
index e8009a5d8..e04a81d1d 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java
@@ -21,6 +21,8 @@
package org.onap.policy.apex.plugins.event.carrier.websocket;
import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters;
+import org.onap.policy.common.parameters.GroupValidationResult;
+import org.onap.policy.common.parameters.ValidationStatus;
/**
* Apex parameters for Kafka as an event carrier technology.
@@ -56,7 +58,7 @@ public class WEBSOCKETCarrierTechnologyParameters extends CarrierTechnologyParam
* parameter service.
*/
public WEBSOCKETCarrierTechnologyParameters() {
- super(WEBSOCKETCarrierTechnologyParameters.class.getCanonicalName());
+ super();
// Set the carrier technology properties for the web socket carrier technology
this.setLabel(WEB_SCOKET_CARRIER_TECHNOLOGY_LABEL);
@@ -97,19 +99,18 @@ public class WEBSOCKETCarrierTechnologyParameters extends CarrierTechnologyParam
* @see org.onap.policy.apex.apps.uservice.parameters.ApexParameterValidator#validate()
*/
@Override
- public String validate() {
- final StringBuilder errorMessageBuilder = new StringBuilder();
-
- errorMessageBuilder.append(super.validate());
+ public GroupValidationResult validate() {
+ final GroupValidationResult result = super.validate();
if (wsClient && (host == null || host.trim().length() == 0)) {
- errorMessageBuilder.append(" host not specified, must be host as a string\n");
+ result.setResult("host", ValidationStatus.INVALID, "host not specified, must be host as a string");
}
if (port < MIN_USER_PORT || port > MAX_USER_PORT) {
- errorMessageBuilder.append(" port [" + port + "] invalid, must be specified as 1024 <= port <= 6535\n");
+ result.setResult("port", ValidationStatus.INVALID,
+ "[" + port + "] invalid, must be specified as 1024 <= port <= 65535");
}
- return errorMessageBuilder.toString();
+ return result;
}
}