X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fhelpers%2FRole.java;h=3f750fb80bf9e1737a8b7114a96887d1d6fdac84;hp=e69ef51d91cd9f643fff1d2e0370a809608c43ca;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9 diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java index e69ef51d..3f750fb8 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Role.java @@ -9,9 +9,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -50,7 +50,7 @@ public class Role implements Comparable { public RoleDAO.Data rdd; private String full; private String encode; - + public Role(String full) { rdd = new RoleDAO.Data(); rdd.ns = ""; @@ -59,7 +59,7 @@ public class Role implements Comparable { rdd.perms = new HashSet<>(); this.full = full; } - + public Role(String ns, String name, String description,Set perms) { rdd = new RoleDAO.Data(); rdd.ns = ns; @@ -69,18 +69,18 @@ public class Role implements Comparable { this.full = null; this.encode = null; } - + public String encode() { if (encode==null) { encode = rdd.ns + '|' + rdd.name; - } + } return encode; } public String fullName() { if (full==null) { full = rdd.ns + '.' + rdd.name; - } + } return full; } @@ -95,7 +95,7 @@ public class Role implements Comparable { private static void load(Trans trans, Session session, String query) { trans.info().log( "query: " + query ); TimeTaken tt = trans.start("Read Roles", Env.REMOTE); - + ResultSet results; try { Statement stmt = new SimpleStatement( query ); @@ -123,7 +123,7 @@ public class Role implements Comparable { trans.info().log("Found",data.size(),"roles"); } } - + public static long count(Trans trans, Session session) { String query = "select count(*) from authz.role LIMIT 1000000;"; trans.info().log( "query: " + query ); @@ -166,11 +166,11 @@ public class Role implements Comparable { public static String fullName(String role) { return role.replace('|', '.'); } - + public static void stageRemove(Role r) { deleteRoles.add(r); } - + public static void executeRemove() { for (Role p : deleteRoles) { keys.remove(p.encode);