2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.xacml.std.pap;
23 import java.util.Collection;
24 import java.util.LinkedList;
26 import org.onap.policy.xacml.api.pap.OnapPDP;
27 import org.onap.policy.xacml.api.pap.OnapPDPGroup;
29 public class StdPDPItemSetChangeNotifier {
31 private Collection<StdItemSetChangeListener> listeners = null;
33 public interface StdItemSetChangeListener {
35 public void changed();
37 public void groupChanged(OnapPDPGroup group);
39 public void pdpChanged(OnapPDP pdp);
44 * addItemSetChangeListener.
46 * @param listener StdItemSetChangeListener
48 public void addItemSetChangeListener(StdItemSetChangeListener listener) {
49 if (this.listeners == null) {
50 this.listeners = new LinkedList<>();
52 this.listeners.add(listener);
56 * removeItemSetChangeListener.
58 * @param listener StdItemSetChangeListener
60 public void removeItemSetChangeListener(StdItemSetChangeListener listener) {
61 if (this.listeners != null) {
62 this.listeners.remove(listener);
69 public void fireChanged() {
70 if (this.listeners == null) {
73 for (StdItemSetChangeListener l : this.listeners) {
79 * firePDPGroupChanged.
81 * @param group OnapPDPGroup
83 public void firePDPGroupChanged(OnapPDPGroup group) {
84 if (this.listeners == null) {
87 for (StdItemSetChangeListener l : this.listeners) {
88 l.groupChanged(group);
97 public void firePDPChanged(OnapPDP pdp) {
98 if (this.listeners == null) {
101 for (StdItemSetChangeListener l : this.listeners) {