diff options
author | Lusheng Ji <lji@research.att.com> | 2018-04-12 21:43:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-12 21:43:29 +0000 |
commit | fe084656d61212a7e4a5f6cc6f60b3eb6a146302 (patch) | |
tree | 94b7077f4a2ad0a0e4e469f39ffbbeb3cd220e21 /prh-dmaap-client | |
parent | ed8fc543198ec2a878f7e4e2966fa66a6c4986a9 (diff) | |
parent | 3c2e8c9c4c32ad59be75a7500e628344c6dab5bf (diff) |
Merge "Already added loading config for AAI and DMAAP"
Diffstat (limited to 'prh-dmaap-client')
4 files changed, 41 insertions, 17 deletions
diff --git a/prh-dmaap-client/pom.xml b/prh-dmaap-client/pom.xml index fbb05cfb..94808cf8 100644 --- a/prh-dmaap-client/pom.xml +++ b/prh-dmaap-client/pom.xml @@ -44,6 +44,10 @@ <groupId>org.immutables</groupId> <artifactId>value</artifactId> </dependency> + <dependency> + <groupId>com.fasterxml.jackson.datatype</groupId> + <artifactId>jackson-datatype-jdk8</artifactId> + </dependency> <!-- LOGGING DEPENDENCIES --> <dependency> 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 c4acf3af..9b322c9c 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 @@ -19,24 +19,31 @@ */ package org.onap.dcaegen2.services.config; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.immutables.value.Value; +import org.springframework.stereotype.Component; /** * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/23/18 */ +@Component @Value.Immutable(prehash = true) -@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE) +@Value.Style(builder = "new") +@JsonDeserialize(builder = ImmutableDmaapConsumerConfiguration.Builder.class) public abstract class DmaapConsumerConfiguration implements DmaapCustomConfig { private static final long serialVersionUID = 1L; - + @Value.Parameter abstract String consumerId(); + @Value.Parameter abstract String consumerGroup(); + @Value.Parameter abstract Integer timeoutMS(); + @Value.Parameter abstract Integer messageLimit(); 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 index ee849338..60df5b05 100644 --- 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 @@ -20,42 +20,50 @@ package org.onap.dcaegen2.services.config; import java.io.Serializable; +import org.immutables.value.Value; /** * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/28/18 */ public interface DmaapCustomConfig extends Serializable { - String dmmaphostName(); + @Value.Parameter + String dmmapHostName(); - Integer dmmapportNumber(); + @Value.Parameter + Integer dmmapPortNumber(); - String dmmaptopicName(); + @Value.Parameter + String dmmapTopicName(); - String dmmapprotocol(); + @Value.Parameter + String dmmapProtocol(); - String dmmapuserName(); + @Value.Parameter + String dmmapUserName(); - String dmmapuserPassword(); + @Value.Parameter + String dmmapUserPassword(); - String dmmapcontentType(); + @Value.Parameter + String dmmapContentType(); interface Builder<T extends DmaapCustomConfig, B extends Builder<T, B>> { - B dmmaphostName(String dmmaphostName); + B dmmapHostName(String dmmapHostName); - B dmmapportNumber(Integer dmmapportNumber); + B dmmapPortNumber(Integer dmmapPortNumber); - B dmmaptopicName(String dmmaptopicName); + B dmmapTopicName(String dmmapTopicName); - B dmmapprotocol(String dmmapprotocol); + B dmmapProtocol(String dmmapProtocol); - B dmmapuserName(String dmmapuserName); + B dmmapUserName(String dmmapUserName); - B dmmapuserPassword(String dmmapuserPassword); + B dmmapUserPassword(String dmmapUserPassword); - B dmmapcontentType(String dmmapcontentType); + 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 b63d68bd..99cbbca3 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 @@ -19,19 +19,24 @@ */ package org.onap.dcaegen2.services.config; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.immutables.value.Value; +import org.springframework.stereotype.Component; /** * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/23/18 */ +@Component @Value.Immutable(prehash = true) -@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE) +@Value.Style(builder = "new") +@JsonDeserialize(builder = ImmutableDmaapProducerConfiguration.Builder.class) public abstract class DmaapProducerConfiguration implements DmaapCustomConfig { private static final long serialVersionUID = 1L; interface Builder extends DmaapCustomConfig.Builder<DmaapProducerConfiguration, DmaapProducerConfiguration.Builder> { + } public static DmaapProducerConfiguration.Builder builder() { |