X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Freports%2FExpiringNext.java;h=d34f924870841fa67e75bd73121b60a1f257c4d0;hb=refs%2Fchanges%2F87%2F65287%2F1;hp=886bd56ac377b5c83f3d9659c579120d2002d756;hpb=ead32f193586e39b59bb366bddf70e665173a52d;p=aaf%2Fauthz.git diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java index 886bd56a..d34f9248 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java @@ -76,20 +76,20 @@ public class ExpiringNext extends Batch { List expiring = new ArrayList<>(); trans.info().log("Checking for Expired UserRoles"); - for(UserRole ur : UserRole.getData()) { - if(ur.expires().after(now)) { - if(ur.expires().before(twoWeeks)) { + for (UserRole ur : UserRole.getData()) { + if (ur.expires().after(now)) { + if (ur.expires().before(twoWeeks)) { expiring.add(Chrono.dateOnlyStamp(ur.expires()) + ":\t" + ur.user() + '\t' + ur.role()); } - if(ur.expires().before(earliestUR)) { + if (ur.expires().before(earliestUR)) { earliestUR = ur.expires(); } } } - if(expiring.size()>0) { + if (expiring.size()>0) { Collections.sort(expiring,Collections.reverseOrder()); - for(String s : expiring) { + for (String s : expiring) { System.err.print('\t'); System.err.println(s); } @@ -101,30 +101,30 @@ public class ExpiringNext extends Batch { expiring.clear(); trans.info().log("Checking for Expired Credentials"); - for( Cred creds : Cred.data.values()) { + for ( Cred creds : Cred.data.values()) { Instance lastInstance=null; - for(Instance inst : creds.instances) { - if(inst.type==CredDAO.BASIC_AUTH || inst.type==CredDAO.BASIC_AUTH_SHA256) { - if(lastInstance == null || inst.expires.after(lastInstance.expires)) { + for (Instance inst : creds.instances) { + if (inst.type==CredDAO.BASIC_AUTH || inst.type==CredDAO.BASIC_AUTH_SHA256) { + if (lastInstance == null || inst.expires.after(lastInstance.expires)) { lastInstance = inst; } } } - if(lastInstance!=null) { - if(lastInstance.expires.after(now)) { - if(lastInstance.expires.before(twoWeeks)) { + if (lastInstance!=null) { + if (lastInstance.expires.after(now)) { + if (lastInstance.expires.before(twoWeeks)) { expiring.add(Chrono.dateOnlyStamp(lastInstance.expires) + ": \t" + creds.id); } } - if(lastInstance.expires.before(earliestCred)) { + if (lastInstance.expires.before(earliestCred)) { earliestCred = lastInstance.expires; } } } - if(expiring.size()>0) { + if (expiring.size()>0) { Collections.sort(expiring,Collections.reverseOrder()); - for(String s : expiring) { + for (String s : expiring) { System.err.print('\t'); System.err.println(s); }