summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-07 15:11:46 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-07 15:11:55 +0100
commit07922e8590597e7a74a2059a1b344c92f04771c5 (patch)
treed7f0c7afc4c2a7830b959727049e1118472e8abb /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src
parenta41c877a6b1980e0e866699633e0289d9a3fdbb5 (diff)
Parameter group fields must have getters
Modifications to apex parameters to include getters that follow naming conventions, and knock on changes. Also checkstyle fixes taken in modifified classes. Issue-ID: POLICY-1095 Change-Id: Iff5ccc7a069a4ec2b2b974ed9f5ed70a88692e00 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java2
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java18
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java8
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java4
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java4
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRestRequestorEndpoint.java (renamed from plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTREequestorEndpoint.java)2
6 files changed, 19 insertions, 19 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java
index 46e68acda..12b9a695c 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequest.java
@@ -21,7 +21,7 @@
package org.onap.policy.apex.plugins.event.carrier.restrequestor;
/**
- * This class holds a record of a REST request for the REST requestor plugin
+ * This class holds a record of a REST request for the REST requestor plugin.
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
index a2069a794..9998349db 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
@@ -129,7 +129,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
}
// Check if the HTTP URL has been set
- if (restConsumerProperties.getURL() == null) {
+ if (restConsumerProperties.getUrl() == null) {
final String errorMessage = "no URL has been specified on REST Requestor consumer (" + this.name + ")";
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
@@ -137,7 +137,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
// Check if the HTTP URL is valid
try {
- new URL(restConsumerProperties.getURL());
+ new URL(restConsumerProperties.getUrl());
} catch (final Exception e) {
final String errorMessage = "invalid URL has been specified on REST Requestor consumer (" + this.name + ")";
LOGGER.warn(errorMessage);
@@ -154,7 +154,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
}
/**
- * Receive an incoming REST request from the peered REST Requestor producer and queue it
+ * Receive an incoming REST request from the peered REST Requestor producer and queue it.
*
* @param restRequest the incoming rest request to queue
* @throws ApexEventRuntimeException on queueing errors
@@ -346,7 +346,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
// Check that the event request worked
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
final String errorMessage = "reception of response to \"" + request + "\" from URL \""
- + restConsumerProperties.getURL() + "\" failed with status code " + response.getStatus()
+ + restConsumerProperties.getUrl() + "\" failed with status code " + response.getStatus()
+ " and message \"" + response.readEntity(String.class) + "\"";
throw new ApexEventRuntimeException(errorMessage);
}
@@ -357,7 +357,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
// Check there is content
if (eventJSONString == null || eventJSONString.trim().length() == 0) {
final String errorMessage = "received an enpty response to \"" + request + "\" from URL \""
- + restConsumerProperties.getURL() + "\"";
+ + restConsumerProperties.getUrl() + "\"";
throw new ApexEventRuntimeException(errorMessage);
}
@@ -390,18 +390,18 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable {
public Response sendEventAsRESTRequest() {
switch (restConsumerProperties.getHttpMethod()) {
case GET:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON).get();
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON).get();
case PUT:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON)
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON)
.put(Entity.json(request.getEvent()));
case POST:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON)
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON)
.post(Entity.json(request.getEvent()));
case DELETE:
- return client.target(restConsumerProperties.getURL()).request(APPLICATION_JSON).delete();
+ return client.target(restConsumerProperties.getUrl()).request(APPLICATION_JSON).delete();
}
return null;
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
index 12f194510..721dfb683 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
@@ -86,7 +86,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
}
// Check if the HTTP URL has been set
- if (restProducerProperties.getURL() != null) {
+ if (restProducerProperties.getUrl() != null) {
final String errorMessage = "URL may not be specified on REST Requestor producer (" + this.name + ")";
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
@@ -112,7 +112,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
}
/**
- * Get the number of events sent to date
+ * Get the number of events sent to date.
*
* @return the number of events received
*/
@@ -163,7 +163,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
// Find the REST Response Consumer that will handle this request
final ApexEventConsumer consumer = peeredRequestorReference.getPeeredConsumer();
if (!(consumer instanceof ApexRestRequestorConsumer)) {
- final String errorMessage = "send of event to URL \"" + restProducerProperties.getURL() + "\" failed,"
+ final String errorMessage = "send of event to URL \"" + restProducerProperties.getUrl() + "\" failed,"
+ " REST response consumer is not an instance of ApexRestRequestorConsumer\n" + event;
LOGGER.warn(errorMessage);
throw new ApexEventRuntimeException(errorMessage);
@@ -176,7 +176,7 @@ public class ApexRestRequestorProducer implements ApexEventProducer {
eventsSent++;
} else {
// No peered consumer defined
- final String errorMessage = "send of event to URL \"" + restProducerProperties.getURL() + "\" failed,"
+ final String errorMessage = "send of event to URL \"" + restProducerProperties.getUrl() + "\" failed,"
+ " REST response consumer is not defined\n" + event;
LOGGER.warn(errorMessage);
throw new ApexEventRuntimeException(errorMessage);
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java
index 9b841d768..65eb731ed 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RESTRequestorCarrierTechnologyParameters.java
@@ -26,7 +26,7 @@ import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnolo
* Apex parameters for REST as an event carrier technology with Apex issuing a REST request and receiving a REST
* response.
*
- * The parameters for this plugin are:
+ * <p>The parameters for this plugin are:
* <ol>
* <li>url: The URL that the Apex Rest Requestor will connect to over REST for REST request sending. This parameter is
* mandatory.
@@ -81,7 +81,7 @@ public class RESTRequestorCarrierTechnologyParameters extends CarrierTechnologyP
*
* @return the URL
*/
- public String getURL() {
+ public String getUrl() {
return url;
}
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java
index 70d567b0d..3db0f1467 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTRequestor.java
@@ -60,7 +60,7 @@ public class TestRESTRequestor {
@BeforeClass
public static void setUp() throws Exception {
- final ResourceConfig rc = new ResourceConfig(TestRESTREequestorEndpoint.class);
+ final ResourceConfig rc = new ResourceConfig(TestRestRequestorEndpoint.class);
server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
while (!server.isStarted()) {
@@ -79,7 +79,7 @@ public class TestRESTRequestor {
@Before
public void resetCounters() {
- TestRESTREequestorEndpoint.resetCounters();
+ TestRestRequestorEndpoint.resetCounters();
}
@Test
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTREequestorEndpoint.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRestRequestorEndpoint.java
index d9569b1ed..4977b3efb 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRESTREequestorEndpoint.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/apps/uservice/test/adapt/restrequestor/TestRestRequestorEndpoint.java
@@ -35,7 +35,7 @@ import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
@Path("/apex")
-public class TestRESTREequestorEndpoint {
+public class TestRestRequestorEndpoint {
private static Object counterLock = new Object();
private static int postMessagesReceived = 0;