diff options
Diffstat (limited to 'auth/auth-cass/src')
6 files changed, 15 insertions, 17 deletions
diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedPermDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedPermDAO.java index 7ea7dd75..28b8c4b4 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedPermDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedPermDAO.java @@ -40,6 +40,7 @@ public class CachedPermDAO extends CachedDAO<AuthzTrans,PermDAO, PermDAO.Data> { public Result<List<Data>> readNS(AuthzTrans trans, final String ns) { DAOGetter getter = new DAOGetter(trans,dao()) { + @Override public Result<List<Data>> call() { return dao.readNS(trans, ns); } @@ -51,14 +52,7 @@ public class CachedPermDAO extends CachedDAO<AuthzTrans,PermDAO, PermDAO.Data> { } else { } -// if (getter.result==null) { -// if (lurd==null) { - return Result.err(Status.ERR_PermissionNotFound,"No Permission found - " + lurd.details); -// } else { -// return Result.ok(lurd); -// } -// } -// return getter.result; + return Result.err(Status.ERR_PermissionNotFound,"No Permission found - " + lurd.details); } public Result<List<Data>> readChildren(AuthzTrans trans, final String ns, final String type) { @@ -74,6 +68,7 @@ public class CachedPermDAO extends CachedDAO<AuthzTrans,PermDAO, PermDAO.Data> { */ public Result<List<Data>> readByType(AuthzTrans trans, final String ns, final String type) { DAOGetter getter = new DAOGetter(trans,dao()) { + @Override public Result<List<Data>> call() { return dao.readByType(trans, ns, type); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedRoleDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedRoleDAO.java index b90c3579..0c1fa4cc 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedRoleDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedRoleDAO.java @@ -39,6 +39,7 @@ public class CachedRoleDAO extends CachedDAO<AuthzTrans,RoleDAO, RoleDAO.Data> { public Result<List<Data>> readNS(AuthzTrans trans, final String ns) { DAOGetter getter = new DAOGetter(trans,dao()) { + @Override public Result<List<Data>> call() { return dao.readNS(trans, ns); } @@ -53,6 +54,7 @@ public class CachedRoleDAO extends CachedDAO<AuthzTrans,RoleDAO, RoleDAO.Data> { public Result<List<Data>> readName(AuthzTrans trans, final String name) { DAOGetter getter = new DAOGetter(trans,dao()) { + @Override public Result<List<Data>> call() { return dao().readName(trans, name); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java index c994dd53..6dd0fdd2 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java @@ -117,7 +117,6 @@ public class HistoryDAO extends CassDAOImpl<AuthzTrans, HistoryDAO.Data> { obj[++idx]=data.target; obj[++idx]=data.subject; obj[++idx]=data.memo; -// obj[++idx]=data.detail; obj[++idx]=data.reconstruct; } }; @@ -139,9 +138,8 @@ public class HistoryDAO extends CassDAOImpl<AuthzTrans, HistoryDAO.Data> { } },writeConsistency) ); -// disable(CRUD.Create); - replace(CRUD.read, new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + + replace(CRUD.read, new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM history WHERE id = ?", defLoader,readConsistency) // new HistLoader(2) { // @Override @@ -227,7 +225,7 @@ public class HistoryDAO extends CassDAOImpl<AuthzTrans, HistoryDAO.Data> { private class YYYYMM implements Accept<Data> { private int[] yyyymm; - public YYYYMM(int yyyymm[]) { + public YYYYMM(int[] yyyymm) { this.yyyymm = yyyymm; } @Override diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java index a84490d0..bda7ef0f 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.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. @@ -100,7 +101,7 @@ public class OAuthTokenDAO extends CassDAOImpl<AuthzTrans,OAuthTokenDAO.Data> { } public String toString() { - return user.toString() + ' ' + id.toString() + ' ' + Chrono.dateTime(expires) + (active?"":"in") + "active"; + return user + ' ' + id + ' ' + Chrono.dateTime(expires) + (active?"":"in") + "active"; } } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java index e1ac77c2..0d5c487d 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java @@ -297,7 +297,8 @@ public class Function { } // VALIDATIONS done... Add NS - if ((rq = q.nsDAO().create(trans, namespace.data())).notOK()) { + rq = q.nsDAO().create(trans, namespace.data()); + if (rq.notOK()) { return Result.err(rq); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLur.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLur.java index 2ccbd236..b25e2054 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLur.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLur.java @@ -47,8 +47,7 @@ public class DirectAAFLur implements Lur { public DirectAAFLur(AuthzEnv env, Question question/*, TokenMgr tm*/) { this.env = env; - this.question = question; -// oauth = new OAuth2Lur(null); + this.question = question } @Override @@ -148,7 +147,9 @@ public class DirectAAFLur implements Lur { return true; } else{ String[] lp = p.getKey().split("\\|"); - if (lp.length<3)return false; + if (lp.length<3) { + return false; + } if (data.fullType().equals(lp[0])) if (data.instance!=null && (data.instance.equals(lp[1]) || "*".equals(data.instance))) if (data.action!=null && (data.action.equals(lp[2]) || "*".equals(data.action))) |