summaryrefslogtreecommitdiffstats
path: root/prh-dmaap-client/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'prh-dmaap-client/src/main')
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapConsumerConfiguration.java7
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java3
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapPublisherConfiguration.java1
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponse.java32
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponseImpl.java72
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPResponse.java32
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/DMaaPReactiveWebClient.java17
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPConsumerReactiveHttpClient.java1
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/producer/DMaaPProducerReactiveHttpClient.java1
9 files changed, 18 insertions, 148 deletions
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapConsumerConfiguration.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapConsumerConfiguration.java
index 89d3bd4c..6663554e 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapConsumerConfiguration.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapConsumerConfiguration.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* PNF-REGISTRATION-HANDLER
* ================================================================================
@@ -17,6 +17,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.dcaegen2.services.prh.config;
import org.immutables.gson.Gson;
@@ -41,7 +42,7 @@ public abstract class DmaapConsumerConfiguration implements DmaapCustomConfig {
public abstract String consumerGroup();
@Value.Parameter
- public abstract Integer timeoutMS();
+ public abstract Integer timeoutMs();
@Value.Parameter
public abstract Integer messageLimit();
@@ -54,7 +55,7 @@ public abstract class DmaapConsumerConfiguration implements DmaapCustomConfig {
Builder consumerGroup(String consumerGroup);
- Builder timeoutMS(Integer timeoutMS);
+ Builder timeoutMs(Integer timeoutMs);
Builder messageLimit(Integer messageLimit);
}
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java
index ecc9d211..6e7f538a 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java
@@ -1,4 +1,4 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* PNF-REGISTRATION-HANDLER
* ================================================================================
@@ -17,6 +17,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.dcaegen2.services.prh.config;
import java.io.Serializable;
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapPublisherConfiguration.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapPublisherConfiguration.java
index 2e95463c..e353056f 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapPublisherConfiguration.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapPublisherConfiguration.java
@@ -17,6 +17,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.dcaegen2.services.prh.config;
import org.immutables.gson.Gson;
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponse.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponse.java
deleted file mode 100644
index d2c83e73..00000000
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponse.java
+++ /dev/null
@@ -1,32 +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.response;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 4/17/18
- */
-public interface DMaaPConsumerResponse extends DMaaPResponse {
-
-
- List<String> getFetchedMessages();
-
-}
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponseImpl.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponseImpl.java
deleted file mode 100644
index ddac9cbf..00000000
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPConsumerResponseImpl.java
+++ /dev/null
@@ -1,72 +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.response;
-
-import static java.util.Collections.unmodifiableList;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.StringJoiner;
-import org.springframework.lang.NonNull;
-import org.springframework.lang.Nullable;
-
-/**
- * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 4/17/18
- */
-public class DMaaPConsumerResponseImpl implements DMaaPConsumerResponse {
-
-
- private final Integer responseCode;
- private final String responseMessage;
- private final List<String> fetchedMessage;
-
- public DMaaPConsumerResponseImpl(@NonNull Integer responseCode, @NonNull String responseMessage,
- @Nullable List<String> fetchedMessage) {
- this.responseCode = responseCode;
- this.responseMessage = responseMessage;
- this.fetchedMessage = Optional.ofNullable(fetchedMessage).orElse(Collections.emptyList());
- }
-
-
- @Override
- public String getResponseMessage() {
- return responseMessage;
- }
-
- @Override
- public Integer getResponseCode() {
- return responseCode;
- }
-
- @Override
- public List<String> getFetchedMessages() {
- return unmodifiableList(fetchedMessage);
- }
-
- @Override
- public String toString() {
- return new StringJoiner(", ", this.getClass().getSimpleName() + "[", "]")
- .add("responseCode=" + responseCode)
- .add("responseMessage=" + responseMessage)
- .add("fetchedMessage=" + fetchedMessage)
- .toString();
- }
-}
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPResponse.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPResponse.java
deleted file mode 100644
index 5bf199c0..00000000
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/response/DMaaPResponse.java
+++ /dev/null
@@ -1,32 +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.response;
-
-/**
- * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 4/17/18
- */
-public interface DMaaPResponse {
-
- Integer getResponseCode();
-
-
- String getResponseMessage();
-}
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 ab81bede..b0cca3f3 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
@@ -17,6 +17,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.dcaegen2.services.prh.service;
import static org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication;
@@ -36,21 +37,21 @@ public class DMaaPReactiveWebClient {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
- private String dMaaPContentType;
- private String dMaaPUserName;
- private String dMaaPUserPassword;
+ private String dmaaPContentType;
+ private String dmaaPUserName;
+ private String dmaaPUserPassword;
public DMaaPReactiveWebClient fromConfiguration(DmaapCustomConfig dmaapCustomConfig) {
- this.dMaaPUserName = dmaapCustomConfig.dmaapUserName();
- this.dMaaPUserPassword = dmaapCustomConfig.dmaapUserPassword();
- this.dMaaPContentType = dmaapCustomConfig.dmaapContentType();
+ this.dmaaPUserName = dmaapCustomConfig.dmaapUserName();
+ this.dmaaPUserPassword = dmaapCustomConfig.dmaapUserPassword();
+ this.dmaaPContentType = dmaapCustomConfig.dmaapContentType();
return this;
}
public WebClient build() {
return WebClient.builder()
- .defaultHeader(HttpHeaders.CONTENT_TYPE, dMaaPContentType)
- .filter(basicAuthentication(dMaaPUserName, dMaaPUserPassword))
+ .defaultHeader(HttpHeaders.CONTENT_TYPE, dmaaPContentType)
+ .filter(basicAuthentication(dmaaPUserName, dmaaPUserPassword))
.filter(logRequest())
.filter(logResponse())
.build();
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 23cdc98d..af54bf3b 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
@@ -17,6 +17,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.dcaegen2.services.prh.service.consumer;
import java.net.URI;
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 e29ecc64..0bc78d43 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
@@ -17,6 +17,7 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.dcaegen2.services.prh.service.producer;
import java.net.URI;