more config checks on startup

This commit is contained in:
Athou
2014-12-04 10:52:41 +01:00
parent 9110cfd923
commit c702f47927
13 changed files with 47 additions and 31 deletions

View File

@@ -64,64 +64,74 @@ public class CommaFeedConfiguration extends Configuration {
public static class ApplicationSettings {
@NotNull
@NotBlank
@Valid
private String publicUrl;
@NotNull
private boolean allowRegistrations;
@Valid
private Boolean allowRegistrations;
private boolean createDemoAccount;
@NotNull
@Valid
private Boolean createDemoAccount;
private String googleAnalyticsTrackingCode;
@NotNull
@Min(1)
private int backgroundThreads;
@Valid
private Integer backgroundThreads;
@NotNull
@Min(1)
private int databaseUpdateThreads;
@Valid
private Integer databaseUpdateThreads;
private String smtpHost;
private int smtpPort;
private boolean smtpTls;
private String smtpUserName;
private String smtpPassword;
private String smtpFromAddress;
@NotNull
private boolean heavyLoad;
@Valid
private Boolean heavyLoad;
@NotNull
private boolean pubsubhubbub;
@Valid
private Boolean pubsubhubbub;
@NotNull
private boolean imageProxyEnabled;
@Valid
private Boolean imageProxyEnabled;
@NotNull
@Min(0)
private int queryTimeout;
@Valid
private Integer queryTimeout;
@NotNull
@Min(0)
private int keepStatusDays;
@Valid
private Integer keepStatusDays;
@NotNull
@Min(0)
private int maxFeedCapacity;
@Valid
private Integer maxFeedCapacity;
@NotNull
@Min(0)
private int refreshIntervalMinutes;
@Valid
private Integer refreshIntervalMinutes;
@NotNull
@Valid
private CacheType cache;
@NotNull
@Valid
private String announcement;
public Date getUnreadThreshold() {