forked from Archives/Athou_commafeed
configuration validation
This commit is contained in:
@@ -6,11 +6,13 @@ import io.dropwizard.db.DataSourceFactory;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@@ -34,21 +36,30 @@ public class CommaFeedConfiguration extends Configuration {
|
||||
@Getter
|
||||
public static class ApplicationSettings {
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@NotBlank
|
||||
private String contextPath;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@NotBlank
|
||||
private String publicUrl;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private boolean allowRegistrations;
|
||||
|
||||
@JsonProperty
|
||||
private String googleAnalyticsTrackingCode;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private int backgroundThreads;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private int databaseUpdateThreads;
|
||||
|
||||
@JsonProperty
|
||||
@@ -67,27 +78,38 @@ public class CommaFeedConfiguration extends Configuration {
|
||||
private String smtpPassword;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private boolean heavyLoad;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private boolean pubsubhubbub;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private boolean imageProxyEnabled;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@Min(0)
|
||||
private int queryTimeout;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@Min(0)
|
||||
private int keepStatusDays;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
@Min(0)
|
||||
private int refreshIntervalMinutes;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private CacheType cache;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private String announcement;
|
||||
|
||||
public Date getUnreadThreshold() {
|
||||
|
||||
Reference in New Issue
Block a user