AafServiceFactory implementation
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / authentication / ApiPerms.java
index bcadf40..b082102 100644 (file)
@@ -26,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;
@@ -88,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());