Switching logging of ToscaPolicyXXXIdentifiers to use new toString() 56/109056/1
authorRossC <ross.carter@est.tech>
Thu, 11 Jun 2020 10:24:13 +0000 (11:24 +0100)
committerRossC <ross.carter@est.tech>
Thu, 11 Jun 2020 10:31:10 +0000 (11:31 +0100)
Issue-ID: POLICY-2078
Change-Id: I035eceb45e76ef11df0e903b584fcf7f8eb63208
Signed-off-by: RossC <ross.carter@est.tech>
main/src/main/java/org/onap/policy/pap/main/notification/PolicyNotifier.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupDeleteProvider.java
main/src/main/java/org/onap/policy/pap/main/rest/PdpGroupDeployProvider.java
main/src/main/java/org/onap/policy/pap/main/rest/PolicyUndeployerImpl.java

index 430a09b..12630af 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -134,8 +135,8 @@ public class PolicyNotifier {
 
             ToscaPolicyTypeIdentifier type = id2type.get(policyId);
             if (type == null) {
-                logger.error("group {}:{} refers to non-existent policy {}:{}", group.getName(), subgrp.getPdpType(),
-                                policyId.getName(), policyId.getVersion());
+                logger.error("group {}:{} refers to non-existent policy {}", group.getName(), subgrp.getPdpType(),
+                                policyId);
                 continue;
             }
 
index 931ad7f..4445038 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -154,7 +155,7 @@ public class PdpGroupDeleteProvider extends ProviderBase {
                 if (matcher.test(ident)) {
                     result = true;
                     iter.remove();
-                    logger.info("remove policy {} {} from subgroup {} {} count={}", ident.getName(), ident.getVersion(),
+                    logger.info("remove policy {} from subgroup {} {} count={}", ident,
                                     group.getName(), subgroup.getPdpType(), subgroup.getPolicies().size());
 
                     data.trackUndeploy(ident, pdps);
index 4c0accd..d09e2ea 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -439,9 +440,8 @@ public class PdpGroupDeployProvider extends ProviderBase {
             // add the policy to the subgroup
             subgroup.getPolicies().add(desiredIdent);
 
-            logger.info("add policy {} {} to subgroup {} {} count={}", desiredIdent.getName(),
-                            desiredIdent.getVersion(), group.getName(), subgroup.getPdpType(),
-                            subgroup.getPolicies().size());
+            logger.info("add policy {} to subgroup {} {} count={}", desiredIdent, group.getName(),
+                            subgroup.getPdpType(), subgroup.getPolicies().size());
 
             Set<String> pdps = subgroup.getPdpInstances().stream().map(Pdp::getInstanceId).collect(Collectors.toSet());
             data.trackDeploy(desiredIdent, pdps);
@@ -505,8 +505,8 @@ public class PdpGroupDeployProvider extends ProviderBase {
             }
 
             // already has the desired policy & version
-            logger.info("subgroup {} {} already contains policy {} {}", group.getName(), subgroup.getPdpType(), desnm,
-                            desvers);
+            logger.info("subgroup {} {} already contains policy {}", group.getName(), subgroup.getPdpType(),
+                        desiredIdent);
             return true;
         }
 
index f281208..85ad128 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP PAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -88,8 +89,8 @@ public class PolicyUndeployerImpl extends ProviderBase implements PolicyUndeploy
                 continue;
             }
 
-            logger.info("remove policy {} {} from subgroup {} {} count={}", ident.getName(), ident.getVersion(),
-                            group.getName(), subgroup.getPdpType(), subgroup.getPolicies().size());
+            logger.info("remove policy {} from subgroup {} {} count={}", ident, group.getName(),
+                    subgroup.getPdpType(), subgroup.getPolicies().size());
 
             updated = true;
             data.trackUndeploy(ident, pdps);