summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src/main/java
diff options
context:
space:
mode:
authorJonathan Gathman <jonathan.gathman@att.com>2019-01-22 12:13:26 +0000
committerGerrit Code Review <gerrit@onap.org>2019-01-22 12:13:26 +0000
commit38eb0bfeeedc46e1d868e3cf1d06149e0fd130e5 (patch)
treea5a22ab4a2008c8ef5445e13530935b207f913fd /auth/auth-batch/src/main/java
parent623526dd133a522db9f3b2bde29c0d8f67de4f68 (diff)
parente2bf987acb6989ed928500e11c72804e0afd521d (diff)
Merge "Sonar Fix - Expiring.java"
Diffstat (limited to 'auth/auth-batch/src/main/java')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java
index d8eee6d5..7ed26ce5 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Expiring.java
@@ -3,6 +3,8 @@
* 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.
@@ -119,20 +121,17 @@ public class Expiring extends Batch {
Map<String, Set<UserRole>> owners = new TreeMap<String, Set<UserRole>>();
trans.info().log("Process UserRoles");
- UserRole.load(trans, session, UserRole.v2_0_11, new Visitor<UserRole>() {
- @Override
- public void visit(UserRole ur) {
- // Cannot just delete owners, unless there is at least one left. Process later
- if ("owner".equals(ur.rname())) {
- Set<UserRole> urs = owners.get(ur.role());
- if (urs == null) {
- urs = new HashSet<UserRole>();
- owners.put(ur.role(), urs);
- }
- urs.add(ur);
- } else {
- writeAnalysis(trans,ur);
+ UserRole.load(trans, session, UserRole.v2_0_11, ur -> {
+ // Cannot just delete owners, unless there is at least one left. Process later
+ if ("owner".equals(ur.rname())) {
+ Set<UserRole> urs = owners.get(ur.role());
+ if (urs == null) {
+ urs = new HashSet<UserRole>();
+ owners.put(ur.role(), urs);
}
+ urs.add(ur);
+ } else {
+ writeAnalysis(trans,ur);
}
});