X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Freports%2FNotify.java;h=5a0b70a1fe9a83a36a24df55c84812b44695566a;hb=57effd69fb15e0c73f85296d10ff6b358a6cbebb;hp=f4f3fda536d605c950296f986220a20413e8af6b;hpb=502da3cb1daf171395630dbaf4a2f2e2fb9aa93e;p=aaf%2Fauthz.git diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java index f4f3fda5..5a0b70a1 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Notify.java @@ -209,7 +209,8 @@ import org.onap.aaf.misc.env.util.Chrono; // now create Notification for(NotifyBody nb : NotifyBody.getAll()) { - notify(noAvg, nb); + int count = notify(noAvg, nb); + trans.info().printf("Emailed %d for %s",count,nb.name()); } // @@ -294,16 +295,15 @@ import org.onap.aaf.misc.env.util.Chrono; // Update cbl.preLoop(); lastN.update(cbl.inc(),es.getKey(),"pending",""); + npab.inc(); } } } } finally { cbl.flush(); tt.done(); + trans.info().printf("Notified %d persons of Pending Approvals", npab.count()); } - trans.info().printf("Created %d Notifications", count.get()); - - } catch (APIException | IOException e1) { trans.error().log(e1); @@ -314,17 +314,15 @@ import org.onap.aaf.misc.env.util.Chrono; } } - public int notify(AuthzTrans trans, NotifyBody nb) { + private int notify(AuthzTrans trans, NotifyBody nb) { List toList = new ArrayList<>(); List ccList = new ArrayList<>(); String run = nb.type()+nb.name(); String test = dryRun?run:null; - String last = null; ONE_EMAIL: for(String id : nb.users()) { - last = id; toList.clear(); ccList.clear(); try { @@ -380,11 +378,6 @@ import org.onap.aaf.misc.env.util.Chrono; trans.error().log(e); } } - if(nb.count()<=1) { - trans.info().printf("Notified %s for %s",last,run); - } else { - trans.info().printf("Emailed %d for %s",nb.count(),run); - } return nb.count(); }