summaryrefslogtreecommitdiffstats
path: root/prh-dmaap-client/src/main
diff options
context:
space:
mode:
authorwasala <przemyslaw.wasala@nokia.com>2018-03-28 19:04:20 +0200
committerwasala <przemyslaw.wasala@nokia.com>2018-03-28 19:39:28 +0200
commit9292dd2aa89214957fc72980f58026324ca75a4f (patch)
treee9635d6456369d56e4aac912aaa17c1f37c67a52 /prh-dmaap-client/src/main
parentd8e4e88b6080dfd701ea7aa64d033c38899e77c6 (diff)
Already fixed Sonar issues
We have fixed Sonar issue with critical and minor tag Change-Id: Iccc343654686ba87f71d57382b68ddf9c54caeea Issue-ID: DCAEGEN2-407 Signed-off-by: wasala <przemyslaw.wasala@nokia.com>
Diffstat (limited to 'prh-dmaap-client/src/main')
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConfig.java2
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConsumerConfiguration.java44
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapCustomConfig.java60
-rw-r--r--prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapProducerConfiguration.java31
4 files changed, 89 insertions, 48 deletions
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConfig.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConfig.java
index 0d77c057..430a103a 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConfig.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConfig.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * PROJECT
+ * PNF-REGISTRATION-HANDLER
* ================================================================================
* Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
* ================================================================================
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConsumerConfiguration.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConsumerConfiguration.java
index f2a2f061..c4acf3af 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConsumerConfiguration.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapConsumerConfiguration.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * PROJECT
+ * PNF-REGISTRATION-HANDLER
* ================================================================================
* Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
* ================================================================================
@@ -25,41 +25,35 @@ import org.immutables.value.Value;
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/23/18
*/
@Value.Immutable(prehash = true)
-@Value.Style(stagedBuilder = true)
-public abstract class DmaapConsumerConfiguration implements DmaapConfig {
+@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE)
+public abstract class DmaapConsumerConfiguration implements DmaapCustomConfig {
private static final long serialVersionUID = 1L;
- @Value.Parameter
- public abstract String consumerId();
- @Value.Parameter
- public abstract String consumerGroup();
+ abstract String consumerId();
- @Value.Parameter
- public abstract Integer timeoutMS();
+ abstract String consumerGroup();
- @Value.Parameter
- public abstract Integer messageLimit();
+ abstract Integer timeoutMS();
- @Value.Parameter
- public abstract String dmmaphostName();
+ abstract Integer messageLimit();
- @Value.Parameter
- public abstract Integer dmmapportNumber();
- @Value.Parameter
- public abstract String dmmaptopicName();
+ public interface Builder extends
+ DmaapCustomConfig.Builder<DmaapConsumerConfiguration, DmaapConsumerConfiguration.Builder> {
- @Value.Parameter
- public abstract String dmmapprotocol();
+ Builder consumerId(String consumerId);
- @Value.Parameter
- public abstract String dmmapuserName();
+ Builder consumerGroup(String consumerGroup);
- @Value.Parameter
- public abstract String dmmapuserPassword();
+ Builder timeoutMS(Integer timeoutMS);
+
+ Builder messageLimit(Integer messageLimit);
+ }
+
+ public static DmaapConsumerConfiguration.Builder builder() {
+ return ImmutableDmaapConsumerConfiguration.builder();
+ }
- @Value.Parameter
- public abstract String dmmapcontentType();
} \ No newline at end of file
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapCustomConfig.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapCustomConfig.java
new file mode 100644
index 00000000..1026cc31
--- /dev/null
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapCustomConfig.java
@@ -0,0 +1,60 @@
+/*-
+ * ============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.config;
+
+/**
+ * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/28/18
+ */
+public interface DmaapCustomConfig extends DmaapConfig {
+
+ String dmmaphostName();
+
+ Integer dmmapportNumber();
+
+ String dmmaptopicName();
+
+ String dmmapprotocol();
+
+ String dmmapuserName();
+
+ String dmmapuserPassword();
+
+ String dmmapcontentType();
+
+
+ interface Builder<T extends DmaapCustomConfig, B extends Builder<T, B>> {
+
+ B dmmaphostName(String dmmaphostName);
+
+ B dmmapportNumber(Integer dmmapportNumber);
+
+ B dmmaptopicName(String dmmaptopicName);
+
+ B dmmapprotocol(String dmmapprotocol);
+
+ B dmmapuserName(String dmmapuserName);
+
+ B dmmapuserPassword(String dmmapuserPassword);
+
+ B dmmapcontentType(String dmmapcontentType);
+
+ T build();
+ }
+}
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapProducerConfiguration.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapProducerConfiguration.java
index a0f29e44..550d9799 100644
--- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapProducerConfiguration.java
+++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/config/DmaapProducerConfiguration.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * PROJECT
+ * PNF-REGISTRATION-HANDLER
* ================================================================================
* Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
* ================================================================================
@@ -25,29 +25,16 @@ import org.immutables.value.Value;
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/23/18
*/
@Value.Immutable(prehash = true)
-@Value.Style(stagedBuilder = true)
-public abstract class DmaapProducerConfiguration implements DmaapConfig {
+@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE)
+public abstract class DmaapProducerConfiguration implements DmaapCustomConfig {
private static final long serialVersionUID = 1L;
- @Value.Parameter
- public abstract String dmmaphostName();
+ public interface Builder extends
+ DmaapCustomConfig.Builder<DmaapProducerConfiguration, DmaapProducerConfiguration.Builder> {
+ }
- @Value.Parameter
- public abstract Integer dmmapportNumber();
-
- @Value.Parameter
- public abstract String dmmaptopicName();
-
- @Value.Parameter
- public abstract String dmmapprotocol();
-
- @Value.Parameter
- public abstract String dmmapuserName();
-
- @Value.Parameter
- public abstract String dmmapuserPassword();
-
- @Value.Parameter
- public abstract String dmmapcontentType();
+ public static Builder builder() {
+ return ImmutableDmaapProducerConfiguration.builder();
+ }
}