From cce79248655f484e007769ba81b092148f940d27 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Tue, 9 Jan 2024 15:19:07 +0000 Subject: Drools support for kafka topics Issue-ID: POLICY-4201 Change-Id: I91676c168c676018aa1079943747f16917f50a49 Signed-off-by: adheli.tavares --- .../drools/domain/models/controller/ControllerPolicy.java | 5 ++++- .../domain/models/controller/ControllerProperties.java | 5 ++++- .../domain/models/controller/ControllerSinkTopic.java | 13 +++++++++++++ .../domain/models/controller/ControllerSourceTopic.java | 13 +++++++++++++ 4 files changed, 34 insertions(+), 2 deletions(-) (limited to 'policy-domains/src/main') diff --git a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerPolicy.java b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerPolicy.java index 92372765..b16af396 100644 --- a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerPolicy.java +++ b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerPolicy.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +21,7 @@ package org.onap.policy.drools.domain.models.controller; +import java.io.Serial; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; @@ -35,6 +37,7 @@ import org.onap.policy.drools.domain.models.DroolsPolicy; @EqualsAndHashCode(callSuper = true) public class ControllerPolicy extends DroolsPolicy implements Serializable { + @Serial private static final long serialVersionUID = -8171337852833516581L; private ControllerProperties properties; diff --git a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerProperties.java b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerProperties.java index 780c20dc..b55e4344 100644 --- a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerProperties.java +++ b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerProperties.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +21,7 @@ package org.onap.policy.drools.domain.models.controller; +import java.io.Serial; import java.io.Serializable; import java.util.List; import java.util.Map; @@ -34,6 +36,7 @@ import lombok.Data; @Data @Builder public class ControllerProperties implements Serializable { + @Serial private static final long serialVersionUID = 1259434187110418986L; private String controllerName; diff --git a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSinkTopic.java b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSinkTopic.java index c4772f3b..57c07f2d 100644 --- a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSinkTopic.java +++ b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSinkTopic.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +21,7 @@ package org.onap.policy.drools.domain.models.controller; +import java.io.Serial; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,5 +36,16 @@ import lombok.experimental.SuperBuilder; @SuperBuilder @EqualsAndHashCode(callSuper = true) public class ControllerSinkTopic extends ControllerTopic implements Serializable { + @Serial private static final long serialVersionUID = 8770353732981476267L; + + @Override + public void setTopicName(String topicName) { + this.topicName = topicName.toLowerCase(); + } + + @Override + public String getTopicName() { + return topicName.toLowerCase(); + } } diff --git a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSourceTopic.java b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSourceTopic.java index 97a21e6c..3c7f1f03 100644 --- a/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSourceTopic.java +++ b/policy-domains/src/main/java/org/onap/policy/drools/domain/models/controller/ControllerSourceTopic.java @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +21,7 @@ package org.onap.policy.drools.domain.models.controller; +import java.io.Serial; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,5 +36,16 @@ import lombok.experimental.SuperBuilder; @SuperBuilder @EqualsAndHashCode(callSuper = true) public class ControllerSourceTopic extends ControllerTopic implements Serializable { + @Serial private static final long serialVersionUID = -1732598566914643612L; + + @Override + public void setTopicName(String topicName) { + this.topicName = topicName.toLowerCase(); + } + + @Override + public String getTopicName() { + return topicName.toLowerCase(); + } } -- cgit 1.2.3-korg