X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fauthentication%2FApiPerms.java;h=b082102a6114d3490ccfb7b429be1b8c43a113e1;hb=c52d9c91d54f7e8b0500cebba00255b3e6b08c13;hp=f3b9ebc10f1d6e53d0ed5fa6a30193c2b83fb3eb;hpb=3d4f33e1581d63eede5ff3ebdd53f921f61cd5b6;p=dmaap%2Fdbcapi.git diff --git a/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java b/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java index f3b9ebc..b082102 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java +++ b/src/main/java/org/onap/dmaap/dbcapi/authentication/ApiPerms.java @@ -3,6 +3,8 @@ * org.onap.dmaap * ================================================================================ * Copyright (C) 2017 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. @@ -24,6 +26,7 @@ import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import org.onap.dmaap.dbcapi.aaf.AafService; +import org.onap.dmaap.dbcapi.aaf.AafServiceFactory; import org.onap.dmaap.dbcapi.aaf.DmaapGrant; import org.onap.dmaap.dbcapi.aaf.DmaapPerm; import org.onap.dmaap.dbcapi.aaf.AafService.ServiceType; @@ -86,12 +89,8 @@ public class ApiPerms extends BaseLoggingClass { DmaapConfig p = (DmaapConfig)DmaapConfig.getConfig(); String api = p.getProperty("ApiNamespace", "apiNamespace.not.set"); - - // this is needed because PE AAF may be a different instance than AAF used by MR - String peEnv = p.getProperty("PeAafEnvironment", "notSet"); - String url = p.getProperty( new String( "PeAafUrl." + peEnv ), "URL.not.set" ); - logger.info( "PeAafEnvironment=" + peEnv + " using URL " + url); - AafService aaf = new AafService(ServiceType.AAF_Admin, url ); + + AafService aaf = new AafServiceFactory().initAafService(ServiceType.AAF_Admin); for ( int i = 0; i < pmap.length ; i++ ) { String uri = new String( api + "." + pmap[i].getUri()); @@ -172,8 +171,8 @@ public class ApiPerms extends BaseLoggingClass { } public void setEnvMap() { - Dmaap dmaap = new DmaapService().getDmaap(); - String dmaapName = dmaap.getDmaapName(); + Dmaap dmaapVar = new DmaapService().getDmaap(); + String dmaapName = dmaapVar.getDmaapName(); PermissionMap.initMap( envMap, dmaapName ); }