X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Forg%2FOrganizationFactory.java;h=d704e1a8468ddbf1cf6051e471a146f17d62f921;hb=628b7105ce4d9818aac69a082e515f9275fd46fd;hp=332018640f58fa9fffc4f0549d9640a6e472b3d7;hpb=1321c6e63c90a40fad36d2a4a3fef912b4169130;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java index 33201864..d704e1a8 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java @@ -28,6 +28,7 @@ import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import org.onap.aaf.auth.env.AuthzTrans; +import org.onap.aaf.cadi.config.Config; import org.onap.aaf.cadi.util.FQI; import org.onap.aaf.cadi.util.Split; import org.onap.aaf.misc.env.Env; @@ -62,6 +63,17 @@ public class OrganizationFactory { } } } + if(firstOrg==null) { // attempt to load DefaultOrg + try { + Class cls = Class.forName("org.onap.aaf.org.DefaultOrg"); + @SuppressWarnings("unchecked") + Constructor cnst = (Constructor)cls.getConstructor(Env.class,String.class); + String realm = env.getProperty(Config.AAF_DEFAULT_REALM,"people.osaaf.org"); + defaultOrg = cnst.newInstance(env,realm); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException e) { + env.warn().log("Not Organization Moduled linked in",e); + } + } if (defaultOrg == null) { defaultOrg = firstOrg; } @@ -80,7 +92,7 @@ public class OrganizationFactory { String orgClass = env.getProperty(ORGANIZATION_DOT+orgNS); if (orgClass == null) { - env.warn().log("There is no Organization." + orgNS + " property"); + env.warn().printf("There is no Organization.%s property",orgNS); } else { try { Class orgCls = Class.forName(orgClass);