diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-08-30 09:37:29 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-08-31 19:23:41 +0100 |
commit | f32508381ce0b555fc14978cbaa458aa4e2d91c5 (patch) | |
tree | 1cab66e5372b6467f288ae1351ce836e4eba2d03 /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient | |
parent | 052038c7a7e0b385462b3b653b7d06094d472df3 (diff) |
Use parameter service in apex
Switch parameter handling in apex to use
the ONAP PF common parameter service
Change-Id: Id318d19c726b18b1a69c630fa81ca7d695355e9c
Issue-ID: POLICY-954
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient')
-rw-r--r-- | plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java index e07593c55..59d19f76b 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/RESTClientCarrierTechnologyParameters.java @@ -21,6 +21,8 @@ package org.onap.policy.apex.plugins.event.carrier.restclient; 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 REST as an event carrier technology with Apex as a REST client. @@ -60,7 +62,7 @@ public class RESTClientCarrierTechnologyParameters extends CarrierTechnologyPara * service. */ public RESTClientCarrierTechnologyParameters() { - super(RESTClientCarrierTechnologyParameters.class.getCanonicalName()); + super(); // Set the carrier technology properties for the web socket carrier technology this.setLabel(RESTCLIENT_CARRIER_TECHNOLOGY_LABEL); @@ -115,20 +117,19 @@ public class RESTClientCarrierTechnologyParameters extends CarrierTechnologyPara return "RESTClientCarrierTechnologyParameters [url=" + url + ", httpMethod=" + httpMethod + "]"; } - /* * * @see org.onap.policy.apex.apps.uservice.parameters.ApexParameterValidator#validate() */ @Override - public String validate() { - final StringBuilder errorMessageBuilder = new StringBuilder(); + public GroupValidationResult validate() { + final GroupValidationResult result = super.validate(); // Check if the URL has been set for event output if (getURL() == null) { - errorMessageBuilder.append(" no URL has been set for event sending on REST client"); + result.setResult("url", ValidationStatus.INVALID, "no URL has been set for event sending on REST client"); } - return errorMessageBuilder.toString(); + return result; } } |