From 1091d44009f1309f6c52ee03eacf3b9da1ecd4c9 Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Thu, 21 Jul 2022 08:20:02 -0400 Subject: [PATCH] Moved files to portal --- .../attestationca/InitializationListener.java | 26 +--------------- .../portal/page/AcaInitializer.java | 30 +++++++++++++++++++ .../PersistenceConfiguration.java | 2 +- 3 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/AcaInitializer.java rename {HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration => HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/persistence}/PersistenceConfiguration.java (99%) diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/InitializationListener.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/InitializationListener.java index bb1d756a..76a9826e 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/InitializationListener.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/InitializationListener.java @@ -1,6 +1,5 @@ package hirs.attestationca; -import hirs.attestationca.configuration.PersistenceConfiguration; import hirs.attestationca.persist.DBAppraiserManager; import hirs.attestationca.persist.DBDeviceGroupManager; import hirs.attestationca.persist.DBPolicyManager; @@ -8,7 +7,6 @@ import hirs.utils.HIRSProfiles; import org.hibernate.SessionFactory; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.orm.hibernate5.LocalSessionFactoryBean; -import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; @@ -16,8 +14,7 @@ import javax.servlet.ServletContextListener; /** * Simply holds a contextInitialized method which will be called when the web app starts. */ -public class InitializationListener extends AbstractAnnotationConfigDispatcherServletInitializer - implements ServletContextListener { +public class InitializationListener implements ServletContextListener { @Override public void contextInitialized(final ServletContextEvent event) { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); @@ -40,25 +37,4 @@ public class InitializationListener extends AbstractAnnotationConfigDispatcherSe public void contextDestroyed(final ServletContextEvent event) { } - - @Override - protected Class[] getRootConfigClasses() { - return new Class[] { - AttestationCertificateAuthorityConfiguration.class - }; - } - - @Override - protected Class[] getServletConfigClasses() { - return new Class[] { - PersistenceConfiguration.class, - }; - } - - @Override - protected String[] getServletMappings() { - return new String[] { - "/" - }; - } } diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/AcaInitializer.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/AcaInitializer.java new file mode 100644 index 00000000..2272ca67 --- /dev/null +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/AcaInitializer.java @@ -0,0 +1,30 @@ +package hirs.attestationca.portal.page; + +import hirs.attestationca.AttestationCertificateAuthorityConfiguration; +import hirs.attestationca.portal.persistence.PersistenceConfiguration; +import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; + +public class AcaInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { + + + @Override + protected Class[] getRootConfigClasses() { + return new Class[] { + AttestationCertificateAuthorityConfiguration.class + }; + } + + @Override + protected Class[] getServletConfigClasses() { + return new Class[] { + CommonPageConfiguration.class, AttestationCertificateAuthorityConfiguration.class + }; + } + + @Override + protected String[] getServletMappings() { + return new String[] { + "/" + }; + } +} diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/PersistenceConfiguration.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/persistence/PersistenceConfiguration.java similarity index 99% rename from HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/PersistenceConfiguration.java rename to HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/persistence/PersistenceConfiguration.java index 745bdd8f..eea4a064 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/PersistenceConfiguration.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/persistence/PersistenceConfiguration.java @@ -1,4 +1,4 @@ -package hirs.attestationca.configuration; +package hirs.attestationca.portal.persistence; import hirs.attestationca.AttestationCertificateAuthorityConfiguration; import hirs.attestationca.persist.DBCertificateManager;