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%2FNotInOrg.java;h=f47fae43e1f54a2572639f1c2d735565a96773c7;hb=59ffb7d529245c3bd0233dbf6cb0ae9fe9ccb856;hp=2ba5d0221eb9854cba6b65ee453f8a7eec5f4f56;hpb=1321c6e63c90a40fad36d2a4a3fef912b4169130;p=aaf%2Fauthz.git diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java index 2ba5d022..f47fae43 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java @@ -52,7 +52,6 @@ public class NotInOrg extends Batch { private static final String INFO = "info"; private Map writerList; private Map whichWriter; - private File logDir; private Date now; private Writer notInOrgW; private Writer notInOrgDeleteW; @@ -76,21 +75,19 @@ public class NotInOrg extends Batch { // Create Intermediate Output writerList = new HashMap<>(); whichWriter = new TreeMap<>(); - logDir = new File(logDir()); - logDir.mkdirs(); now = new Date(); String sdate = Chrono.dateOnlyStamp(now); - File file = new File(logDir,NOT_IN_ORG + sdate +CSV); - CSV csv = new CSV(file); + File file = new File(logDir(),NOT_IN_ORG + sdate +CSV); + CSV csv = new CSV(env.access(),file); notInOrgW = csv.writer(false); notInOrgW.row(INFO,NOT_IN_ORG,Chrono.dateOnlyStamp(now),0); writerList.put(NOT_IN_ORG,notInOrgW); // These will have been double-checked by the Organization, and can be deleted immediately. String fn = NOT_IN_ORG+"Delete"; - file = new File(logDir,fn + sdate +CSV); - CSV csvDelete = new CSV(file); + file = new File(logDir(),fn + sdate +CSV); + CSV csvDelete = new CSV(env.access(),file); notInOrgDeleteW = csvDelete.writer(false); notInOrgDeleteW.row(INFO,fn,Chrono.dateOnlyStamp(now),0); writerList.put(NOT_IN_ORG,notInOrgW); @@ -108,16 +105,13 @@ public class NotInOrg extends Batch { trans.info().log("User Roles"); final AuthzTrans transNoAvg = trans.env().newTransNoAvg(); - UserRole.load(trans, session, UserRole.v2_0_11, new Visitor() { - @Override - public void visit(UserRole ur) { - try { - if(!check(transNoAvg, checked, ur.user())) { - ur.row(whichWriter(transNoAvg,ur.user())); - } - } catch (OrganizationException e) { - trans.error().log(e, "Error Decrypting X509"); + UserRole.load(trans, session, UserRole.v2_0_11, ur -> { + try { + if(!check(transNoAvg, checked, ur.user())) { + ur.row(whichWriter(transNoAvg,ur.user())); } + } catch (OrganizationException e) { + trans.error().log(e, "Error Decrypting X509"); } });