diff options
author | Jim Hahn <jrh3@att.com> | 2021-08-17 15:25:39 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-08-18 15:51:02 -0400 |
commit | f9506fa28790781dbba0cb7ac16e1f19350ea4ef (patch) | |
tree | 1c2fecf159fc15bcdcde851b8818fb3aece9d259 /models-pdp/src/main/java/org/onap | |
parent | 35dff8f8bd31fd71e7f5e6c9aa39fe096e35d98a (diff) |
Add PDP-TOPIC-CHECK message
Added a new PdpMessage subclass that a PDP can use to verify its ability
to send/receive to/from the PDP-PAP topic before it sends its first
registration message.
Issue-ID: POLICY-3531
Change-Id: Ied61caa805e93e25732385bf91272b4fc248fd69
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-pdp/src/main/java/org/onap')
3 files changed, 63 insertions, 4 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpMessage.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpMessage.java index 5d0359c74..219193266 100644 --- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpMessage.java +++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpMessage.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. + * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ package org.onap.policy.models.pdp.concepts; import java.util.UUID; import lombok.AccessLevel; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NonNull; import lombok.Setter; @@ -38,6 +39,7 @@ import org.onap.policy.models.pdp.enums.PdpMessageType; @Getter @Setter @ToString +@EqualsAndHashCode public class PdpMessage { @Setter(AccessLevel.NONE) @@ -58,13 +60,13 @@ public class PdpMessage { /** * Group associated with the PDP. For state-change messages, this may be {@code null}, - * if the {@link #name} is provided. + * if the {@link #name} is provided. Also {@code null} for topic-check messages. */ private String pdpGroup; /** * Group associated with the PDP. For state-change messages, this may be {@code null}, - * if the {@link #name} is provided. + * if the {@link #name} is provided. Also {@code null} for topic-check messages. */ private String pdpSubgroup; diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpTopicCheck.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpTopicCheck.java new file mode 100644 index 000000000..2cd3a9d8b --- /dev/null +++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpTopicCheck.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 AT&T Intellectual Property. + * ================================================================================ + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.models.pdp.concepts; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import org.onap.policy.models.pdp.enums.PdpMessageType; + +/** + * Class to represent the PDP_TOPIC_CHECK message that a PDP will send to itself. + */ +@Getter +@Setter +@ToString(callSuper = true) +public class PdpTopicCheck extends PdpMessage { + + /** + * Constructs the object. + * + */ + public PdpTopicCheck() { + super(PdpMessageType.PDP_TOPIC_CHECK); + } + + /** + * Constructs the object, making a deep copy. + * + * @param source source from which to copy + */ + public PdpTopicCheck(PdpTopicCheck source) { + super(source); + } +} diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/enums/PdpMessageType.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/enums/PdpMessageType.java index 7ba4ad73e..a8aad9667 100644 --- a/models-pdp/src/main/java/org/onap/policy/models/pdp/enums/PdpMessageType.java +++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/enums/PdpMessageType.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. + * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,4 +50,9 @@ public enum PdpMessageType { * PDP_HEALTH_CHECK operation. */ PDP_HEALTH_CHECK, + + /** + * Used by PDPs to check their ability to send and receive messages on the PDP-PAP topic. + */ + PDP_TOPIC_CHECK, } |