Restore ServerProperties.getSessionTimeout()

Restore the deprecated method to give people a change to migrate. The
@DeprecatedConfigurationProperties annotation is now used to generate
the deprecated meta-data, removing the need for manual meta-data.

Closes gh-3537
This commit is contained in:
Phillip Webb
2015-07-17 14:15:15 -07:00
parent e9d252e05c
commit 3b4928c549
2 changed files with 12 additions and 9 deletions

View File

@@ -52,6 +52,7 @@ import org.springframework.boot.context.embedded.tomcat.TomcatContextCustomizer;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.core.Ordered;
import org.springframework.util.StringUtils;
@@ -197,6 +198,17 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer, Ord
this.address = address;
}
/**
* Set the session timeout
* @return the session timeout
* @deprecated since 1.3.0 in favor of {@code session.timeout}.
*/
@Deprecated
@DeprecatedConfigurationProperty(replacement = "server.session.timeout")
public Integer getSessionTimeout() {
return this.session.getTimeout();
}
/**
* Get the session timeout
* @param sessionTimeout the session timeout

View File

@@ -161,15 +161,6 @@
"deprecation": {
"replacement": "spring.mvc.view.suffix"
}
},
{
"name": "server.session-timeout",
"type": "java.lang.Integer",
"description": "Session timeout in seconds.",
"sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties",
"deprecation": {
"replacement": "server.session.timeout"
}
}
],"hints": [
{