2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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=========================================================
20 package org.onap.policy.xacml.std.pap;
22 import java.util.Collection;
23 import java.util.LinkedList;
25 import org.onap.policy.xacml.api.pap.OnapPDP;
26 import org.onap.policy.xacml.api.pap.OnapPDPGroup;
28 public class StdPDPItemSetChangeNotifier {
30 private Collection<StdItemSetChangeListener> listeners = null;
32 public interface StdItemSetChangeListener {
34 public void changed();
36 public void groupChanged(OnapPDPGroup group);
38 public void pdpChanged(OnapPDP pdp);
42 public void addItemSetChangeListener(StdItemSetChangeListener listener) {
43 if (this.listeners == null) {
44 this.listeners = new LinkedList<>();
46 this.listeners.add(listener);
49 public void removeItemSetChangeListener(StdItemSetChangeListener listener) {
50 if (this.listeners != null) {
51 this.listeners.remove(listener);
55 public void fireChanged() {
56 if (this.listeners == null) {
59 for (StdItemSetChangeListener l : this.listeners) {
64 public void firePDPGroupChanged(OnapPDPGroup group) {
65 if (this.listeners == null) {
68 for (StdItemSetChangeListener l : this.listeners) {
69 l.groupChanged(group);
73 public void firePDPChanged(OnapPDP pdp) {
74 if (this.listeners == null) {
77 for (StdItemSetChangeListener l : this.listeners) {