summaryrefslogtreecommitdiffstats
path: root/epsdk-app-onap/src
diff options
context:
space:
mode:
Diffstat (limited to 'epsdk-app-onap/src')
-rw-r--r--epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java42
-rw-r--r--epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java27
-rw-r--r--epsdk-app-onap/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java4
-rw-r--r--epsdk-app-onap/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java1
4 files changed, 7 insertions, 67 deletions
diff --git a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
index fc45f1c27..e29218d9f 100644
--- a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
+++ b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
@@ -82,8 +82,7 @@ import java.util.List;
@EnableAspectJAutoProxy(proxyTargetClass=true)
public class ExternalAppConfig extends AppConfig implements Configurable {
- private RegistryAdapter schedulerRegistryAdapter;
- /** The Constant LOG. */
+ /** The Constant LOG. */
private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ExternalAppConfig.class);
/** The vid schema script. */
@@ -103,30 +102,12 @@ public class ExternalAppConfig extends AppConfig implements Configurable {
}
/**
- * @see org.onap.portalsdk.core.conf.AppConfig#viewResolver()
- */
- @Override
- public ViewResolver viewResolver() {
- return super.viewResolver();
- }
-
- /**
- * @see org.onap.portalsdk.core.conf.AppConfig#addResourceHandlers(ResourceHandlerRegistry)
- *
- * @param registry
- */
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- super.addResourceHandlers(registry);
- }
-
- /**
* @see org.onap.portalsdk.core.conf.AppConfig#dataAccessService()
*/
@Override
public DataAccessService dataAccessService() {
// Echo the JDBC URL to assist developers when starting the app.
- System.out.println("ExternalAppConfig: " + SystemProperties.DB_CONNECTIONURL + " is "
+ LOG.info("ExternalAppConfig: " + SystemProperties.DB_CONNECTIONURL + " is "
+ SystemProperties.getProperty(SystemProperties.DB_CONNECTIONURL));
return super.dataAccessService();
}
@@ -211,25 +192,6 @@ public class ExternalAppConfig extends AppConfig implements Configurable {
populator.addScript(vidDataScript);
return populator;
}
-
-
- /*@Bean
- public SpringLiquibase liquibaseBean(DataSource dataSource) {
- SpringLiquibase springLiquibase = new SpringLiquibase();
- springLiquibase.setDataSource(dataSource);
- springLiquibase.setChangeLog("classpath:db-master-changelog.xml");
- return springLiquibase;
- }*/
-
- /**
- * Sets the scheduler registry adapter.
- *
- * @param schedulerRegistryAdapter
- */
- @Autowired
- public void setSchedulerRegistryAdapter(final RegistryAdapter schedulerRegistryAdapter) {
- this.schedulerRegistryAdapter = schedulerRegistryAdapter;
- }
@Bean
public LoginStrategy loginStrategy() {
diff --git a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
index dc6973fef..7c1b5c693 100644
--- a/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
+++ b/epsdk-app-onap/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
@@ -38,43 +38,22 @@
package org.onap.portalapp.conf;
import org.onap.portalsdk.core.conf.AppInitializer;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import java.util.TimeZone;
public class ExternalAppInitializer extends AppInitializer {
- @Override
- protected Class<?>[] getRootConfigClasses() {
- return super.getRootConfigClasses();
- }
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ExternalAppInitializer.class);
@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());
+ LOG.info("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();
- }
-
-// @Override
-// public void onStartup(ServletContext servletContext) throws ServletException {
-// super.onStartup(servletContext);
-// setDefaultTimeZoneToUTC();
-// servletContext.addFilter("requestFromLocalhost", LocalhostFilter.class)
-// .addMappingForUrlPatterns(null, false,
-// String.format("/%s/%s/*", ChangeManagementController.CHANGE_MANAGEMENT, ChangeManagementController.VNF_WORKFLOW_RELATION),
-// String.format("/%s/*", RoleGeneratorController.GENERATE_ROLE_SCRIPT),
-// String.format("/%s/*", MaintenanceController.MAINTENANCE));
-// }
-
//set time zone to UTC so Dates would be written to DB in UTC timezone
private void setDefaultTimeZoneToUTC() {
System.setProperty("user.timezone", "UTC");
diff --git a/epsdk-app-onap/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java b/epsdk-app-onap/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java
index 71ab7359a..d9d1b6dcd 100644
--- a/epsdk-app-onap/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java
+++ b/epsdk-app-onap/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java
@@ -89,13 +89,13 @@ public class SecurityXssFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
- if (request.getMethod().equalsIgnoreCase("POST") || request.getMethod().equalsIgnoreCase("PUT")) {
+ if ("POST".equalsIgnoreCase(request.getMethod())|| "PUT".equalsIgnoreCase(request.getMethod())) {
HttpServletRequest requestToCache = new ContentCachingRequestWrapper(request);
HttpServletResponse responseToCache = new ContentCachingResponseWrapper(response);
filterChain.doFilter(requestToCache, responseToCache);
String requestData = getRequestData(requestToCache);
- String responseData = getResponseData(responseToCache);
+ getResponseData(responseToCache);
if (StringUtils.isNotBlank(requestData) && validator.denyXSS(requestData)) {
throw new SecurityException(BAD_REQUEST);
}
diff --git a/epsdk-app-onap/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java b/epsdk-app-onap/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java
index 120ea25ec..693df2f24 100644
--- a/epsdk-app-onap/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java
+++ b/epsdk-app-onap/src/test/java/org/onap/portalapp/conf/ExternalAppConfigTest.java
@@ -72,7 +72,6 @@ public class ExternalAppConfigTest {
// default test
testSubject = createTestSubject();
- testSubject.setSchedulerRegistryAdapter(schedulerRegistryAdapter);
}
@Test