aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2018-12-19 17:48:47 +0000
committerliamfallon <liam.fallon@est.tech>2018-12-19 17:48:53 +0000
commit1dff5ebe27cbe79de8f9d798e256d41ecccdaa8c (patch)
tree7813a9eba36e95ecfd9e9784348f2432243d32ad /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java
parentb70b381538d2c6fca65530538b36c8f8fdebd104 (diff)
Add example policy for HTTPS
Added an example of how to configure HTTPS for an Apex policy. Issue-ID: POLICY-1222 Change-Id: Iea8a8accac32f6d25c64a8324e202ad5e6221c7a Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java2
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java6
2 files changed, 5 insertions, 3 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/ApexRestClientConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
index 04397d688..5591777eb 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java
@@ -202,7 +202,7 @@ public class ApexRestClientConsumer implements ApexEventConsumer, Runnable {
public void run() {
try {
final Response response = client.target(restConsumerProperties.getUrl()).request("application/json")
- .get();
+ .headers(restConsumerProperties.getHttpHeadersAsMultivaluedMap()).get();
// Check that the event request worked
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
index a7e0ddd52..4113cea4b 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java
@@ -183,9 +183,11 @@ public class ApexRestClientProducer implements ApexEventProducer {
private Response sendEventAsRestRequest(final String event) {
// We have already checked that it is a PUT or POST request
if (RestClientCarrierTechnologyParameters.HttpMethod.POST.equals(restProducerProperties.getHttpMethod())) {
- return client.target(restProducerProperties.getUrl()).request("application/json").post(Entity.json(event));
+ return client.target(restProducerProperties.getUrl()).request("application/json")
+ .headers(restProducerProperties.getHttpHeadersAsMultivaluedMap()).post(Entity.json(event));
} else {
- return client.target(restProducerProperties.getUrl()).request("application/json").put(Entity.json(event));
+ return client.target(restProducerProperties.getUrl()).request("application/json")
+ .headers(restProducerProperties.getHttpHeadersAsMultivaluedMap()).put(Entity.json(event));
}
}