Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version>
<version>2.7.5</version>
<relativePath /> <!-- .. lookup parent from repository -->
</parent>

<properties>
<java.version>1.8</java.version>
<springmvcRamlVersion>2.0.5</springmvcRamlVersion>
Expand All @@ -25,7 +24,7 @@
<skipTests>false</skipTests>
<skipITs>${skipTests}</skipITs>
<skipUTs>${skipTests}</skipUTs>
<springBootVersion>2.5.12</springBootVersion>
<springBootVersion>2.7.5</springBootVersion>
<springLdapVersion>2.3.4.RELEASE</springLdapVersion>
<springSecurityVersion>5.5.2</springSecurityVersion>
<springSessionVersion>2.5.0</springSessionVersion>
Expand Down Expand Up @@ -158,13 +157,13 @@
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.3.2</version><!--$NO-MVN-MAN-VER$-->
<version>4.6.1</version><!--$NO-MVN-MAN-VER$-->
</dependency>

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-core</artifactId>
<version>4.3.2</version><!--$NO-MVN-MAN-VER$-->
<version>4.6.1</version><!--$NO-MVN-MAN-VER$-->
</dependency>

<dependency>
Expand Down
1 change: 1 addition & 0 deletions src/functionaltests/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Configuration documentation can be found here:
# https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/configuration.md
spring.application.name: eiffel-intelligence
spring.mvc.pathmatch.matching-strategy: ANT_PATH_MATCHER
server.port: 8090

logging.level.root: OFF
Expand Down
1 change: 1 addition & 0 deletions src/integrationtests/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Configuration documentation can be found here:
# https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/configuration.md
spring.application.name: eiffel-intelligence
spring.mvc.pathmatch.matching-strategy: ANT_PATH_MATCHER
server.port: 8090

logging.level.root: OFF
Expand Down
36 changes: 36 additions & 0 deletions src/main/java/com/ericsson/ei/config/SpringAsyncConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,29 @@
*/
package com.ericsson.ei.config;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Executor;

import org.apache.commons.lang3.StringUtils;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver;
import org.springframework.boot.actuate.endpoint.web.EndpointMapping;
import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes;
import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier;
import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
Expand Down Expand Up @@ -54,4 +72,22 @@ public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
// TODO Auto-generated method stub
return null;
}

@Bean
public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(WebEndpointsSupplier webEndpointsSupplier, ServletEndpointsSupplier servletEndpointsSupplier, ControllerEndpointsSupplier controllerEndpointsSupplier, EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties, Environment environment) {
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier.getEndpoints();
allEndpoints.addAll(webEndpoints);
allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
String basePath = webEndpointProperties.getBasePath();
EndpointMapping endpointMapping = new EndpointMapping(basePath);
boolean shouldRegisterLinksMapping = this.shouldRegisterLinksMapping(webEndpointProperties, environment, basePath);
return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints, endpointMediaTypes, corsProperties.toCorsConfiguration(), new EndpointLinksResolver(allEndpoints, basePath), shouldRegisterLinksMapping, null);
}


private boolean shouldRegisterLinksMapping(WebEndpointProperties webEndpointProperties, Environment environment, String basePath) {
return webEndpointProperties.getDiscovery().isEnabled() && (StringUtils.isNotEmpty(basePath) || ManagementPortType.get(environment).equals(ManagementPortType.DIFFERENT));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -69,10 +70,12 @@ public class ParseInstanceInfoEI {

@Getter
@Autowired
@Lazy
private List<MongoDbValues> mongodb;

@Getter
@Autowired
@Lazy
private List<ThreadsValue> threads;

@Getter
Expand All @@ -81,10 +84,12 @@ public class ParseInstanceInfoEI {

@Getter
@Autowired
@Lazy
private List<MailServerValues> mailServerValues;

@Getter
@Autowired
@Lazy
private LdapValues ldap;

@Getter
Expand Down Expand Up @@ -158,6 +163,9 @@ public void init() throws IOException {

@Component
private class LdapValues {
public LdapValues() {
// TODO Auto-generated constructor stub
}
@Getter
@Value("${ldap.enabled}")
private String ldapEnabled;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/configuration.md
spring.application.name: eiffel-intelligence
server.port: 8090

spring.mvc.pathmatch.matching-strategy: ANT_PATH_MATCHER
logging.level.root: OFF
logging.level.org.springframework.web: ERROR
logging.level.com.ericsson.ei: ERROR
Expand Down Expand Up @@ -58,7 +58,7 @@ spring.mail.password:
spring.mail.properties.mail.smtp.auth: false
spring.mail.properties.mail.smtp.starttls.enable: false

event.repository.url:
event.repository.url:
event.repository.shallow: true

ldap.enabled: false
Expand Down