@Config("pagination") public static class PaginationConfig { private boolean zeroBasedPageIndex = false; public boolean isZeroBasedPageIndex() { return zeroBasedPageIndex; } public PaginationConfig setZeroBasedPageIndex(boolean zeroBasedPageIndex) { this.zeroBasedPageIndex = zeroBasedPageIndex; return this; } }
@Config("config") public class ConfigConfig { private boolean watch = false; public boolean isWatch() { return watch; } public ConfigConfig setWatch(boolean watch) { this.watch = watch; return this; } }
@Config("cli") public class CliConfig { private String defaultCommand; public String getDefaultCommand() { return defaultCommand; } public boolean hasDefaultCommand() { return defaultCommand != null && !defaultCommand.isEmpty(); } }
@Config("cache") public static class CacheConfig { private static final int DEFAULT_CACHE_MAX_SIZE = 8192; private static final int DEFAULT_CACHE_CONCURRENCY = 32; private int maxSize = DEFAULT_CACHE_MAX_SIZE; private int initialSize = maxSize / 4; private int concurrencyLevel = DEFAULT_CACHE_CONCURRENCY; public int getInitialSize() { return initialSize; } public int getMaxSize() { return maxSize; } public int getConcurrencyLevel() { return concurrencyLevel; } } }
@Config("audit") public class AuditConfig { private Set<Class<? extends TrailWriter>> writers = new HashSet<>(); private Set<Class<? extends TrailExceptionHandler<?>>> exceptionHandlers = new HashSet<>(); public Set<Class<? extends TrailWriter>> getWriters() { return Collections.unmodifiableSet(writers); } public AuditConfig addWriter(Class<? extends TrailWriter> trailWriterClass) { this.writers.add(trailWriterClass); return this; } public Set<Class<? extends TrailExceptionHandler<?>>> getExceptionHandlers() { return Collections.unmodifiableSet(exceptionHandlers); } public AuditConfig addExceptionHandler(Class<? extends TrailExceptionHandler<?>> exceptionHandler) { this.exceptionHandlers.add(exceptionHandler); return this; } }
@Config("cache") public static class CacheConfig { private static final int DEFAULT_CACHE_MAX_SIZE = 8192; private static final int DEFAULT_CACHE_CONCURRENCY = 32; private int maxSize = DEFAULT_CACHE_MAX_SIZE; private int initialSize; private int concurrencyLevel; public CacheConfig() { this.initialSize = this.maxSize / 4; this.concurrencyLevel = DEFAULT_CACHE_CONCURRENCY; } public int getInitialSize() { return this.initialSize; } public int getMaxSize() { return this.maxSize; } public int getConcurrencyLevel() { return this.concurrencyLevel; } } }
@Config("exceptionMapping") public static class ExceptionMappingConfig { private boolean security = true; private boolean all = true; private boolean validation = true; private boolean detailedLog = true; private boolean detailedUserMessage = false; public boolean isSecurity() { return security; } public boolean isAll() { return all; } public boolean isValidation() { return validation; } public boolean isDetailedLog() { return detailedLog; } public boolean isDetailedUserMessage() { return detailedUserMessage; } } }
@Config("jndi") public class JndiConfig { @NotNull private Map<String, String> additionalContexts = new HashMap<>(); public Map<String, String> getAdditionalContexts() { return Collections.unmodifiableMap(additionalContexts); } public JndiConfig addAdditionalContext(String name, String propertiesPath) { this.additionalContexts.put(name, propertiesPath); return this; } }
@Config("subject") public static class SubjectConfig { private Class<? extends SubjectDAO> dao; private Class<? extends SubjectContext> context; private Class<? extends SubjectFactory> factory; public Class<? extends SubjectDAO> getDao() { return dao; } public SubjectConfig setDao(Class<? extends SubjectDAO> dao) { this.dao = dao; return this; } public Class<? extends SubjectContext> getContext() { return context; } public SubjectConfig setContext(Class<? extends SubjectContext> context) { this.context = context; return this; } public Class<? extends SubjectFactory> getFactory() { return factory; } public SubjectConfig setFactory(Class<? extends SubjectFactory> factory) { this.factory = factory; return this; } }
@Config("data") public static class DataConfig { private boolean importOnStart = true;
@Config("spring") public class SpringConfig { private boolean autodetect = true;
@Config("form") public static class FormConfig { private String usernameParameter = "username";
@Config("web.server.undertow") public class UndertowConfig { private static final int coreCount = Math.max(1, Runtime.getRuntime().availableProcessors());
@Config("netflix.hystrix") public class HystrixConfig { private MetricsConfig metrics = new MetricsConfig();
@Config("sessions") public static class SessionsConfig { private static final int DEFAULT_SESSION_TIMEOUT = 1000 * 60 * 15; @SingleValue private int timeout = DEFAULT_SESSION_TIMEOUT; public int getTimeout() { return timeout; } public SessionsConfig setTimeout(int timeout) { this.timeout = timeout; return this; } } }
@Config("cors") public static class CORSConfig { @SingleValue private boolean enabled; private String path = "/*"; private Map<String, String> properties = new HashMap<>(); public boolean isEnabled() { return enabled; } public String getPath() { return path; } public Map<String, String> getProperties() { return properties; } }
@Config("metrics") public static class MetricsConfig { @SingleValue private boolean enabled = true; private String servletPath = "/hystrix.stream"; public boolean isEnabled() { return enabled; } public MetricsConfig setEnabled(boolean enabled) { this.enabled = enabled; return this; } public String getServletPath() { return servletPath; } public MetricsConfig setServletPath(String servletPath) { this.servletPath = servletPath; return this; } } }
@Config("jta") public static class JtaConfig { private static final String DEFAULT_USER_TRANSACTION_NAME = "java:comp/UserTransaction"; @SingleValue private String txManagerName; private String userTxName = DEFAULT_USER_TRANSACTION_NAME; public String getTxManagerName() { return txManagerName; } public JtaConfig setTxManagerName(String txManagerName) { this.txManagerName = txManagerName; return this; } public String getUserTxName() { return userTxName; } public JtaConfig setUserTxName(String userTxName) { this.userTxName = userTxName; return this; } } }
@Config("authentication") public static class AuthenticationConfig { @SingleValue private Class<? extends AuthenticationStrategy> strategy = AtLeastOneSuccessfulStrategy.class; private Class<? extends Authenticator> authenticator = ModularRealmAuthenticator.class; private Class<? extends CredentialsMatcher> credentialsMatcher = SimpleCredentialsMatcher.class; public Class<? extends Authenticator> getAuthenticator() { return authenticator; } public AuthenticationConfig setAuthenticator(Class<? extends Authenticator> authenticator) { this.authenticator = authenticator; return this; } public Class<? extends AuthenticationStrategy> getStrategy() { return strategy; } public AuthenticationConfig setStrategy( Class<? extends AuthenticationStrategy> strategy) { this.strategy = strategy; return this; } public Class<? extends CredentialsMatcher> getCredentialsMatcher() { return credentialsMatcher; } public AuthenticationConfig setCredentialsMatcher(Class<? extends CredentialsMatcher> credentialsMatcher) { this.credentialsMatcher = credentialsMatcher; return this; } }
@Config("proxy") public class ProxyConfig { @NotNull