summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src/main
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-02-07 11:09:32 -0600
committerInstrumental <jonathan.gathman@att.com>2019-02-07 11:12:23 -0600
commite2fa0e67712b92c69f6863afe10c1c973a068e3e (patch)
tree57a477bc5edd1e228c4c3197c5b90542a92edf9d /auth/auth-core/src/main
parente43bc462af00e9c05384313514b279e11372fd79 (diff)
Add Batch in Config image
Change Images to run as aaf Issue-ID: AAF-740 Change-Id: If5b8583dc19ac4095ba9b25715e9330d2a0ed5fc Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-core/src/main')
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java12
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java8
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java2
3 files changed, 18 insertions, 4 deletions
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..40c8c2d3 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<Organization> cnst = (Constructor<Organization>)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) {
+ throw new OrganizationException("At least one Organization must be defined",e);
+ }
+ }
if (defaultOrg == null) {
defaultOrg = firstOrg;
}
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java
index 8f0eb8aa..1bc367e6 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/AbsServiceStarter.java
@@ -41,13 +41,15 @@ public abstract class AbsServiceStarter<ENV extends RosettaEnv, TRANS extends Tr
protected AbsService<ENV,TRANS> service;
- public AbsServiceStarter(final AbsService<ENV,TRANS> service) {
+ public AbsServiceStarter(final AbsService<ENV,TRANS> service, boolean noexit) {
this.service = service;
try {
OrganizationFactory.init(service.env);
} catch (OrganizationException e) {
- service.access.log(e, "Missing defined Organzation Plugins");
- System.exit(3);
+ service.access.log(e, "Missing defined Organization Plugins");
+ if(!noexit) {
+ System.exit(3);
+ }
}
// do_register - this is used for specialty Debug Situations. Developer can create an Instance for a remote system
// for Debugging purposes without fear that real clients will start to call your debug instance
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java
index 413b7919..98503d11 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java
@@ -59,7 +59,7 @@ public class JettyServiceStarter<ENV extends RosettaEnv, TRANS extends Trans> ex
private boolean secure;
public JettyServiceStarter(final AbsService<ENV,TRANS> service) throws OrganizationException {
- super(service);
+ super(service,false);
secure = true;
}