summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-batch/src')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java2
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java12
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java2
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java31
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java2
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneMonthNotifyCredBody.java2
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneWeekNotifyCredBody.java2
7 files changed, 39 insertions, 14 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java
index d3209a02..b5d25a43 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/BatchDataView.java
@@ -20,7 +20,6 @@
*/
package org.onap.aaf.auth.batch.helpers;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -34,7 +33,6 @@ import org.onap.aaf.auth.dao.cass.UserRoleDAO.Data;
import org.onap.aaf.auth.env.AuthzTrans;
import org.onap.aaf.auth.layer.Result;
import org.onap.aaf.cadi.Hash;
-import org.onap.aaf.misc.env.APIException;
import org.onap.aaf.misc.env.TimeTaken;
import org.onap.aaf.misc.env.Trans;
import org.onap.aaf.misc.env.util.Chrono;
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java
index 83638cc7..6f23c515 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java
@@ -3,6 +3,7 @@
* org.onap.aaf
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 IBM.
* ===========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -203,9 +204,10 @@ public class Cred {
}
cred.instances.add(new Instance(type, timestamp, other, written/1000,tag));
- List<Cred> lscd = byNS.get(cred.ns);
+ List<Cred> lscd = byNS.get(cred.ns);
if (lscd==null) {
- byNS.put(cred.ns, (lscd=new ArrayList<>()));
+ lscd=new ArrayList<>();
+ byNS.put(cred.ns,lscd);
}
boolean found = false;
for (Cred c : lscd) {
@@ -271,11 +273,9 @@ public class Cred {
public void inc(int type, Date start, Date expires) {
for (int i=0;i<dates.length-1;++i) {
if (start.before(dates[i])) {
- if (type==CredDAO.CERT_SHA256_RSA) {
- if (start.after(dates[i+1])) {
+ if ((type==CredDAO.CERT_SHA256_RSA)&&(start.after(dates[i+1]))) {
++x509Added[i];
- }
- }
+ }
if (expires.after(dates[i])) {
switch(type) {
case CredDAO.RAW:
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java
index 3e7b30b2..38a76477 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Visitor.java
@@ -3,7 +3,6 @@
* org.onap.aaf
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 IBM.
* ===========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +20,6 @@
package org.onap.aaf.auth.batch.helpers;
-@FunctionalInterface
public interface Visitor<T> {
void visit(T t);
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java
index ea196b1f..b2fd8a9a 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/ApprovedRpt.java
@@ -3,7 +3,6 @@
* org.onap.aaf
* ===========================================================================
* Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 IBM.
* ===========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -64,6 +63,13 @@ public class ApprovedRpt extends Batch {
TimeTaken tt0 = trans.start("Cassandra Initialization", Env.SUB);
try {
+// TimeTaken tt = trans.start("Connect to Cluster", Env.REMOTE);
+// try {
+// session = cluster.connect();
+// } finally {
+// tt.done();
+// }
+
now = new Date();
String sdate = Chrono.dateOnlyStamp(now);
File file = new File(logDir(),APPR_RPT + sdate +CSV);
@@ -84,6 +90,29 @@ public class ApprovedRpt extends Batch {
Map<String,Boolean> checked = new TreeMap<String, Boolean>();
final AuthzTrans transNoAvg = trans.env().newTransNoAvg();
+// ResultSet results;
+// Statement stmt = new SimpleStatement( "select dateof(id), approver, status, user, type, memo from authz.approved;" );
+// results = session.execute(stmt);
+// Iterator<Row> iter = results.iterator();
+// Row row;
+ /*
+ * while (iter.hasNext()) {
+ ++totalLoaded;
+ row = iter.next();
+ d = row.getTimestamp(0);
+ if(d.after(begin)) {
+ approvedW.row("aprvd",
+ Chrono.dateOnlyStamp(d),
+ row.getString(1),
+ row.getString(2),
+ row.getString(3),
+ row.getString(4),
+ row.getString(5)
+ );
+ }
+ }
+
+ */
int totalLoaded = 0;
Date d;
GregorianCalendar gc = new GregorianCalendar();
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java
index 8eaf6a86..7001c024 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/NotifyCredBody.java
@@ -22,7 +22,7 @@
*/
package org.onap.aaf.auth.batch.reports.bodies;
-
+import java.io.IOException;
import java.util.GregorianCalendar;
import java.util.List;
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneMonthNotifyCredBody.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneMonthNotifyCredBody.java
index 417d4be4..8747ebf8 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneMonthNotifyCredBody.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneMonthNotifyCredBody.java
@@ -26,7 +26,7 @@ import org.onap.aaf.auth.batch.helpers.ExpireRange;
import org.onap.aaf.cadi.Access;
public class OneMonthNotifyCredBody extends NotifyCredBody {
- public OneMonthNotifyCredBody(Access access){
+ public OneMonthNotifyCredBody(Access access) throws IOException {
super(access, ExpireRange.ONE_MONTH);
}
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneWeekNotifyCredBody.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneWeekNotifyCredBody.java
index dae48d85..a1277d55 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneWeekNotifyCredBody.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/bodies/OneWeekNotifyCredBody.java
@@ -26,7 +26,7 @@ import org.onap.aaf.auth.batch.helpers.ExpireRange;
import org.onap.aaf.cadi.Access;
public class OneWeekNotifyCredBody extends NotifyCredBody {
- public OneWeekNotifyCredBody(Access access){
+ public OneWeekNotifyCredBody(Access access) throws IOException {
super(access, ExpireRange.ONE_WEEK);
}