From 07fb3ece74a9aa1fad8e2a9fab73b4de3e36853b Mon Sep 17 00:00:00 2001 From: Instrumental Date: Mon, 16 Sep 2019 09:22:24 -0500 Subject: Improved multi Proxy DNSLocator based Issue-ID: AAF-961 Change-Id: I21d4a8013ca6f65306e32c5a2e2fa4ba230df2b7 Signed-off-by: Instrumental --- cadi/core/src/main/java/org/onap/aaf/cadi/User.java | 2 +- cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'cadi/core/src/main') diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/User.java b/cadi/core/src/main/java/org/onap/aaf/cadi/User.java index 4848e504..cb3b4e8f 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/User.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/User.java @@ -40,7 +40,7 @@ public final class User { public String name; private byte[] cred; public Principal principal; - Map perms ; + Map perms; long permExpires; private final long interval; int count; diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java b/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java index fbaa4a5a..2c9bb8c4 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/util/CSV.java @@ -45,17 +45,20 @@ public class CSV { private Access access; private boolean processAll; private char delimiter = ','; + private boolean go; public CSV(Access access, File file) { this.access = access; csv = file; processAll = false; + go = true; } public CSV(Access access, String csvFilename) { this.access = access; csv = new File(csvFilename); processAll = false; + go = true; } public CSV setDelimiter(char delimiter) { @@ -88,7 +91,7 @@ public class CSV { try { String line; StringBuilder sb = new StringBuilder(); - while((line = br.readLine())!=null) { + while(go && (line = br.readLine())!=null) { line=line.trim(); if(!line.startsWith("#") && line.length()>0) { // System.out.println(line); uncomment to debug @@ -268,6 +271,13 @@ public class CSV { return csv.getAbsolutePath(); } } + + /** + * Provides a way to stop processing records from inside a Visit + */ + public void stop() { + go = false; + } public void delete() { csv.delete(); -- cgit 1.2.3-korg