aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'prh-app-server/src/main')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java31
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java4
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java15
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/ScheduleController.java12
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java43
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java4
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskImpl.java10
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImpl.java35
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImpl.java6
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java20
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java11
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/Task.java1
12 files changed, 65 insertions, 127 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java
index fba8985f..19c8d492 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java
@@ -106,6 +106,12 @@ public class AppConfig extends PrhAppConfig {
@Value("${aai.aaiHttpClientConfiguration.aaiIgnoreSSLCertificateErrors:}")
public Boolean aaiIgnoreSSLCertificateErrors;
+ @Value("${aai.aaiHttpClientConfiguration.aaiBasePath:}")
+ public String aaiBasePath;
+
+ @Value("${aai.aaiHttpClientConfiguration.aaiPnfPath:}")
+ public String aaiPnfPath;
+
@Override
public DmaapConsumerConfiguration getDmaapConsumerConfiguration() {
return new ImmutableDmaapConsumerConfiguration.Builder()
@@ -134,18 +140,19 @@ public class AppConfig extends PrhAppConfig {
@Override
public AAIClientConfiguration getAAIClientConfiguration() {
return new ImmutableAAIClientConfiguration.Builder()
- .aaiHost(Optional.ofNullable(aaiHost).orElse(aaiClientConfiguration.aaiHost()))
- .aaiHostPortNumber(
- Optional.ofNullable(aaiHostPortNumber).orElse(aaiClientConfiguration.aaiHostPortNumber()))
- .aaiIgnoreSSLCertificateErrors(
- Optional.ofNullable(aaiIgnoreSSLCertificateErrors)
- .orElse(aaiClientConfiguration.aaiIgnoreSSLCertificateErrors()))
- .aaiProtocol(Optional.ofNullable(aaiProtocol).orElse(aaiClientConfiguration.aaiProtocol()))
- .aaiUserName(
- Optional.ofNullable(aaiUserName).orElse(aaiClientConfiguration.aaiUserName()))
- .aaiUserPassword(Optional.ofNullable(
- aaiUserPassword).orElse(aaiClientConfiguration.aaiUserPassword()))
- .build();
+ .aaiHost(Optional.ofNullable(aaiHost).orElse(aaiClientConfiguration.aaiHost()))
+ .aaiHostPortNumber(
+ Optional.ofNullable(aaiHostPortNumber).orElse(aaiClientConfiguration.aaiHostPortNumber()))
+ .aaiIgnoreSSLCertificateErrors(
+ Optional.ofNullable(aaiIgnoreSSLCertificateErrors)
+ .orElse(aaiClientConfiguration.aaiIgnoreSSLCertificateErrors()))
+ .aaiProtocol(Optional.ofNullable(aaiProtocol).orElse(aaiClientConfiguration.aaiProtocol()))
+ .aaiUserName(Optional.ofNullable(aaiUserName).orElse(aaiClientConfiguration.aaiUserName()))
+ .aaiUserPassword(Optional.ofNullable(aaiUserPassword).orElse(aaiClientConfiguration.aaiUserPassword()))
+ .aaiBasePath(Optional.ofNullable(aaiBasePath).orElse(aaiClientConfiguration.aaiBasePath()))
+ .aaiPnfPath(Optional.ofNullable(aaiPnfPath).orElse(aaiClientConfiguration.aaiPnfPath()))
+ .aaiHeaders(aaiClientConfiguration.aaiHeaders())
+ .build();
}
@Override
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java
index 3df25d00..c4cb20de 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfig.java
@@ -32,8 +32,6 @@ import org.springframework.context.annotation.Configuration;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.*;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
import java.util.ServiceLoader;
/**
@@ -47,7 +45,7 @@ public abstract class PrhAppConfig implements Config {
private static final String CONFIG = "configs";
private static final String AAI = "aai";
private static final String DMAAP = "dmaap";
- private static final String AAI_CONFIG = "aaiHttpClientConfiguration";
+ private static final String AAI_CONFIG = "aaiClientConfiguration";
private static final String DMAAP_PRODUCER = "dmaapProducerConfiguration";
private static final String DMAAP_CONSUMER = "dmaapConsumerConfiguration";
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java
index 269e7a2a..8db4f0b6 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/HeartbeatController.java
@@ -23,7 +23,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
-import org.onap.dcaegen2.services.prh.configuration.PrhAppConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
@@ -40,21 +39,21 @@ import reactor.core.publisher.Mono;
@Api(value = "HeartbeatController", description = "Check liveness of PRH service")
public class HeartbeatController {
- private static final Logger logger = LoggerFactory.getLogger(PrhAppConfig.class);
+ private static final Logger logger = LoggerFactory.getLogger(HeartbeatController.class);
@RequestMapping(value = "heartbeat", method = RequestMethod.GET)
@ApiOperation(value = "Returns liveness of PRH service")
@ApiResponses(value = {
- @ApiResponse(code = 200, message = "PRH sevice is living"),
- @ApiResponse(code = 401, message = "You are not authorized to view the resource"),
- @ApiResponse(code = 403, message = "Accessing the resource you were trying to reach is forbidden"),
- @ApiResponse(code = 404, message = "The resource you were trying to reach is not found")
+ @ApiResponse(code = 200, message = "PRH sevice is living"),
+ @ApiResponse(code = 401, message = "You are not authorized to view the resource"),
+ @ApiResponse(code = 403, message = "Accessing the resource you were trying to reach is forbidden"),
+ @ApiResponse(code = 404, message = "The resource you were trying to reach is not found")
}
)
public Mono<ResponseEntity<String>> heartbeat() {
logger.trace("Receiving heartbeat request");
return Mono.defer(() ->
- Mono.just(new ResponseEntity<>("I'm living", HttpStatus.OK))
+ Mono.just(new ResponseEntity<>("I'm living", HttpStatus.OK))
);
}
-}
+} \ No newline at end of file
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/ScheduleController.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/ScheduleController.java
index cd3347fe..96b69b7b 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/ScheduleController.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/controllers/ScheduleController.java
@@ -21,10 +21,6 @@ package org.onap.dcaegen2.services.prh.controllers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ScheduledFuture;
-import org.onap.dcaegen2.services.prh.configuration.PrhAppConfig;
import org.onap.dcaegen2.services.prh.tasks.ScheduledTasks;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -32,21 +28,23 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.TaskScheduler;
-import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ScheduledFuture;
+
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 4/5/18
*/
@RestController
-@Component
@Api(value = "ScheduleController", description = "Schedule Controller")
public class ScheduleController {
- private static final Logger logger = LoggerFactory.getLogger(PrhAppConfig.class);
+ private static final Logger logger = LoggerFactory.getLogger(ScheduleController.class);
private static final int SCHEDULING_DELAY = 20000;
private static volatile List<ScheduledFuture> scheduledFutureList = new ArrayList<>();
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java
deleted file mode 100644
index c6879948..00000000
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * PNF-REGISTRATION-HANDLER
- * ================================================================================
- * Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.onap.dcaegen2.services.prh.model;
-
-import com.google.gson.annotations.SerializedName;
-import org.immutables.gson.Gson;
-import org.immutables.value.Value;
-
-/**
- * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 5/8/18
- */
-
-@Value.Immutable
-@Gson.TypeAdapters
-public interface ConsumerDmaapModel {
-
- @SerializedName("pnf-name")
- String getPnfName();
-
- @SerializedName("ipaddress-v4-oam")
- String getIpv4();
-
- @SerializedName("ipaddress-v6-oam")
- String getIpv6();
-
-}
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java
index 0ef7e4fe..ae5d922e 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java
@@ -23,8 +23,8 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException;
-import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
-import org.onap.dcaegen2.services.prh.model.ImmutableConsumerDmaapModel;
+import org.onap.dcaegen2.services.model.ConsumerDmaapModel;
+import org.onap.dcaegen2.services.model.ImmutableConsumerDmaapModel;
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 5/8/18
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskImpl.java
index 95352d44..136f5b7f 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIConsumerTaskImpl.java
@@ -20,21 +20,21 @@
package org.onap.dcaegen2.services.prh.tasks;
-import java.util.Optional;
import org.onap.dcaegen2.services.config.AAIClientConfiguration;
import org.onap.dcaegen2.services.prh.configuration.AppConfig;
import org.onap.dcaegen2.services.prh.configuration.Config;
import org.onap.dcaegen2.services.prh.exceptions.AAINotFoundException;
-import org.onap.dcaegen2.services.service.AAIProducerClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import java.util.Optional;
+
@Component
public class AAIConsumerTaskImpl extends AAIConsumerTask<AAIClientConfiguration> {
- private static final Logger logger = LoggerFactory.getLogger(ScheduledTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIConsumerTaskImpl.class);
private final Config prhAppConfig;
private Optional<String> response;
@@ -46,15 +46,11 @@ public class AAIConsumerTaskImpl extends AAIConsumerTask<AAIClientConfiguration>
@Override
protected void consume() throws AAINotFoundException {
- //TODO: @Piotr Wielebski
- AAIProducerClient producerClient = new AAIProducerClient(prhAppConfig.getAAIClientConfiguration());
-
}
@Override
public Object execute(Object object) throws AAINotFoundException {
consume();
- //TODO: @Piotr Wielebski
return null;
}
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImpl.java
index 4a7d9282..505d2a9a 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImpl.java
@@ -19,25 +19,19 @@
*/
package org.onap.dcaegen2.services.prh.tasks;
-import com.google.gson.Gson;
import org.onap.dcaegen2.services.config.AAIClientConfiguration;
+import org.onap.dcaegen2.services.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.configuration.AppConfig;
import org.onap.dcaegen2.services.prh.configuration.Config;
import org.onap.dcaegen2.services.prh.exceptions.AAINotFoundException;
-import org.onap.dcaegen2.services.prh.exceptions.PrhTaskException;
-import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
-import org.onap.dcaegen2.services.prh.model.ImmutableConsumerDmaapModel;
import org.onap.dcaegen2.services.service.AAIProducerClient;
-import org.onap.dcaegen2.services.utils.HttpRequestDetails;
+import org.onap.dcaegen2.services.service.HttpUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Optional;
+import java.io.IOException;
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 4/13/18
@@ -45,11 +39,10 @@ import java.util.Optional;
@Component
public class AAIProducerTaskImpl extends AAIProducerTask<AAIClientConfiguration, ConsumerDmaapModel, Object> {
- private static final Logger logger = LoggerFactory.getLogger(ScheduledTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(AAIProducerTaskImpl.class);
private final Config prhAppConfig;
- private AAIProducerClient producerClient;
- private Optional<String> response;
+
@Autowired
public AAIProducerTaskImpl(AppConfig prhAppConfig) {
@@ -59,19 +52,24 @@ public class AAIProducerTaskImpl extends AAIProducerTask<AAIClientConfiguration,
@Override
protected Object publish(ConsumerDmaapModel consumerDmaapModel) throws AAINotFoundException {
logger.trace("Method %M called with arg {}", consumerDmaapModel);
- producerClient = new AAIProducerClient(prhAppConfig.getAAIClientConfiguration());
- //TODO: @Piotr Wielebski
- response = producerClient.getHttpResponse(null);
- return response.get();
+ AAIProducerClient producerClient = new AAIProducerClient(resolveConfiguration());
+ try {
+ return producerClient.getHttpResponse(consumerDmaapModel)
+ .filter(HttpUtils::isSuccessfulResponseCode);
+ } catch (IOException e) {
+ logger.warn("Patch request not successful", e);
+ throw new AAINotFoundException("Patch request not successful");
+ }
}
@Override
- public Object execute(Object object) throws PrhTaskException {
+ public Object execute(Object object) throws AAINotFoundException {
logger.trace("Method %M called with arg {}", object);
+
if (object instanceof ConsumerDmaapModel) {
- //TODO: @Piotr Wielebski
return publish((ConsumerDmaapModel) object);
}
+
throw new AAINotFoundException("Incorrect object type");
}
@@ -84,5 +82,4 @@ public class AAIProducerTaskImpl extends AAIProducerTask<AAIClientConfiguration,
protected AAIClientConfiguration resolveConfiguration() {
return prhAppConfig.getAAIClientConfiguration();
}
-
}
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImpl.java
index a2129fcd..69911f33 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImpl.java
@@ -19,12 +19,13 @@
*/
package org.onap.dcaegen2.services.prh.tasks;
+import org.onap.dcaegen2.services.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.config.DmaapConsumerConfiguration;
import org.onap.dcaegen2.services.prh.configuration.AppConfig;
import org.onap.dcaegen2.services.prh.configuration.Config;
import org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException;
import org.onap.dcaegen2.services.prh.exceptions.PrhTaskException;
-import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
+
import org.onap.dcaegen2.services.prh.service.DmaapConsumerJsonParser;
import org.onap.dcaegen2.services.service.consumer.ExtendedDmaapConsumerHttpClientImpl;
import org.slf4j.Logger;
@@ -32,9 +33,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/23/18
*/
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java
index 60ab64fd..4fef0353 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImpl.java
@@ -21,14 +21,12 @@ package org.onap.dcaegen2.services.prh.tasks;
import com.google.gson.Gson;
import org.onap.dcaegen2.services.config.DmaapPublisherConfiguration;
+import org.onap.dcaegen2.services.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.configuration.AppConfig;
import org.onap.dcaegen2.services.prh.configuration.Config;
import org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException;
import org.onap.dcaegen2.services.prh.exceptions.PrhTaskException;
-import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
-import org.onap.dcaegen2.services.service.producer.DmaapPublisherRequestDetails;
import org.onap.dcaegen2.services.service.producer.ExtendedDmaapProducerHttpClientImpl;
-import org.onap.dcaegen2.services.service.producer.ImmutableDmaapPublisherRequestDetails;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,9 +38,9 @@ import org.springframework.stereotype.Component;
*/
@Component
public class DmaapPublisherTaskImpl extends
- DmaapPublisherTask<DmaapPublisherConfiguration, ConsumerDmaapModel> {
+ DmaapPublisherTask<DmaapPublisherConfiguration, ConsumerDmaapModel> {
- private static final Logger logger = LoggerFactory.getLogger(ScheduledTasks.class);
+ private static final Logger logger = LoggerFactory.getLogger(DmaapPublisherTaskImpl.class);
private static final Gson gson = new Gson();
private final Config prhAppConfig;
@@ -55,13 +53,11 @@ public class DmaapPublisherTaskImpl extends
protected String publish(ConsumerDmaapModel consumerDmaapModel) throws DmaapNotFoundException {
logger.trace("Method %M called with arg {}", consumerDmaapModel);
ExtendedDmaapProducerHttpClientImpl dmaapProducerHttpClient = new ExtendedDmaapProducerHttpClientImpl(
- resolveConfiguration());
- DmaapPublisherRequestDetails dmaapPublisherRequestDetails = new ImmutableDmaapPublisherRequestDetails.Builder()
- .dmaapAPIPath("events").jsonBody(gson.toJson(consumerDmaapModel)).build();
- return dmaapProducerHttpClient.getHttpProducerResponse(dmaapPublisherRequestDetails)
- .filter(x -> !x.isEmpty() && x.equals(String.valueOf(HttpStatus.OK.value())))
- .orElseThrow(() -> new DmaapNotFoundException("Incorrect response from Dmmap"));
+ resolveConfiguration());
+ return dmaapProducerHttpClient.getHttpProducerResponse(consumerDmaapModel)
+ .filter(x -> !x.isEmpty() && x.equals(String.valueOf(HttpStatus.OK.value())))
+ .orElseThrow(() -> new DmaapNotFoundException("Incorrect response from Dmaap"));
}
@Override
@@ -82,4 +78,4 @@ public class DmaapPublisherTaskImpl extends
protected DmaapPublisherConfiguration resolveConfiguration() {
return prhAppConfig.getDmaapPublisherConfiguration();
}
-}
+} \ No newline at end of file
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java
index 84c75e08..07c0a58a 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java
@@ -25,9 +25,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/23/18
*/
@@ -39,15 +36,13 @@ public class ScheduledTasks {
private final Task dmaapConsumerTask;
private final Task dmaapProducerTask;
private final Task aaiProducerTask;
- private final Task aaiConsumerTask;
@Autowired
public ScheduledTasks(DmaapConsumerTask dmaapConsumerTask, DmaapPublisherTask dmaapPublisherTask,
- AAIProducerTask aaiPublisherTask, AAIConsumerTask aaiConsumerTask) {
+ AAIProducerTask aaiPublisherTask) {
this.dmaapConsumerTask = dmaapConsumerTask;
this.dmaapProducerTask = dmaapPublisherTask;
this.aaiProducerTask = aaiPublisherTask;
- this.aaiConsumerTask = aaiConsumerTask;
}
public void scheduleMainPrhEventTask() {
@@ -64,8 +59,6 @@ public class ScheduledTasks {
private void setTaskExecutionFlow() {
dmaapConsumerTask.setNext(aaiProducerTask);
- aaiProducerTask.setNext(aaiConsumerTask);
- aaiConsumerTask.setNext(dmaapProducerTask);
+ aaiProducerTask.setNext(dmaapProducerTask);
}
-
}
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/Task.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/Task.java
index a9b10d40..97202146 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/Task.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/Task.java
@@ -20,7 +20,6 @@
package org.onap.dcaegen2.services.prh.tasks;
import org.onap.dcaegen2.services.prh.exceptions.PrhTaskException;
-import org.springframework.http.ResponseEntity;
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 4/13/18