Commit 47d8e174 by Johannes Stelzer

Added spring-boot-configuration-processor and addiotional metadata for ConfigurationProperties

parent 39e77e6f
......@@ -25,6 +25,11 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!-- Use Zuul WITHOUT Hystrix/Ribbon/Config Client -->
<dependency>
......
{"groups": [
{
"name": "spring.boot.admin.hazelcast",
"sourceType": "de.codecentric.boot.admin.config.AdminServerWebConfiguration.HazelcastStoreConfiguration"
},
{
"name": "spring.boot.admin.discovery",
"sourceType": "de.codecentric.boot.admin.config.AdminServerWebConfiguration.DiscoveryClientConfiguration"
}
],"properties": [
{
"name": "spring.boot.admin.hazelcast.enabled",
"type": "java.lang.Boolean",
"description": "Enable Hazelcast support.",
"defaultValue": "true"
},
{
"name": "spring.boot.admin.hazelcast.map",
"type": "java.lang.String",
"description": "Name of backing Hazelcast-Map",
"defaultValue": "spring-boot-admin-application-store"
},
{
"name": "spring.boot.admin.discovery.enabled",
"type": "java.lang.Boolean",
"description": "Enable Spring Cloud Discovery support.",
"defaultValue": "true"
},
{
"name": "spring.boot.admin.discovery.management.context-path",
"type": "java.lang.String",
"description": "management-path suffix for discovered applications",
"defaultValue": ""
}
]
\ No newline at end of file
......@@ -26,6 +26,11 @@
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
</dependency>
......
......@@ -44,13 +44,25 @@ public class LogfileMvcEndpoint implements MvcEndpoint {
private static final Logger LOGGER = LoggerFactory.getLogger(LogfileMvcEndpoint.class);
/**
* Logfile to serve at this endpoint. Defaults to ${logging.file}.
*/
@Value("${logging.file}")
private String logfile;
/**
* Path of the logfile-endpoint
*/
private String path = "/logfile";
/**
* Is the logfile endpoint sensitive
*/
private boolean sensitive = true;
/**
* Enable the logfile endpoint
*/
private boolean enabled = true;
@Override
......
......@@ -37,10 +37,27 @@ import org.springframework.util.StringUtils;
@Order(Ordered.LOWEST_PRECEDENCE - 100)
public class AdminClientProperties implements ApplicationListener<ApplicationEvent> {
/**
* Client-management-URL to register with. Inferred at runtime, can be overriden in
* case the reachable URL is different (e.g. Docker).
*/
private String managementUrl;
/**
* Client-service-URL register with. Inferred at runtime, can be overriden in case the
* reachable URL is different (e.g. Docker).
*/
private String serviceUrl;
/**
* Client-health-URL to register with. Inferred at runtime, can be overriden in case
* the reachable URL is different (e.g. Docker). Must be unique in registry.
*/
private String healthUrl;
/**
* Name to register with. Defaults to ${spring.application.name}
*/
@Value("${spring.application.name:spring-boot-application}")
private String name;
......@@ -90,11 +107,6 @@ public class AdminClientProperties implements ApplicationListener<ApplicationEve
return false;
}
/**
* @return Client-management-URL to register with. Can be overriden in case the
* reachable URL is different (e.g. Docker). Must be unique in registry.
*/
public String getManagementUrl() {
if (managementUrl == null) {
if (managementPort != -1) {
......@@ -113,11 +125,6 @@ public class AdminClientProperties implements ApplicationListener<ApplicationEve
this.managementUrl = managementUrl;
}
/**
* @return Client-health-URL to register with. Can be overriden in case the reachable
* URL is different (e.g. Docker). Must be unique in registry.
*/
public String getHealthUrl() {
if (healthUrl == null) {
return append(getManagementUrl(), healthEndpointId);
......@@ -129,10 +136,6 @@ public class AdminClientProperties implements ApplicationListener<ApplicationEve
this.healthUrl = healthUrl;
}
/**
* @return Client-service-URL to register with. Can be overriden in case the reachable
* URL is different (e.g. Docker). Must be unique in registry.
*/
public String getServiceUrl() {
if (serviceUrl == null) {
if (serverPort != -1){
......@@ -154,9 +157,6 @@ public class AdminClientProperties implements ApplicationListener<ApplicationEve
return serverInitialized;
}
/**
* @return Name to register with.
*/
public String getName() {
return name;
}
......@@ -176,7 +176,7 @@ public class AdminClientProperties implements ApplicationListener<ApplicationEve
private String createLocalUri(int port, String path) {
String scheme = server.getSsl() != null && server.getSsl().isEnabled() ? "https" : "http";
return append(scheme + "://" + getHostname() + ":" + port + "/", path);
return append(scheme + "://" + getHostname() + ":" + port + "/", path);
}
private String append(String uri, String path) {
......
......@@ -20,32 +20,43 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "spring.boot.admin")
public class AdminProperties {
/**
* The admin servers url to register at
*/
private String url;
/**
* The admin servers context path.
*/
private String contextPath = "api/applications";
/**
* Time interval (in ms) the registration is repeated
*/
private int period = 10000;
/**
* Username for basic authentication on admin server
*/
private String username;
/**
* Password for basic authentication on admin server
*/
private String password;
/**
* Enable automatic deregistration on shutdown
*/
private boolean autoDeregistration;
public void setUrl(String url) {
this.url = url;
}
/**
* @return the Spring Boot Admin Server's url.
*/
public String getUrl() {
return url;
}
/**
* @return the Spring Boot Admin Server's context path.
*/
public String getContextPath() {
return contextPath;
}
......@@ -54,9 +65,6 @@ public class AdminProperties {
this.contextPath = contextPath;
}
/**
* @return the time interval (in ms) the registration is repeated.
*/
public int getPeriod() {
return period;
}
......@@ -69,9 +77,6 @@ public class AdminProperties {
this.username = username;
}
/**
* @return username for basic authentication .
*/
public String getUsername() {
return username;
}
......@@ -80,16 +85,10 @@ public class AdminProperties {
this.password = password;
}
/**
* @return password for basic authentication.
*/
public String getPassword() {
return password;
}
/**
* @return wether the application deregisters automatically on shutdown.
*/
public boolean isAutoDeregistration() {
return autoDeregistration;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment