summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-os/src/main/java
diff options
context:
space:
mode:
authorTATTAVARADA <statta@research.att.com>2017-04-27 07:53:18 -0400
committerst782s <statta@research.att.com>2017-04-27 08:31:27 -0400
commit6beb446925c967aca92f5513adf36c5db77c00d6 (patch)
tree9392057ed0739de2445c5b2a2a8bee6dcdacbcf7 /ecomp-sdk/epsdk-app-os/src/main/java
parent246b225194e3e8dc1926294de591a94fd9787fa7 (diff)
[PORTAL-7] Rebase
This rebasing includes common libraries and common overlays projects abstraction of components Change-Id: Ia1efa4deacdc5701e6205104ac021a6c80ed60ba Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-os/src/main/java')
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java161
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java47
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java57
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/FusionLicenseManagerImpl.java69
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/LicenseableClassImpl.java62
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java70
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java71
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java92
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java64
9 files changed, 693 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java
new file mode 100644
index 00000000..9745f968
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java
@@ -0,0 +1,161 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.conf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openecomp.portalapp.login.LoginStrategyImpl;
+import org.openecomp.portalapp.scheduler.RegistryAdapter;
+import org.openecomp.portalsdk.core.auth.LoginStrategy;
+import org.openecomp.portalsdk.core.conf.AppConfig;
+import org.openecomp.portalsdk.core.conf.Configurable;
+import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
+import org.openecomp.portalsdk.core.service.DataAccessService;
+import org.openecomp.portalsdk.core.util.CacheManager;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.Profile;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.web.servlet.ViewResolver;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+
+/**
+ * ECOMP Portal SDK sample application. ECOMP Portal SDK core AppConfig class to
+ * reuse interceptors, view resolvers and other features defined there.
+ */
+@Configuration
+@EnableWebMvc
+@ComponentScan(basePackages = "org.openecomp")
+@PropertySource(value = { "${container.classpath:}/WEB-INF/conf/app/test.properties" }, ignoreResourceNotFound = true)
+@Profile("src")
+@EnableAsync
+@EnableScheduling
+public class ExternalAppConfig extends AppConfig implements Configurable {
+
+ private RegistryAdapter schedulerRegistryAdapter;
+
+ @Configuration
+ @Import(SystemProperties.class)
+ static class InnerConfiguration {
+ }
+
+ /**
+ * @see org.openecomp.portalsdk.core.conf.AppConfig#viewResolver()
+ */
+ public ViewResolver viewResolver() {
+ return super.viewResolver();
+ }
+
+ /**
+ * @see org.openecomp.portalsdk.core.conf.AppConfig#addResourceHandlers(ResourceHandlerRegistry)
+ *
+ * @param registry
+ */
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
+ super.addResourceHandlers(registry);
+ }
+
+ /**
+ * @see org.openecomp.portalsdk.core.conf.AppConfig#dataAccessService()
+ */
+ public DataAccessService dataAccessService() {
+ // Echo the JDBC URL to assist developers when starting the app.
+ System.out.println("ExternalAppConfig: " + SystemProperties.DB_CONNECTIONURL + " is "
+ + SystemProperties.getProperty(SystemProperties.DB_CONNECTIONURL));
+ return super.dataAccessService();
+ }
+
+ /**
+ * Creates a new list with a single entry that is the external app
+ * definitions.xml path.
+ *
+ * @return List of String, size 1
+ */
+ public List<String> addTileDefinitions() {
+ List<String> definitions = new ArrayList<String>();
+ definitions.add("/WEB-INF/defs/definitions.xml");
+ return definitions;
+ }
+
+ /**
+ * Adds request interceptors to the specified registry by calling
+ * {@link AppConfig#addInterceptors(InterceptorRegistry)}, but excludes
+ * certain paths from the session timeout interceptor.
+ */
+ @Override
+ public void addInterceptors(InterceptorRegistry registry) {
+ super.setExcludeUrlPathsForSessionTimeout("/login_external", "*/login_external.htm", "login", "/login.htm",
+ "/api*", "/single_signon.htm", "/single_signon");
+ super.addInterceptors(registry);
+ }
+
+ /**
+ * Creates and returns a new instance of a {@link CacheManager} class.
+ *
+ * @return New instance of {@link CacheManager}
+ */
+ @Bean
+ public AbstractCacheManager cacheManager() {
+ return new CacheManager();
+ }
+
+ /**
+ * Creates and returns a new instance of a {@link SchedulerFactoryBean} and
+ * populates it with triggers.
+ *
+ * @return New instance of {@link SchedulerFactoryBean}
+ * @throws Exception
+ */
+ // @Bean // ANNOTATION COMMENTED OUT
+ // APPLICATIONS REQUIRING QUARTZ SHOULD RESTORE ANNOTATION
+ public SchedulerFactoryBean schedulerFactoryBean() throws Exception {
+ SchedulerFactoryBean scheduler = new SchedulerFactoryBean();
+ scheduler.setTriggers(schedulerRegistryAdapter.getTriggers());
+ scheduler.setConfigLocation(appApplicationContext.getResource("WEB-INF/conf/quartz.properties"));
+ scheduler.setDataSource(dataSource());
+ return scheduler;
+ }
+
+ /**
+ * Sets the scheduler registry adapter.
+ *
+ * @param schedulerRegistryAdapter
+ */
+ @Autowired
+ public void setSchedulerRegistryAdapter(final RegistryAdapter schedulerRegistryAdapter) {
+ this.schedulerRegistryAdapter = schedulerRegistryAdapter;
+ }
+
+ @Bean
+ public LoginStrategy loginStrategy() {
+
+ return new LoginStrategyImpl();
+ }
+}
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java
new file mode 100644
index 00000000..6d7c72d1
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java
@@ -0,0 +1,47 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.conf;
+
+import org.openecomp.portalsdk.core.conf.AppInitializer;
+
+public class ExternalAppInitializer extends AppInitializer {
+
+ @Override
+ protected Class<?>[] getRootConfigClasses() {
+ return super.getRootConfigClasses();
+ }
+
+ @Override
+ protected Class<?>[] getServletConfigClasses() {
+ Class<?> appConfigClass = ExternalAppConfig.class;
+ // Show something on stdout to indicate the app is starting.
+ System.out.println("ExternalAppInitializer: servlet configuration class is " + appConfigClass.getName());
+ return new Class[] { appConfigClass };
+ }
+
+ /*
+ * URL request will direct to the Spring dispatcher for processing
+ */
+ @Override
+ protected String[] getServletMappings() {
+ return super.getServletMappings();
+ }
+
+}
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java
new file mode 100644
index 00000000..cf6ee2f0
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java
@@ -0,0 +1,57 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.conf;
+
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.stereotype.Component;
+
+import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable;
+
+@Component
+@Profile("src")
+public class HibernateMappingLocations implements HibernateMappingLocatable {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.openecomp.portalsdk.core.conf.HibernateMappingLocatable#
+ * getMappingLocations()
+ */
+ @Override
+ public Resource[] getMappingLocations() {
+ return new Resource[] { new ClassPathResource("../fusion/orm/Fusion.hbm.xml"),
+ new ClassPathResource("../fusion/orm/Workflow.hbm.xml"),
+ new ClassPathResource("../fusion/orm/RNoteBookIntegration.hbm.xml") };
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.openecomp.portalsdk.core.conf.HibernateMappingLocatable#
+ * getPackagesToScan()
+ */
+ @Override
+ public String[] getPackagesToScan() {
+ return new String[] { "org.openecomp" };
+ }
+
+}
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/FusionLicenseManagerImpl.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/FusionLicenseManagerImpl.java
new file mode 100644
index 00000000..4993a005
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/FusionLicenseManagerImpl.java
@@ -0,0 +1,69 @@
+package org.openecomp.portalapp.lm;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.openecomp.portalsdk.core.lm.FusionLicenseManager;
+import org.springframework.stereotype.Component;
+
+/*
+ * Please note that this class is not being used; its a dummy stub to have a qualifying bean for the interface.
+ */
+
+@Component
+public class FusionLicenseManagerImpl implements FusionLicenseManager {
+
+ @Override
+ public void initKeyStoreParam() {
+
+ }
+
+ @Override
+ public void initCipherParam() {
+
+ }
+
+ @Override
+ public void initLicenseParam() {
+
+ }
+
+ @Override
+ public void doInitWork() {
+
+ }
+
+ @Override
+ public int installLicense() {
+ return 0;
+ }
+
+ @Override
+ public synchronized int verifyLicense(ServletContext context) {
+ return 0;
+ }
+
+ @Override
+ public void generateLicense(Map<String, String> clientInfoMap, List<String> ipAddressList) throws Exception {
+
+ }
+
+ @Override
+ public String nvl(String s) {
+ return null;
+ }
+
+ @Override
+ public Date getExpiredDate() {
+ return null;
+ }
+
+ @Override
+ public void setExpiredDate(Date expiredDate) {
+
+ }
+
+}
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/LicenseableClassImpl.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/LicenseableClassImpl.java
new file mode 100644
index 00000000..91fe7870
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/lm/LicenseableClassImpl.java
@@ -0,0 +1,62 @@
+/*-
+ * ================================================================================
+ * eCOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.lm;
+
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+
+import org.openecomp.portalsdk.core.lm.LicenseableClass;
+
+/*
+ * Please note that this class is not being used; its a dummy stub to have a qualifying bean for the interface.
+ */
+
+public class LicenseableClassImpl implements LicenseableClass {
+
+ public String getApplicationName() {
+ return "";
+ }
+
+ public InputStream getPublicKeystoreAsInputStream() throws FileNotFoundException {
+ return null;
+ }
+
+ public String getAlias() {
+ return "";
+ }
+
+ public String getKeyPasswd() {
+ return "";
+ }
+
+ public String getPublicKeystorePassword() {
+ return "";
+ }
+
+ public String getCipherParamPassword() {
+ return "";
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Class getClassToLicense() {
+ return this.getClass();
+ }
+}
+
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
new file mode 100644
index 00000000..9f742ce9
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/login/LoginStrategyImpl.java
@@ -0,0 +1,70 @@
+package org.openecomp.portalapp.login;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.openecomp.portalsdk.core.auth.LoginStrategy;
+import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.springframework.web.servlet.ModelAndView;
+
+public class LoginStrategyImpl extends LoginStrategy {
+
+ @Override
+ public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ //'login' for opensource is same as 'external' login.
+ return doExternalLogin(request, response);
+ }
+
+ @Override
+ public String getUserId(HttpServletRequest request) throws PortalAPIException {
+ // Check ECOMP Portal cookie
+ if (!isLoginCookieExist(request))
+ return null;
+
+ String userid = null;
+ try {
+ userid = getUserIdFromCookie(request);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return userid;
+ }
+
+ private static String getUserIdFromCookie(HttpServletRequest request) throws Exception {
+ String userId = "";
+ Cookie[] cookies = request.getCookies();
+ Cookie userIdcookie = null;
+ if (cookies != null)
+ for (Cookie cookie : cookies)
+ if (cookie.getName().equals(USER_ID))
+ userIdcookie = cookie;
+ if(userIdcookie!=null){
+ userId = CipherUtil.decrypt(userIdcookie.getValue(),
+ PortalApiProperties.getProperty(PortalApiConstants.Decryption_Key));
+ }
+ return userId;
+
+ }
+
+ private static boolean isLoginCookieExist(HttpServletRequest request) {
+ Cookie ep = getCookie(request, EP_SERVICE);
+ return (ep != null);
+ }
+
+ private static Cookie getCookie(HttpServletRequest request, String cookieName) {
+ Cookie[] cookies = request.getCookies();
+ if (cookies != null)
+ for (Cookie cookie : cookies)
+ if (cookie.getName().equals(cookieName))
+ return cookie;
+
+ return null;
+ }
+
+
+}
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java
new file mode 100644
index 00000000..e5d30e5b
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java
@@ -0,0 +1,71 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.scheduler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.scheduler.Registerable;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.quartz.Trigger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.stereotype.Component;
+
+@Component
+@DependsOn({ "logRegistry", "systemProperties" })
+public class Register implements Registerable {
+
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Register.class);
+
+ private List<Trigger> scheduleTriggers = new ArrayList<Trigger>();
+ Trigger trigger[] = new Trigger[1];
+
+ @Autowired
+ private LogRegistry logRegistry;
+
+ @Override
+ public Trigger[] getTriggers() {
+ return getScheduleTriggers().toArray(trigger);
+ }
+
+ @Override
+ public void registerTriggers() {
+ // if the property value is not available; the cron will not be added
+ // and can be ignored. its safe to ignore the exceptions
+ try {
+ if (SystemProperties.getProperty(SystemProperties.LOG_CRON) != null)
+ getScheduleTriggers().add(logRegistry.getTrigger());
+ } catch (IllegalStateException ies) {
+ logger.info(EELFLoggerDelegate.debugLogger, ("Log Cron not available"));
+ }
+
+ }
+
+ public List<Trigger> getScheduleTriggers() {
+ return scheduleTriggers;
+ }
+
+ public void setScheduleTriggers(List<Trigger> scheduleTriggers) {
+ this.scheduleTriggers = scheduleTriggers;
+ }
+
+}
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java
new file mode 100644
index 00000000..b3f6cbeb
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java
@@ -0,0 +1,92 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.scheduler;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.openecomp.portalsdk.core.scheduler.Registerable;
+import org.openecomp.portalsdk.workflow.services.WorkflowScheduleService;
+import org.quartz.Trigger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RegistryAdapter {
+
+ @Autowired
+ private Registerable registry;
+
+ @Autowired
+ private WorkflowScheduleService workflowScheduleService;
+
+ private SchedulerFactoryBean schedulerBean;
+
+ Trigger trigger[] = new Trigger[1];
+
+ public Trigger[] getTriggers() {
+
+ registry.registerTriggers();
+
+ List<Trigger> allTriggers = new ArrayList<Trigger>();
+
+ List<Trigger> coreTriggers = addCoreTriggers();
+ final Trigger[] extTriggerArray = registry.getTriggers();
+
+ allTriggers.addAll(Arrays.asList(extTriggerArray));
+ allTriggers.addAll(coreTriggers);
+
+ return allTriggers.toArray(trigger);
+ }
+
+ public List<Trigger> addCoreTriggers() {
+ // On startup of the application after crash recovery, invoke workflow
+ // schedule trigger
+ List<Trigger> triggers = getWorkflowScheduleService().triggerWorkflowScheduling();
+ return triggers;
+ }
+
+ public void setSchedulerBean(SchedulerFactoryBean _schedulerBean) {
+ schedulerBean = _schedulerBean;
+ }
+
+ public SchedulerFactoryBean getSchedulerBean() {
+ return schedulerBean;
+ }
+
+ public Registerable getRegistry() {
+ return registry;
+ }
+
+ public void setRegistry(Registerable registry) {
+ this.registry = registry;
+ }
+
+ public WorkflowScheduleService getWorkflowScheduleService() {
+ return workflowScheduleService;
+ }
+
+ public void setWorkflowScheduleService(WorkflowScheduleService workflowScheduleService) {
+ this.workflowScheduleService = workflowScheduleService;
+ }
+
+}
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java
new file mode 100644
index 00000000..2b9b60e4
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java
@@ -0,0 +1,64 @@
+/*-
+ * ================================================================================
+ * ECOMP Portal SDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.service;
+
+import java.util.Set;
+
+import org.openecomp.portalsdk.core.domain.Role;
+import org.openecomp.portalsdk.core.domain.User;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Service("adminAuthExtension")
+@Transactional
+/**
+ * Provides empty implementations of the methods in IAdminAuthExtension.
+ */
+public class AdminAuthExtension implements IAdminAuthExtension {
+
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminAuthExtension.class);
+
+ /*
+ * (non-Javadoc)
+ * @see org.openecomp.portalapp.service.IAdminAuthExtension#saveUserExtension(org.openecomp.portalsdk.core.domain.User)
+ */
+ public void saveUserExtension(User user) {
+ logger.debug("saveUserExtension");
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.openecomp.portalapp.service.IAdminAuthExtension#editUserExtension(org.openecomp.portalsdk.core.domain.User)
+ */
+ public void editUserExtension(User user) {
+ logger.debug("editUserExtension");
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.openecomp.portalapp.service.IAdminAuthExtension#saveUserRoleExtension(java.util.Set, org.openecomp.portalsdk.core.domain.User)
+ */
+ public void saveUserRoleExtension(Set<Role> roles, User user) {
+ logger.debug("saveUserRoleExtension");
+ }
+
+}