Batch work and client
[aaf/authz.git] / auth / auth-batch / src / main / java / org / onap / aaf / auth / batch / reports / NotInOrg.java
index ab8b6e8..9cd0bae 100644 (file)
@@ -32,7 +32,6 @@ import org.onap.aaf.auth.batch.Batch;
 import org.onap.aaf.auth.batch.helpers.Cred;
 import org.onap.aaf.auth.batch.helpers.Cred.Instance;
 import org.onap.aaf.auth.batch.helpers.UserRole;
-import org.onap.aaf.auth.batch.helpers.Visitor;
 import org.onap.aaf.auth.env.AuthzTrans;
 import org.onap.aaf.auth.org.Organization;
 import org.onap.aaf.auth.org.Organization.Identity;
@@ -79,7 +78,7 @@ public class NotInOrg extends Batch {
             now = new Date();
             String sdate = Chrono.dateOnlyStamp(now);
                File file = new File(logDir(),NOT_IN_ORG + sdate +CSV);
-            CSV csv = new CSV(file);
+            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);
@@ -87,7 +86,7 @@ public class NotInOrg extends Batch {
             // 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);
+            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,7 +107,7 @@ public class NotInOrg extends Batch {
                        UserRole.load(trans, session, UserRole.v2_0_11, ur -> {
                                try {
                                        if(!check(transNoAvg, checked, ur.user())) {
-                                               ur.row(whichWriter(transNoAvg,ur.user()));
+                                               ur.row(whichWriter(transNoAvg,ur.user()),UserRole.UR);
                                        }
                                } catch (OrganizationException e) {
                                        trans.error().log(e, "Error Decrypting X509");