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=18c8ed6ae724cc3fec499bc04b2222dd5cd4f217;hb=deb396a3d53a84b2eb5a46d40122b4902d72c601;hp=54cb7378685dc2919852810de368f8b6fbd4628c;hpb=2e49787dbbb3093c52babb3ec8a0ab4827d649ce;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 54cb7378..18c8ed6a 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 @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ import org.onap.aaf.auth.org.OrganizationException; import org.onap.aaf.cadi.Access; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.PropAccess; -import org.onap.aaf.cadi.client.Holder; +import org.onap.aaf.cadi.util.Holder; import org.onap.aaf.cadi.util.CSV; import org.onap.aaf.misc.env.APIException; import org.onap.aaf.misc.env.TimeTaken; @@ -134,7 +134,7 @@ import org.onap.aaf.misc.env.util.Chrono; } urgent = false; - + sb.setLength(0); fhh = new File(footer_html); if(!fhh.exists()) { @@ -153,14 +153,14 @@ import org.onap.aaf.misc.env.util.Chrono; } noAvg = trans.env().newTransNoAvg(); - cqlBatch = new CQLBatch(noAvg.debug(),session); + cqlBatch = new CQLBatch(noAvg.debug(),session); cbl = new CQLBatchLoop(cqlBatch,50,dryRun); - + lastN = new LastNotified(session); } /* - * Note: We try to put things related to Notify as Main Class in Run, where we might have put in + * Note: We try to put things related to Notify as Main Class in Run, where we might have put in * Constructor, so that we can have other Classes call just the "notify" method. */ @Override @@ -175,7 +175,7 @@ import org.onap.aaf.misc.env.util.Chrono; NotifyBody.load(env.access()); - // Create Intermediate Output + // Create Intermediate Output File logDir = logDir(); Set notifyFile = new HashSet<>(); if(args().length>0) { @@ -219,14 +219,14 @@ import org.onap.aaf.misc.env.util.Chrono; e.printStackTrace(); } - } + } // now create Notification for(NotifyBody nb : NotifyBody.getAll()) { int count = notify(noAvg, nb); trans.info().printf("Emailed %d for %s",count,nb.name()); } - + // // Do Pending Approval Notifies. We do this separately, because we are consolidating // all the new entries, etc. @@ -238,7 +238,7 @@ import org.onap.aaf.misc.env.util.Chrono; csvList.add(new CSV(access,f)); } } - + Map mpending = new TreeMap<>(); Holder count = new Holder<>(0); for(CSV approveCSV : csvList) { @@ -261,7 +261,7 @@ import org.onap.aaf.misc.env.util.Chrono; count.set(count.get()+1); } catch (ParseException e) { trans.error().log(e); - } + } break; } }); @@ -272,23 +272,23 @@ import org.onap.aaf.misc.env.util.Chrono; } } trans.info().printf("Read %d Reminder Rows", count.get()); - + NotifyPendingApprBody npab = new NotifyPendingApprBody(access); GregorianCalendar gc = new GregorianCalendar(); gc.add(GregorianCalendar.DAY_OF_MONTH, 7); // Get from INFO? Date oneWeek = gc.getTime(); CSV.Saver rs = new CSV.Saver(); - + TimeTaken tt = trans.start("Obtain Last Notifications for Approvers", Trans.SUB); try { lastN.add(mpending.keySet()); } finally { tt.done(); } - + Pending p; - + tt = trans.start("Notify for Pending", Trans.SUB); List idList = new ArrayList<>(); String id; @@ -336,7 +336,7 @@ import org.onap.aaf.misc.env.util.Chrono; String run = nb.type()+nb.name(); String test = dryRun?run:null; - + ONE_EMAIL: for(String id : nb.users()) { toList.clear();