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=========================================================
21 package org.onap.policy.std;
23 import java.util.Collection;
24 import java.util.HashSet;
26 import org.onap.policy.api.LoadedPolicy;
27 import org.onap.policy.api.NotificationType;
28 import org.onap.policy.api.PDPNotification;
29 import org.onap.policy.api.RemovedPolicy;
31 public class StdPDPNotification implements PDPNotification{
32 private Collection<StdRemovedPolicy> removedPolicies = null;
33 private Collection<StdLoadedPolicy> loadedPolicies = null;
34 private Collection<RemovedPolicy> removed = null;
35 private Collection<LoadedPolicy> updated = null;
36 private NotificationType notificationType= null;
39 public Collection<RemovedPolicy> getRemovedPolicies() {
40 removed = new HashSet<RemovedPolicy>();
41 if(removedPolicies!=null){
42 for(RemovedPolicy removedPolicy: removedPolicies){
43 removed.add(removedPolicy);
52 public Collection<LoadedPolicy> getLoadedPolicies() {
53 updated = new HashSet<LoadedPolicy>();
54 if(loadedPolicies!=null){
55 for(LoadedPolicy updatedPolicy: loadedPolicies){
56 updated.add(updatedPolicy);
65 public NotificationType getNotificationType() {
66 return notificationType;
69 public void setNotificationType(NotificationType notificationType){
70 this.notificationType= notificationType;
73 public void setLoadedPolicies(Collection<StdLoadedPolicy> loadedPolicies) {
74 this.loadedPolicies = loadedPolicies;
77 public void setRemovedPolicies(Collection<StdRemovedPolicy> removedPolicies) {
78 this.removedPolicies = removedPolicies;