aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-02-08 09:30:02 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-02-08 12:38:37 +0000
commit2d2e0b503f915a81ae9a02dfa3afac3de369efde (patch)
treeb05555ebaca90f1d620f4562067bf486731ee48c /openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib
parent89f96b17aed5c432be3df6d75a49a1f9ebc9120b (diff)
Onboarding foundation changes
1. Adding OnboardingSessionContextFilter which sets tenant(kespace) for onboarding application 2. Different services can extend SessionContextFilter to set their own keyspace 3. These changes in onboarding are done to support services like ActivitySpec Change-Id: Ia62557354ab05235d027250af94a2835d741b7fa Issue-ID: SDC-1005 Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib')
-rw-r--r--openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java
index 623f958ceb..494428f7a0 100644
--- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java
+++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenUtil.java
@@ -12,21 +12,35 @@ import org.openecomp.types.ElementPropertyName;
public class ZusammenUtil {
+ private ZusammenUtil() {
+ throw new IllegalStateException("Utility class");
+ }
+
public static SessionContext createSessionContext() {
org.openecomp.sdc.common.session.SessionContext asdcSessionContext =
SessionContextProviderFactory.getInstance().createInterface().get();
+ return createSessionContext(asdcSessionContext.getUser().getUserId(), asdcSessionContext
+ .getTenant());
+ }
+
+ private static SessionContext createSessionContext(String user, String tenant) {
SessionContext sessionContext = new SessionContext();
- sessionContext.setUser(new UserInfo(asdcSessionContext.getUser().getUserId()));
- sessionContext.setTenant(asdcSessionContext.getTenant());
+ sessionContext.setUser(new UserInfo(user));
+ sessionContext.setTenant(tenant);
return sessionContext;
}
public static ZusammenElement buildStructuralElement(ElementType elementType, Action action) {
+ return buildStructuralElement(elementType.name(), action);
+ }
+
+
+ public static ZusammenElement buildStructuralElement(String elementType, Action action) {
ZusammenElement element = buildElement(null, action);
Info info = new Info();
- info.setName(elementType.name());
- info.addProperty(ElementPropertyName.elementType.name(), elementType.name());
+ info.setName(elementType);
+ info.addProperty(ElementPropertyName.elementType.name(), elementType);
element.setInfo(info);
return element;
}