diff options
Diffstat (limited to 'prh-dmaap-client/src/main')
3 files changed, 32 insertions, 0 deletions
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClient.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClient.java index b0cca3f3..4317da44 100644 --- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClient.java +++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClient.java @@ -41,6 +41,12 @@ public class DMaaPReactiveWebClient { private String dmaaPUserName; private String dmaaPUserPassword; + /** + * Creating DMaaPReactiveWebClient passing to them basic DMaaPConfig. + * + * @param dmaapCustomConfig - configuration object + * @return DMaaPReactiveWebClient + */ public DMaaPReactiveWebClient fromConfiguration(DmaapCustomConfig dmaapCustomConfig) { this.dmaaPUserName = dmaapCustomConfig.dmaapUserName(); this.dmaaPUserPassword = dmaapCustomConfig.dmaapUserPassword(); @@ -48,6 +54,11 @@ public class DMaaPReactiveWebClient { return this; } + /** + * Construct Reactive WebClient with appropriate settings. + * + * @return WebClient + */ public WebClient build() { return WebClient.builder() .defaultHeader(HttpHeaders.CONTENT_TYPE, dmaaPContentType) diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPConsumerReactiveHttpClient.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPConsumerReactiveHttpClient.java index af54bf3b..46699275 100644 --- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPConsumerReactiveHttpClient.java +++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPConsumerReactiveHttpClient.java @@ -45,6 +45,11 @@ public class DMaaPConsumerReactiveHttpClient { private final String consumerGroup; private final String consumerId; + /** + * Constructor of DMaaPConsumerReactiveHttpClient. + * + * @param consumerConfiguration - DMaaP consumer configuration object + */ public DMaaPConsumerReactiveHttpClient(DmaapConsumerConfiguration consumerConfiguration) { this.dmaapHostName = consumerConfiguration.dmaapHostName(); this.dmaapProtocol = consumerConfiguration.dmaapProtocol(); @@ -54,6 +59,11 @@ public class DMaaPConsumerReactiveHttpClient { this.consumerId = consumerConfiguration.consumerId(); } + /** + * Function for calling DMaaP HTTP consumer - consuming messages from Kafka/DMaaP from topic. + * + * @return reactive response from DMaaP in string format + */ public Mono<String> getDMaaPConsumerResponse() { try { return webClient diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/DMaaPProducerReactiveHttpClient.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/DMaaPProducerReactiveHttpClient.java index 0bc78d43..8be69cdc 100644 --- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/DMaaPProducerReactiveHttpClient.java +++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/DMaaPProducerReactiveHttpClient.java @@ -45,6 +45,11 @@ public class DMaaPProducerReactiveHttpClient { private final String dmaapProtocol; private final String dmaapTopicName; + /** + * Constructor DMaaPProducerReactiveHttpClient. + * + * @param dmaapPublisherConfiguration - DMaaP producer configuration object + */ public DMaaPProducerReactiveHttpClient(DmaapPublisherConfiguration dmaapPublisherConfiguration) { this.dmaapHostName = dmaapPublisherConfiguration.dmaapHostName(); this.dmaapProtocol = dmaapPublisherConfiguration.dmaapProtocol(); @@ -52,6 +57,12 @@ public class DMaaPProducerReactiveHttpClient { this.dmaapTopicName = dmaapPublisherConfiguration.dmaapTopicName(); } + /** + * Function for calling DMaaP HTTP producer - post request to DMaaP. + * + * @param consumerDmaapModelMono - object which will be sended to DMaaP + * @return status code of operation + */ public Mono<String> getDMaaPProducerResponse(Mono<ConsumerDmaapModel> consumerDmaapModelMono) { try { return webClient |