-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added maintenance functionality for resolving orphaned alerts and con…
…ditions. Added system config for maintenance tasks.
- Loading branch information
Christiaan van Tienhoven
committed
Nov 13, 2017
1 parent
d3dca5f
commit 75964a8
Showing
12 changed files
with
597 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/org/graylog/plugins/aggregates/config/AggregatesConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.graylog.plugins.aggregates.config; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonAutoDetect | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@AutoValue | ||
public abstract class AggregatesConfig { | ||
|
||
@JsonProperty("purgeHistory") | ||
public abstract boolean purgeHistory(); | ||
|
||
@JsonProperty("historyRetention") | ||
public abstract String historyRetention(); | ||
|
||
@JsonProperty("resolveOrphanedAlerts") | ||
public abstract boolean resolveOrphanedAlerts(); | ||
|
||
|
||
@JsonCreator | ||
public static AggregatesConfig create(@JsonProperty("purgeHistory") boolean purgeHistory, | ||
@JsonProperty("historyRetention") String historyRetention, | ||
@JsonProperty("resolveOrphanedAlerts") boolean resolveOrphanedAlerts) { | ||
return builder() | ||
.purgeHistory(purgeHistory) | ||
.historyRetention(historyRetention) | ||
.resolveOrphanedAlerts(resolveOrphanedAlerts) | ||
.build(); | ||
} | ||
|
||
public static AggregatesConfig defaultConfig() { | ||
return builder() | ||
.purgeHistory(true) | ||
.historyRetention("P1M") | ||
.resolveOrphanedAlerts(false) | ||
.build(); | ||
} | ||
|
||
public static Builder builder() { | ||
return new AutoValue_AggregatesConfig.Builder(); | ||
} | ||
|
||
public abstract Builder toBuilder(); | ||
|
||
@AutoValue.Builder | ||
public static abstract class Builder { | ||
public abstract Builder purgeHistory(boolean purgeHistory); | ||
public abstract Builder historyRetention(String historyRetention); | ||
public abstract Builder resolveOrphanedAlerts(boolean resolveOrphanedAlerts); | ||
|
||
public abstract AggregatesConfig build(); | ||
} | ||
} |
Oops, something went wrong.