Add property description
Set the field javadoc of many properties that are managed via configuration so that the "description" field is available in the meta-data. Closes gh-1808
This commit is contained in:
@@ -59,10 +59,22 @@ public class MessageSourceAutoConfiguration {
|
||||
|
||||
private static final Resource[] NO_RESOURCES = {};
|
||||
|
||||
/**
|
||||
* Comma-separated list of basenames, each following the ResourceBundle convention. Essentially
|
||||
* a fully-qualified classpath location. If it doesn't contain a package qualifier (such as
|
||||
* "org.mypackage"), it will be resolved from the classpath root.
|
||||
*/
|
||||
private String basename = "messages";
|
||||
|
||||
/**
|
||||
* Message bundles encoding.
|
||||
*/
|
||||
private String encoding = "utf-8";
|
||||
|
||||
/**
|
||||
* Loaded resource bundle files cache expiration, in seconds. When set to
|
||||
* -1, bundles are cached forever.
|
||||
*/
|
||||
private int cacheSeconds = -1;
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -31,16 +31,34 @@ import org.springframework.util.StringUtils;
|
||||
@ConfigurationProperties(prefix = "spring.rabbitmq")
|
||||
public class RabbitProperties {
|
||||
|
||||
/**
|
||||
* RabbitMQ host.
|
||||
*/
|
||||
private String host = "localhost";
|
||||
|
||||
/**
|
||||
* RabbitMQ port.
|
||||
*/
|
||||
private int port = 5672;
|
||||
|
||||
/**
|
||||
* Login user to authenticate to the broker.
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* Login to authenticate against the broker.
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* Virtual host to use when connecting to the broker.
|
||||
*/
|
||||
private String virtualHost;
|
||||
|
||||
/**
|
||||
* Comma-separated list of addresses to which the client should connect to.
|
||||
*/
|
||||
private String addresses;
|
||||
|
||||
private boolean dynamic = true;
|
||||
|
||||
@@ -30,6 +30,9 @@ public class BatchProperties {
|
||||
private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/springframework/"
|
||||
+ "batch/core/schema-@@platform@@.sql";
|
||||
|
||||
/**
|
||||
* Path to the SQL file to use to initialize the database schema.
|
||||
*/
|
||||
private String schema = DEFAULT_SCHEMA_LOCATION;
|
||||
|
||||
private final Initializer initializer = new Initializer();
|
||||
@@ -54,6 +57,9 @@ public class BatchProperties {
|
||||
|
||||
public static class Initializer {
|
||||
|
||||
/**
|
||||
* Create the required batch tables on startup if necessary.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
public boolean isEnabled() {
|
||||
@@ -68,6 +74,10 @@ public class BatchProperties {
|
||||
|
||||
public static class Job {
|
||||
|
||||
/**
|
||||
* Comma-separated list of job names to execute on startup. By default, all Jobs
|
||||
* found in the context are executed.
|
||||
*/
|
||||
private String names = "";
|
||||
|
||||
public String getNames() {
|
||||
|
||||
@@ -28,8 +28,14 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.data.elasticsearch")
|
||||
public class ElasticsearchProperties {
|
||||
|
||||
/**
|
||||
* Elasticsearch cluster name.
|
||||
*/
|
||||
private String clusterName = "elasticsearch";
|
||||
|
||||
/**
|
||||
* Comma-separated list of cluster node addresses. If not specified, starts a client node.
|
||||
*/
|
||||
private String clusterNodes;
|
||||
|
||||
public String getClusterName() {
|
||||
|
||||
@@ -35,18 +35,40 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "flyway", ignoreUnknownFields = true)
|
||||
public class FlywayProperties {
|
||||
|
||||
/**
|
||||
* Locations of migrations scripts.
|
||||
*/
|
||||
private List<String> locations = Arrays.asList("db/migration");
|
||||
|
||||
/**
|
||||
* Check that migration scripts location exists.
|
||||
*/
|
||||
private boolean checkLocation = false;
|
||||
|
||||
/**
|
||||
* Enable flyway.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* Login user of the database to migrate.
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
*Login password of the database to migrate.
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* JDBC url of the database to migrate. If not set, the primary configured
|
||||
* data source is used.
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* SQL statements to execute to initialize a connection immediately after obtaining it.
|
||||
*/
|
||||
private List<String> initSqls = Collections.emptyList();
|
||||
|
||||
public void setLocations(List<String> locations) {
|
||||
|
||||
@@ -38,8 +38,14 @@ public class FreeMarkerProperties extends AbstractTemplateViewResolverProperties
|
||||
|
||||
public static final String DEFAULT_SUFFIX = ".ftl";
|
||||
|
||||
/**
|
||||
* Well-known FreeMarker keys which will be passed to FreeMarker's Configuration.
|
||||
*/
|
||||
private Map<String, String> settings = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Comma-separated list of template paths.
|
||||
*/
|
||||
private String[] templateLoaderPath = new String[] { DEFAULT_TEMPLATE_LOADER_PATH };
|
||||
|
||||
public FreeMarkerProperties() {
|
||||
|
||||
@@ -35,10 +35,19 @@ public class GroovyTemplateProperties extends AbstractViewResolverProperties {
|
||||
|
||||
public static final String DEFAULT_SUFFIX = ".tpl";
|
||||
|
||||
/**
|
||||
* Prefix that gets prepended to view names when building a URL.
|
||||
*/
|
||||
private String prefix = DEFAULT_PREFIX;
|
||||
|
||||
/**
|
||||
*Suffix that gets appended to view names when building a URL.
|
||||
*/
|
||||
private String suffix = DEFAULT_SUFFIX;
|
||||
|
||||
/**
|
||||
* Configuration to pass to TemplateConfiguration.
|
||||
*/
|
||||
private Map<String, Object> configuration = new HashMap<String, Object>();
|
||||
|
||||
public String getPrefix() {
|
||||
|
||||
@@ -37,18 +37,40 @@ import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
@ConfigurationProperties(prefix = "spring.jackson")
|
||||
public class JacksonProperties {
|
||||
|
||||
/**
|
||||
* Date format string (yyyy-MM-dd HH:mm:ss), or a fully-qualified date format class name.
|
||||
*/
|
||||
private String dateFormat;
|
||||
|
||||
/**
|
||||
* One of the constants on Jackson's PropertyNamingStrategy (CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES).
|
||||
* Can also be a fully-qualified class name of a PropertyNamingStrategy subclass.
|
||||
*/
|
||||
private String propertyNamingStrategy;
|
||||
|
||||
/**
|
||||
* Jackson on/off features that affect the way Java objects are serialized.
|
||||
*/
|
||||
private Map<SerializationFeature, Boolean> serialization = new HashMap<SerializationFeature, Boolean>();
|
||||
|
||||
/**
|
||||
* Jackson on/off features that affect the way Java objects are deserialized.
|
||||
*/
|
||||
private Map<DeserializationFeature, Boolean> deserialization = new HashMap<DeserializationFeature, Boolean>();
|
||||
|
||||
/**
|
||||
* Jackson general purpose on/off features.
|
||||
*/
|
||||
private Map<MapperFeature, Boolean> mapper = new HashMap<MapperFeature, Boolean>();
|
||||
|
||||
/**
|
||||
* Jackson on/off features for parsers.
|
||||
*/
|
||||
private Map<JsonParser.Feature, Boolean> parser = new HashMap<JsonParser.Feature, Boolean>();
|
||||
|
||||
/**
|
||||
* Jackson on/off features for generators.
|
||||
*/
|
||||
private Map<JsonGenerator.Feature, Boolean> generator = new HashMap<JsonGenerator.Feature, Boolean>();
|
||||
|
||||
public String getDateFormat() {
|
||||
|
||||
@@ -39,30 +39,66 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
|
||||
|
||||
public static final String PREFIX = "spring.datasource";
|
||||
|
||||
/**
|
||||
* Fully qualified name of the JDBC driver. Auto-detected based on the URL by default.
|
||||
*/
|
||||
private String driverClassName;
|
||||
|
||||
/**
|
||||
* JDBC url of the database.
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* Login user of the database.
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* Login password of the database.
|
||||
*/
|
||||
private String password;
|
||||
|
||||
private ClassLoader classLoader;
|
||||
|
||||
/**
|
||||
* JNDI location of the datasource. Class, url, username & password are ignored when set.
|
||||
*/
|
||||
private String jndiName;
|
||||
|
||||
/**
|
||||
* Populate the database using 'data.sql'.
|
||||
*/
|
||||
private boolean initialize = true;
|
||||
|
||||
/**
|
||||
* Platform to use in the schema resource (schema-${platform}.sql).
|
||||
*/
|
||||
private String platform = "all";
|
||||
|
||||
/**
|
||||
* Schema (DDL) script resource reference.
|
||||
*/
|
||||
private String schema;
|
||||
|
||||
/**
|
||||
* Data (DML) script resource reference.
|
||||
*/
|
||||
private String data;
|
||||
|
||||
/**
|
||||
* Do not stop if an error occurs while initializing the database.
|
||||
*/
|
||||
private boolean continueOnError = false;
|
||||
|
||||
/**
|
||||
* Statement separator in SQL initialization scripts.
|
||||
*/
|
||||
private String separator = ";";
|
||||
|
||||
/**
|
||||
* SQL scripts encoding.
|
||||
*/
|
||||
private String sqlScriptEncoding;
|
||||
|
||||
private EmbeddedDatabaseConnection embeddedDatabaseConnection = EmbeddedDatabaseConnection.NONE;
|
||||
@@ -244,8 +280,14 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
|
||||
*/
|
||||
public static class Xa {
|
||||
|
||||
/**
|
||||
* XA datasource fully qualified name.
|
||||
*/
|
||||
private String dataSourceClassName;
|
||||
|
||||
/**
|
||||
* Properties to pass to the XA data source.
|
||||
*/
|
||||
private Map<String, String> properties = new LinkedHashMap<String, String>();
|
||||
|
||||
public String getDataSourceClassName() {
|
||||
|
||||
@@ -30,8 +30,14 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties("spring.jersey")
|
||||
public class JerseyProperties {
|
||||
|
||||
/**
|
||||
* Jersey integration type. Can be either "servlet" or "filter".
|
||||
*/
|
||||
private Type type = Type.SERVLET;
|
||||
|
||||
/**
|
||||
* Init parameters to pass to Jersey.
|
||||
*/
|
||||
private Map<String, String> init = new HashMap<String, String>();
|
||||
|
||||
private Filter filter = new Filter();
|
||||
@@ -66,6 +72,9 @@ public class JerseyProperties {
|
||||
|
||||
public static class Filter {
|
||||
|
||||
/**
|
||||
* Jersey filter chain order.
|
||||
*/
|
||||
private int order;
|
||||
|
||||
public int getOrder() {
|
||||
|
||||
@@ -27,8 +27,15 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.jms")
|
||||
public class JmsProperties {
|
||||
|
||||
/**
|
||||
* Specify if the default destination type is topic.
|
||||
*/
|
||||
private boolean pubSubDomain = false;
|
||||
|
||||
/**
|
||||
* Connection factory JNDI name. When set, takes precedence to others connection
|
||||
* factory auto-configurations.
|
||||
*/
|
||||
private String jndiName;
|
||||
|
||||
public boolean isPubSubDomain() {
|
||||
|
||||
@@ -27,14 +27,30 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.activemq")
|
||||
public class ActiveMQProperties {
|
||||
|
||||
/**
|
||||
* URL of the ActiveMQ broker. Auto-generated by default.
|
||||
*/
|
||||
private String brokerUrl;
|
||||
|
||||
/**
|
||||
* Specify if the default broker URL should be in memory. Ignored if an explicit
|
||||
* broker has been specified.
|
||||
*/
|
||||
private boolean inMemory = true;
|
||||
|
||||
/**
|
||||
* Specify if a PooledConnectionFactory should be created instead of a regular ConnectionFactory.
|
||||
*/
|
||||
private boolean pooled;
|
||||
|
||||
/**
|
||||
* Login user of the broker.
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* Login password of the broker.
|
||||
*/
|
||||
private String password;
|
||||
|
||||
public String getBrokerUrl() {
|
||||
@@ -45,10 +61,6 @@ public class ActiveMQProperties {
|
||||
this.brokerUrl = brokerUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify if the default broker url should be in memory. Ignored if an explicit
|
||||
* broker has been specified.
|
||||
*/
|
||||
public boolean isInMemory() {
|
||||
return this.inMemory;
|
||||
}
|
||||
|
||||
@@ -33,10 +33,19 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.hornetq")
|
||||
public class HornetQProperties {
|
||||
|
||||
/**
|
||||
* HornetQ deployment mode, auto-detected by default. Can be explicitly set to "native" or "embedded".
|
||||
*/
|
||||
private HornetQMode mode;
|
||||
|
||||
/**
|
||||
* HornetQ broker host.
|
||||
*/
|
||||
private String host = "localhost";
|
||||
|
||||
/**
|
||||
* HornetQ broker port.
|
||||
*/
|
||||
private int port = 5445;
|
||||
|
||||
private final Embedded embedded = new Embedded();
|
||||
@@ -76,18 +85,39 @@ public class HornetQProperties {
|
||||
|
||||
private static final AtomicInteger serverIdCounter = new AtomicInteger();
|
||||
|
||||
/**
|
||||
* Server id. By default, an auto-incremented counter is used.
|
||||
*/
|
||||
private int serverId = serverIdCounter.getAndIncrement();
|
||||
|
||||
/**
|
||||
* Enable embedded mode if the HornetQ server APIs are available.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* Enable persistent store.
|
||||
*/
|
||||
private boolean persistent;
|
||||
|
||||
/**
|
||||
* Journal file directory. Not necessary if persistence is turned off.
|
||||
*/
|
||||
private String dataDirectory;
|
||||
|
||||
/**
|
||||
* Comma-separate list of queues to create on startup.
|
||||
*/
|
||||
private String[] queues = new String[0];
|
||||
|
||||
/**
|
||||
* Comma-separate list of topics to create on startup.
|
||||
*/
|
||||
private String[] topics = new String[0];
|
||||
|
||||
/**
|
||||
* Cluster password. Randomly generated on startup by default
|
||||
*/
|
||||
private String clusterPassword = UUID.randomUUID().toString();
|
||||
|
||||
private boolean defaultClusterPassword = true;
|
||||
|
||||
@@ -34,8 +34,14 @@ public class JtaProperties {
|
||||
|
||||
public static final String PREFIX = "spring.jta";
|
||||
|
||||
/**
|
||||
* Transaction logs directory.
|
||||
*/
|
||||
private String logDir;
|
||||
|
||||
/**
|
||||
* Transaction manager unique identifier.
|
||||
*/
|
||||
private String transactionManagerId;
|
||||
|
||||
public void setLogDir(String logDir) {
|
||||
|
||||
@@ -31,23 +31,51 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "liquibase", ignoreUnknownFields = false)
|
||||
public class LiquibaseProperties {
|
||||
|
||||
/**
|
||||
* Change log configuration path.
|
||||
*/
|
||||
@NotNull
|
||||
private String changeLog = "classpath:/db/changelog/db.changelog-master.yaml";
|
||||
|
||||
/**
|
||||
* Check the change log location exists.
|
||||
*/
|
||||
private boolean checkChangeLogLocation = true;
|
||||
|
||||
/**
|
||||
* Comma-separated list of runtime contexts to use.
|
||||
*/
|
||||
private String contexts;
|
||||
|
||||
/**
|
||||
* Default database schema.
|
||||
*/
|
||||
private String defaultSchema;
|
||||
|
||||
/**
|
||||
* Drop the database schema first.
|
||||
*/
|
||||
private boolean dropFirst;
|
||||
|
||||
/**
|
||||
* Enable liquibase support.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* Login user of the database to migrate.
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* Login password of the database to migrate.
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* JDBC url of the database to migrate. If not set, the primary configured
|
||||
* data source is used.
|
||||
*/
|
||||
private String url;
|
||||
|
||||
public String getChangeLog() {
|
||||
|
||||
@@ -31,16 +31,34 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.mail")
|
||||
public class MailProperties {
|
||||
|
||||
/**
|
||||
* SMTP server host.
|
||||
*/
|
||||
private String host;
|
||||
|
||||
/**
|
||||
* SMTP server port.
|
||||
*/
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* Login user of the SMTP server.
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* Login password of the SMTP server.
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* Default MimeMessage encoding.
|
||||
*/
|
||||
private String defaultEncoding = "UTF-8";
|
||||
|
||||
/**
|
||||
* Additional JavaMail session properties.
|
||||
*/
|
||||
private Map<String, String> properties = new HashMap<String, String>();
|
||||
|
||||
public String getHost() {
|
||||
|
||||
@@ -27,16 +27,34 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties("spring.mobile.devicedelegatingviewresolver")
|
||||
public class DeviceDelegatingViewResolverProperties {
|
||||
|
||||
/**
|
||||
* Prefix that gets prepended to view names for normal devices.
|
||||
*/
|
||||
private String normalPrefix = "";
|
||||
|
||||
/**
|
||||
* Suffix that gets appended to view names for normal devices.
|
||||
*/
|
||||
private String normalSuffix = "";
|
||||
|
||||
/**
|
||||
* Prefix that gets prepended to view names for mobile devices.
|
||||
*/
|
||||
private String mobilePrefix = "mobile/";
|
||||
|
||||
/**
|
||||
* Suffix that gets appended to view names for mobile devices.
|
||||
*/
|
||||
private String mobileSuffix = "";
|
||||
|
||||
/**
|
||||
* Prefix that gets prepended to view names for tablet devices.
|
||||
*/
|
||||
private String tabletPrefix = "tablet/";
|
||||
|
||||
/**
|
||||
* Suffix that gets appended to view names for tablet devices.
|
||||
*/
|
||||
private String tabletSuffix = "";
|
||||
|
||||
public String getNormalPrefix() {
|
||||
|
||||
@@ -42,20 +42,44 @@ public class MongoProperties {
|
||||
|
||||
private static final int DEFAULT_PORT = 27017;
|
||||
|
||||
/**
|
||||
* Mongo server host.
|
||||
*/
|
||||
private String host;
|
||||
|
||||
/**
|
||||
* Mongo server port.
|
||||
*/
|
||||
private Integer port = null;
|
||||
|
||||
/**
|
||||
* Mmongo database URI. When set, host and port are ignored.
|
||||
*/
|
||||
private String uri = "mongodb://localhost/test";
|
||||
|
||||
/**
|
||||
* Database name.
|
||||
*/
|
||||
private String database;
|
||||
|
||||
/**
|
||||
* Authentication database name.
|
||||
*/
|
||||
private String authenticationDatabase;
|
||||
|
||||
/**
|
||||
* GridFS database name.
|
||||
*/
|
||||
private String gridFsDatabase;
|
||||
|
||||
/**
|
||||
* Login user of the mongo server.
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* Login password of the mongo server.
|
||||
*/
|
||||
private char[] password;
|
||||
|
||||
public String getHost() {
|
||||
|
||||
@@ -40,14 +40,31 @@ public class JpaProperties {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(JpaProperties.class);
|
||||
|
||||
/**
|
||||
* Additional native properties to set on the JPA provider.
|
||||
*/
|
||||
private Map<String, String> properties = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Name of the target database to operate on, auto-detected by default. Can be
|
||||
* alternatively set using the "Database" enum.
|
||||
*/
|
||||
private String databasePlatform;
|
||||
|
||||
/**
|
||||
* Target database to operate on, auto-detected by default. Can be alternatively
|
||||
* set using the "databasePlatform" property.
|
||||
*/
|
||||
private Database database = Database.DEFAULT;
|
||||
|
||||
/**
|
||||
* Initialize the schema on startup.
|
||||
*/
|
||||
private boolean generateDdl = false;
|
||||
|
||||
/**
|
||||
* Enable logging of SQL statements.
|
||||
*/
|
||||
private boolean showSql = false;
|
||||
|
||||
private Hibernate hibernate = new Hibernate();
|
||||
@@ -114,8 +131,16 @@ public class JpaProperties {
|
||||
|
||||
private static final String DEFAULT_NAMING_STRATEGY = "org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy";
|
||||
|
||||
/**
|
||||
* Naming strategy fully qualified name.
|
||||
*/
|
||||
private Class<?> namingStrategy;
|
||||
|
||||
/**
|
||||
* DDL mode ("none", "validate", "update", "create", "create-drop"). This is actually a shortcut
|
||||
* for the "hibernate.hbm2ddl.auto" property. Default to "create-drop" when using an embedded database,
|
||||
* "none" otherwise.
|
||||
*/
|
||||
private String ddlAuto;
|
||||
|
||||
public Class<?> getNamingStrategy() {
|
||||
|
||||
@@ -27,12 +27,24 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.redis")
|
||||
public class RedisProperties {
|
||||
|
||||
/**
|
||||
* Database index used by the connection factory.
|
||||
*/
|
||||
private int database = 0;
|
||||
|
||||
/**
|
||||
* Redis server host.
|
||||
*/
|
||||
private String host = "localhost";
|
||||
|
||||
/**
|
||||
* Login password of the redis server.
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* Redis server port.
|
||||
*/
|
||||
private int port = 6379;
|
||||
|
||||
private Pool pool;
|
||||
@@ -92,12 +104,29 @@ public class RedisProperties {
|
||||
*/
|
||||
public static class Pool {
|
||||
|
||||
/**
|
||||
* Max number of "idle" connections in the pool. Use a negative value to indicate
|
||||
* an unlimited number of idle connections.
|
||||
*/
|
||||
private int maxIdle = 8;
|
||||
|
||||
/**
|
||||
* Target for the minimum number of idle connections to maintain in
|
||||
* the pool. This setting only has an effect if it is positive.
|
||||
*/
|
||||
private int minIdle = 0;
|
||||
|
||||
/**
|
||||
* Max number of connections that can be allocated by the pool at a given time. Use
|
||||
* a negative value for no limit.
|
||||
*/
|
||||
private int maxActive = 8;
|
||||
|
||||
/**
|
||||
* Maximum amount of time (in milliseconds) a connection allocation should block before
|
||||
* throwing an exception when the pool is exhausted. Use a negative value to block
|
||||
* indefinitely.
|
||||
*/
|
||||
private int maxWait = -1;
|
||||
|
||||
public int getMaxIdle() {
|
||||
@@ -138,8 +167,14 @@ public class RedisProperties {
|
||||
*/
|
||||
public static class Sentinel {
|
||||
|
||||
/**
|
||||
* Name of Redis server.
|
||||
*/
|
||||
private String master;
|
||||
|
||||
/**
|
||||
* Comma-separated list of host:port pairs.
|
||||
*/
|
||||
private String nodes;
|
||||
|
||||
public String getMaster() {
|
||||
|
||||
@@ -60,8 +60,14 @@ public class SecurityProperties implements SecurityPrequisite {
|
||||
*/
|
||||
public static final int DEFAULT_FILTER_ORDER = 0;
|
||||
|
||||
/**
|
||||
* Enable secure channel for all requests.
|
||||
*/
|
||||
private boolean requireSsl;
|
||||
|
||||
/**
|
||||
* Enable Cross Site Request Forgery support.
|
||||
*/
|
||||
// Flip this when session creation is disabled by default
|
||||
private boolean enableCsrf = false;
|
||||
|
||||
@@ -69,12 +75,21 @@ public class SecurityProperties implements SecurityPrequisite {
|
||||
|
||||
private final Headers headers = new Headers();
|
||||
|
||||
/**
|
||||
* Session creation policy (always, never, if_required, stateless).
|
||||
*/
|
||||
private SessionCreationPolicy sessions = SessionCreationPolicy.STATELESS;
|
||||
|
||||
/**
|
||||
* Comma-separated list of paths to exclude from the default secured paths.
|
||||
*/
|
||||
private List<String> ignored = new ArrayList<String>();
|
||||
|
||||
private final User user = new User();
|
||||
|
||||
/**
|
||||
* Security filter chain order.
|
||||
*/
|
||||
private int filterOrder = DEFAULT_FILTER_ORDER;
|
||||
|
||||
public Headers getHeaders() {
|
||||
@@ -139,14 +154,29 @@ public class SecurityProperties implements SecurityPrequisite {
|
||||
NONE, DOMAIN, ALL
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable cross site scripting (XSS) protection.
|
||||
*/
|
||||
private boolean xss;
|
||||
|
||||
/**
|
||||
* Enable cache control HTTP headers.
|
||||
*/
|
||||
private boolean cache;
|
||||
|
||||
/**
|
||||
* Enable "X-Frame-Options" header.
|
||||
*/
|
||||
private boolean frame;
|
||||
|
||||
/**
|
||||
* Enable "X-Content-Type-Options" header.
|
||||
*/
|
||||
private boolean contentType;
|
||||
|
||||
/**
|
||||
* HTTP Strict Transport Security (HSTS) mode (none, domain, all).
|
||||
*/
|
||||
private HSTS hsts = HSTS.ALL;
|
||||
|
||||
public boolean isXss() {
|
||||
@@ -193,10 +223,19 @@ public class SecurityProperties implements SecurityPrequisite {
|
||||
|
||||
public static class Basic {
|
||||
|
||||
/**
|
||||
* Enable basic authentication.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* HTTP basic realm name.
|
||||
*/
|
||||
private String realm = "Spring";
|
||||
|
||||
/**
|
||||
* Comma-separated list of paths to secure.
|
||||
*/
|
||||
private String[] path = new String[] { "/**" };
|
||||
|
||||
public boolean isEnabled() {
|
||||
@@ -227,10 +266,19 @@ public class SecurityProperties implements SecurityPrequisite {
|
||||
|
||||
public static class User {
|
||||
|
||||
/**
|
||||
* Default user name.
|
||||
*/
|
||||
private String name = "user";
|
||||
|
||||
/**
|
||||
* Password for the default user name.
|
||||
*/
|
||||
private String password = UUID.randomUUID().toString();
|
||||
|
||||
/**
|
||||
* Granted roles for the default user name.
|
||||
*/
|
||||
private List<String> role = new ArrayList<String>(Arrays.asList("USER"));
|
||||
|
||||
private boolean defaultPassword = true;
|
||||
|
||||
@@ -26,8 +26,14 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
*/
|
||||
abstract class SocialProperties {
|
||||
|
||||
/**
|
||||
* Application id.
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* Application secret.
|
||||
*/
|
||||
private String appSecret;
|
||||
|
||||
public String getAppId() {
|
||||
|
||||
@@ -27,8 +27,14 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.data.solr")
|
||||
public class SolrProperties {
|
||||
|
||||
/**
|
||||
* Solr host. Ignored if "zk-host" is set.
|
||||
*/
|
||||
private String host = "http://127.0.0.1:8983/solr";
|
||||
|
||||
/**
|
||||
* ZooKeeper host address in the form HOST:PORT.
|
||||
*/
|
||||
private String zkHost;
|
||||
|
||||
public String getHost() {
|
||||
|
||||
@@ -31,18 +31,39 @@ import org.springframework.web.servlet.view.AbstractTemplateViewResolver;
|
||||
public abstract class AbstractTemplateViewResolverProperties extends
|
||||
AbstractViewResolverProperties {
|
||||
|
||||
/**
|
||||
* Prefix that gets prepended to view names when building a URL.
|
||||
*/
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* Suffix that gets appended to view names when building a URL.
|
||||
*/
|
||||
private String suffix;
|
||||
|
||||
/**
|
||||
* Name of the RequestContext attribute for all views.
|
||||
*/
|
||||
private String requestContextAttribute;
|
||||
|
||||
/**
|
||||
* Set whether all request attributes should be added to the model prior to merging with the template.
|
||||
*/
|
||||
private boolean exposeRequestAttributes = false;
|
||||
|
||||
/**
|
||||
* Set whether all HttpSession attributes should be added to the model prior to merging with the template.
|
||||
*/
|
||||
private boolean exposeSessionAttributes = false;
|
||||
|
||||
/**
|
||||
* Set whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name.
|
||||
*/
|
||||
private boolean allowRequestOverride = false;
|
||||
|
||||
/**
|
||||
* Set whether to expose a RequestContext for use by Spring's macro library, under the name "springMacroRequestContext".
|
||||
*/
|
||||
private boolean exposeSpringMacroHelpers = true;
|
||||
|
||||
protected AbstractTemplateViewResolverProperties(String defaultPrefix,
|
||||
|
||||
@@ -29,14 +29,29 @@ import org.springframework.web.servlet.ViewResolver;
|
||||
*/
|
||||
public abstract class AbstractViewResolverProperties {
|
||||
|
||||
/**
|
||||
* Enable template caching.
|
||||
*/
|
||||
private boolean cache;
|
||||
|
||||
/**
|
||||
* Content-Type value.
|
||||
*/
|
||||
private String contentType = "text/html";
|
||||
|
||||
/**
|
||||
* Template encoding.
|
||||
*/
|
||||
private String charset = "UTF-8";
|
||||
|
||||
/**
|
||||
* White list of view names that can be resolved.
|
||||
*/
|
||||
private String[] viewNames;
|
||||
|
||||
/**
|
||||
* Check that the templates location exists.
|
||||
*/
|
||||
private boolean checkTemplateLocation = true;
|
||||
|
||||
public void setCheckTemplateLocation(boolean checkTemplateLocation) {
|
||||
|
||||
@@ -31,22 +31,49 @@ public class ThymeleafProperties {
|
||||
|
||||
public static final String DEFAULT_SUFFIX = ".html";
|
||||
|
||||
/**
|
||||
* Check that the templates location exists.
|
||||
*/
|
||||
private boolean checkTemplateLocation = true;
|
||||
|
||||
/**
|
||||
* Prefix that gets prepended to view names when building a URL.
|
||||
*/
|
||||
private String prefix = DEFAULT_PREFIX;
|
||||
|
||||
/**
|
||||
* Suffix that gets appended to view names when building a URL.
|
||||
*/
|
||||
private String suffix = DEFAULT_SUFFIX;
|
||||
|
||||
/**
|
||||
* Template mode to be applied to templates. See also StandardTemplateModeHandlers.
|
||||
*/
|
||||
private String mode = "HTML5";
|
||||
|
||||
/**
|
||||
* Template encoding.
|
||||
*/
|
||||
private String encoding = "UTF-8";
|
||||
|
||||
/**
|
||||
* Content-Type value.
|
||||
*/
|
||||
private String contentType = "text/html";
|
||||
|
||||
/**
|
||||
* Enable template caching.
|
||||
*/
|
||||
private boolean cache = true;
|
||||
|
||||
/**
|
||||
* Comma-separated list of view names that can be resolved.
|
||||
*/
|
||||
private String[] viewNames;
|
||||
|
||||
/**
|
||||
* Comma-separated list of view names that should be excluded from resolution.
|
||||
*/
|
||||
private String[] excludedViewNames;
|
||||
|
||||
public boolean isCheckTemplateLocation() {
|
||||
|
||||
@@ -38,16 +38,37 @@ public class VelocityProperties extends AbstractTemplateViewResolverProperties {
|
||||
|
||||
public static final String DEFAULT_SUFFIX = ".vm";
|
||||
|
||||
/**
|
||||
* Name of the DateTool helper object to expose in the Velocity context of the view.
|
||||
*/
|
||||
private String dateToolAttribute;
|
||||
|
||||
/**
|
||||
* Name of the NumberTool helper object to expose in the Velocity context of the view.
|
||||
*/
|
||||
private String numberToolAttribute;
|
||||
|
||||
/**
|
||||
* Additional velocity properties.
|
||||
*/
|
||||
private Map<String, String> properties = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Template path.
|
||||
*/
|
||||
private String resourceLoaderPath = DEFAULT_RESOURCE_LOADER_PATH;
|
||||
|
||||
/**
|
||||
* Velocity Toolbox config location, for example "/WEB-INF/toolbox.xml". Automatically
|
||||
* loads a Velocity Tools toolbox definition file and expose all defined tools in the
|
||||
* specified scopes.
|
||||
*/
|
||||
private String toolboxConfigLocation;
|
||||
|
||||
/**
|
||||
* Prefer file system access for template loading. File system access enables hot
|
||||
* detection of template changes.
|
||||
*/
|
||||
private boolean preferFileSystemAccess = true;
|
||||
|
||||
public VelocityProperties() {
|
||||
|
||||
@@ -32,13 +32,13 @@ public class HttpEncodingProperties {
|
||||
public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
|
||||
|
||||
/**
|
||||
* The Charset to use.
|
||||
* Charset of HTTP requests and responses. Added to the "Content-Type" header if not
|
||||
* set explicitly.
|
||||
*/
|
||||
private Charset charset = DEFAULT_CHARSET;
|
||||
|
||||
/**
|
||||
* To force the encoding to the configured charset typically on HTTP requests and
|
||||
* responses.
|
||||
* Force the encoding to the configured charset on HTTP requests and responses.
|
||||
*/
|
||||
private boolean force = true;
|
||||
|
||||
|
||||
@@ -38,8 +38,14 @@ public class HttpMapperProperties {
|
||||
|
||||
private final Log logger = LogFactory.getLog(HttpMapperProperties.class);
|
||||
|
||||
/**
|
||||
* Enable json pretty print.
|
||||
*/
|
||||
private Boolean jsonPrettyPrint;
|
||||
|
||||
/**
|
||||
* Enable key sorting.
|
||||
*/
|
||||
private Boolean jsonSortKeys;
|
||||
|
||||
public void setJsonPrettyPrint(Boolean jsonPrettyPrint) {
|
||||
|
||||
@@ -50,12 +50,27 @@ import org.springframework.util.StringUtils;
|
||||
@ConfigurationProperties(prefix = "multipart", ignoreUnknownFields = false)
|
||||
public class MultipartProperties {
|
||||
|
||||
/**
|
||||
* Intermediate location of uploaded files.
|
||||
*/
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* Max file size. Values can use the suffixed "MB" or "KB" to indicate a Megabyte
|
||||
* or Kilobyte size.
|
||||
*/
|
||||
private String maxFileSize = "1Mb";
|
||||
|
||||
/**
|
||||
* Max request size. Values can use the suffixed "MB" or "KB" to indicate a Megabyte
|
||||
* or Kilobyte size.
|
||||
*/
|
||||
private String maxRequestSize = "10Mb";
|
||||
|
||||
/**
|
||||
* Threshold after which files will be written to disk. Values can use the suffixed "MB"
|
||||
* or "KB" to indicate a Megabyte or Kilobyte size.
|
||||
*/
|
||||
private String fileSizeThreshold = "0";
|
||||
|
||||
public String getMaxFileSize() {
|
||||
|
||||
@@ -27,8 +27,14 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.resources", ignoreUnknownFields = false)
|
||||
public class ResourceProperties {
|
||||
|
||||
/**
|
||||
* Cache period for the resources served by the resource handler, in seconds.
|
||||
*/
|
||||
private Integer cachePeriod;
|
||||
|
||||
/**
|
||||
* Enable default resource handling.
|
||||
*/
|
||||
private boolean addMappings = true;
|
||||
|
||||
public Integer getCachePeriod() {
|
||||
|
||||
@@ -58,17 +58,32 @@ import org.springframework.util.StringUtils;
|
||||
@ConfigurationProperties(prefix = "server", ignoreUnknownFields = false)
|
||||
public class ServerProperties implements EmbeddedServletContainerCustomizer {
|
||||
|
||||
/**
|
||||
* Server HTTP port.
|
||||
*/
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* Network address to which the server should bind to.
|
||||
*/
|
||||
private InetAddress address;
|
||||
|
||||
/**
|
||||
* Session timeout in seconds.
|
||||
*/
|
||||
private Integer sessionTimeout;
|
||||
|
||||
/**
|
||||
* Context path of the application.
|
||||
*/
|
||||
private String contextPath;
|
||||
|
||||
@NestedConfigurationProperty
|
||||
private Ssl ssl;
|
||||
|
||||
/**
|
||||
* Path of the main dispatcher servlet.
|
||||
*/
|
||||
@NotNull
|
||||
private String servletPath = "/";
|
||||
|
||||
@@ -76,6 +91,9 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
|
||||
|
||||
private final Undertow undertow = new Undertow();
|
||||
|
||||
/**
|
||||
* ServletContext parameters.
|
||||
*/
|
||||
private final Map<String, String> contextParameters = new HashMap<String, String>();
|
||||
|
||||
public Tomcat getTomcat() {
|
||||
@@ -223,29 +241,64 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
|
||||
|
||||
public static class Tomcat {
|
||||
|
||||
/**
|
||||
* Format pattern for access logs.
|
||||
*/
|
||||
private String accessLogPattern;
|
||||
|
||||
/**
|
||||
* Enable access log.
|
||||
*/
|
||||
private boolean accessLogEnabled = false;
|
||||
|
||||
/**
|
||||
* Regular expression that matches proxies that are to be trusted.
|
||||
*/
|
||||
private String internalProxies = "10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 10/8
|
||||
+ "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" // 192.168/16
|
||||
+ "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" // 169.254/16
|
||||
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"; // 127/8
|
||||
|
||||
/**
|
||||
* Header that holds the incoming protocol, usually named "X-Forwarded-Proto". Configured
|
||||
* as a RemoteIpValve only if remoteIpHeader is also set.
|
||||
*/
|
||||
private String protocolHeader;
|
||||
|
||||
/**
|
||||
* Name of the HTTP header used to override the original port value.
|
||||
*/
|
||||
private String portHeader;
|
||||
|
||||
/**
|
||||
* Name of the http header from which the remote ip is extracted. Configured as a
|
||||
* RemoteIpValve only if remoteIpHeader is also set.
|
||||
*/
|
||||
private String remoteIpHeader;
|
||||
|
||||
/**
|
||||
* Tomcat base directory. If not specified a temporary directory will be used.
|
||||
*/
|
||||
private File basedir;
|
||||
|
||||
/**
|
||||
* Delay in seconds between the invocation of backgroundProcess methods.
|
||||
*/
|
||||
private int backgroundProcessorDelay = 30; // seconds
|
||||
|
||||
/**
|
||||
* Maximum amount of worker threads.
|
||||
*/
|
||||
private int maxThreads = 0; // Number of threads in protocol handler
|
||||
|
||||
/**
|
||||
* Maximum size in bytes of the HTTP message header.
|
||||
*/
|
||||
private int maxHttpHeaderSize = 0; // bytes
|
||||
|
||||
/**
|
||||
* Character encoding to use to decode the URI.
|
||||
*/
|
||||
private String uriEncoding;
|
||||
|
||||
public int getMaxThreads() {
|
||||
@@ -409,12 +462,24 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer {
|
||||
|
||||
public static class Undertow {
|
||||
|
||||
/**
|
||||
* Size of each buffer in bytes.
|
||||
*/
|
||||
private Integer bufferSize;
|
||||
|
||||
/**
|
||||
* Number of buffer per region.
|
||||
*/
|
||||
private Integer buffersPerRegion;
|
||||
|
||||
/**
|
||||
* Number of I/O threads to create for the worker.
|
||||
*/
|
||||
private Integer ioThreads;
|
||||
|
||||
/**
|
||||
* Number of worker threads.
|
||||
*/
|
||||
private Integer workerThreads;
|
||||
|
||||
private Boolean directBuffers;
|
||||
|
||||
@@ -28,10 +28,19 @@ import org.springframework.validation.DefaultMessageCodesResolver;
|
||||
@ConfigurationProperties("spring.mvc")
|
||||
public class WebMvcProperties {
|
||||
|
||||
/**
|
||||
* Formatting strategy for message codes (PREFIX_ERROR_CODE, POSTFIX_ERROR_CODE).
|
||||
*/
|
||||
private DefaultMessageCodesResolver.Format messageCodesResolverFormat;
|
||||
|
||||
/**
|
||||
* Locale to use.
|
||||
*/
|
||||
private String locale;
|
||||
|
||||
/**
|
||||
* Date format to use (e.g. dd/MM/yyyy)
|
||||
*/
|
||||
private String dateFormat;
|
||||
|
||||
public DefaultMessageCodesResolver.Format getMessageCodesResolverFormat() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"name": "spring.aop.auto",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically adds @EnableAspectJAutoProxy.",
|
||||
"description": "Add @EnableAspectJAutoProxy.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
@@ -20,37 +20,37 @@
|
||||
{
|
||||
"name": "spring.dao.exceptiontranslation.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enables the PersistenceExceptionTranslationPostProcessor.",
|
||||
"description": "Enable the PersistenceExceptionTranslationPostProcessor.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.datasource.jmx-enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enables JMX support (if provided by the underlying pool).",
|
||||
"description": "Enable JMX support (if provided by the underlying pool).",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"name": "spring.data.elasticsearch.repositories.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically enable Elasticsearch repositories.",
|
||||
"description": "Enable Elasticsearch repositories.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.data.jpa.repositories.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically enable JPA repositories.",
|
||||
"description": "Enable JPA repositories.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.data.mongodb.repositories.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically enable Mongo repositories.",
|
||||
"description": "Enable Mongo repositories.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.data.solr.repositories.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically enable Solr repositories.",
|
||||
"description": "Enable Solr repositories.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
@@ -62,13 +62,13 @@
|
||||
{
|
||||
"name": "spring.jmx.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically expose management beans to the JMX domain",
|
||||
"description": "Expose management beans to the JMX domain.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "spring.jpa.open-in-view",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically register OpenEntityManagerInViewInterceptor. Binds a JPA EntityManager to the thread for the entire processing of the request.",
|
||||
"description": "Register OpenEntityManagerInViewInterceptor. Binds a JPA EntityManager to the thread for the entire processing of the request.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
@@ -92,7 +92,7 @@
|
||||
{
|
||||
"name": "spring.social.auto-connection-views",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Automatically enable the connection status view for supported providers.",
|
||||
"description": "Enable the connection status view for supported providers.",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user