* ============LICENSE_START=======================================================
* ONAP PAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020-2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.policy.pap.main.comm.PolicyUndeployer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
/**
* Implementation of policy undeployer.
*/
+@Component
public class PolicyUndeployerImpl extends ProviderBase implements PolicyUndeployer {
private static final Logger logger = LoggerFactory.getLogger(PolicyUndeployerImpl.class);
-
- /**
- * Constructs the object.
- */
- public PolicyUndeployerImpl() {
- super();
- }
-
@Override
public void undeploy(String group, String subgroup, Collection<ToscaConceptIdentifier> policies)
throws PfModelException {
PdpSubGroup subgroup = optsub.get();
// remove the policies
- boolean updated = false;
+ var updated = false;
Set<String> pdps = subgroup.getPdpInstances().stream().map(Pdp::getInstanceId).collect(Collectors.toSet());
for (ToscaConceptIdentifier ident : policyInfo.policies) {
subgroup.getPdpType(), subgroup.getPolicies().size());
updated = true;
- data.trackUndeploy(ident, pdps);
+ data.trackUndeploy(ident, pdps, policyInfo.group, policyInfo.subgroup);
}
// push the updates