X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fhelpers%2FRole.java;h=ea735d2a678e9325b97cefaaee2b87d004710ba9;hb=59ffb7d529245c3bd0233dbf6cb0ae9fe9ccb856;hp=4b4a255188c8774feced2d12ed1fe7753153aceb;hpb=343481da5dac494c0b063f0b5b0ddb865fa1f214;p=aaf%2Fauthz.git 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 4b4a2551..ea735d2a 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 @@ -3,6 +3,8 @@ * org.onap.aaf * =========================================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2018 IBM. * =========================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +30,7 @@ import java.util.List; import java.util.Set; import java.util.TreeMap; +import org.onap.aaf.auth.dao.cass.RoleDAO; import org.onap.aaf.misc.env.Env; import org.onap.aaf.misc.env.TimeTaken; import org.onap.aaf.misc.env.Trans; @@ -44,35 +47,39 @@ public class Role implements Comparable { public static final TreeMap byName = new TreeMap<>(); private static List deleteRoles = new ArrayList<>(); - public final String ns, name, description; - private String full, encode; - public final Set perms; + public RoleDAO.Data rdd; + private String full; + private String encode; public Role(String full) { - ns = name = description = ""; + rdd = new RoleDAO.Data(); + rdd.ns = ""; + rdd.name = ""; + rdd.description = ""; + rdd.perms = new HashSet<>(); this.full = full; - perms = new HashSet<>(); } public Role(String ns, String name, String description,Set perms) { - this.ns = ns; - this.name = name; - this.description = description; + rdd = new RoleDAO.Data(); + rdd.ns = ns; + rdd.name = name; + rdd.description = description; + rdd.perms = perms; this.full = null; this.encode = null; - this.perms = perms; } public String encode() { if (encode==null) { - encode = ns + '|' + name; + encode = rdd.ns + '|' + rdd.name; } return encode; } public String fullName() { if (full==null) { - full = ns + '.' + name; + full = rdd.ns + '.' + rdd.name; } return full; } @@ -106,7 +113,7 @@ public class Role implements Comparable { row = iter.next(); Role rk =new Role(row.getString(0),row.getString(1), row.getString(2),row.getSet(3,String.class)); keys.put(rk.encode(), rk); - data.put(rk,rk.perms); + data.put(rk,rk.rdd.perms); byName.put(rk.fullName(), rk); } } finally {