Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracting DTOs from ExtractorsResource.
(cherry picked from commit db9cba7b22bd199f919ae904fcd77ecf5bde4410)
- Loading branch information
1 parent
f512e22
commit 209959a
Showing
4 changed files
with
146 additions
and
32 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...in/java/org/graylog2/rest/models/system/inputs/extractors/responses/ExtractorMetrics.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
package org.graylog2.rest.models.system.inputs.extractors.responses; | |||
|
|||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||
import com.fasterxml.jackson.annotation.JsonCreator; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import com.google.auto.value.AutoValue; | |||
|
|||
import java.util.Map; | |||
|
|||
@AutoValue | |||
@JsonAutoDetect | |||
public abstract class ExtractorMetrics { | |||
|
|||
@JsonProperty | |||
public abstract Map<String, Object> total(); | |||
|
|||
@JsonProperty | |||
public abstract Map<String, Object> converters(); | |||
|
|||
@JsonCreator | |||
public static ExtractorMetrics create(@JsonProperty("total") Map<String, Object> total, | |||
@JsonProperty("converters") Map<String, Object> converters) { | |||
return new AutoValue_ExtractorMetrics(total, converters); | |||
} | |||
} |
77 changes: 77 additions & 0 deletions
77
...in/java/org/graylog2/rest/models/system/inputs/extractors/responses/ExtractorSummary.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,77 @@ | |||
package org.graylog2.rest.models.system.inputs.extractors.responses; | |||
|
|||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||
import com.fasterxml.jackson.annotation.JsonCreator; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import com.google.auto.value.AutoValue; | |||
|
|||
import java.util.List; | |||
import java.util.Map; | |||
|
|||
@AutoValue | |||
@JsonAutoDetect | |||
public abstract class ExtractorSummary { | |||
@JsonProperty | |||
public abstract String id(); | |||
|
|||
@JsonProperty | |||
public abstract String title(); | |||
|
|||
@JsonProperty | |||
public abstract String type(); | |||
|
|||
@JsonProperty("cursor_strategy") | |||
public abstract String cursorStrategy(); | |||
|
|||
@JsonProperty("source_field") | |||
public abstract String sourceField(); | |||
|
|||
@JsonProperty("target_field") | |||
public abstract String targetField(); | |||
|
|||
@JsonProperty("extractor_config") | |||
public abstract Map<String, Object> extractorConfig(); | |||
|
|||
@JsonProperty("creator_user_id") | |||
public abstract String creatorUserId(); | |||
|
|||
@JsonProperty | |||
public abstract List<Map<String, Object>> converters(); | |||
|
|||
@JsonProperty("condition_type") | |||
public abstract String conditionType(); | |||
|
|||
@JsonProperty("condition_value") | |||
public abstract String conditionValue(); | |||
|
|||
@JsonProperty | |||
public abstract Long order(); | |||
|
|||
@JsonProperty | |||
public abstract Long exceptions(); | |||
|
|||
@JsonProperty("converter_exceptions") | |||
public abstract Long converterExceptions(); | |||
|
|||
@JsonProperty | |||
public abstract ExtractorMetrics metrics(); | |||
|
|||
@JsonCreator | |||
public static ExtractorSummary create(@JsonProperty("id") String id, | |||
@JsonProperty("title") String title, | |||
@JsonProperty("type") String type, | |||
@JsonProperty("cursor_strategy") String cursorStrategy, | |||
@JsonProperty("source_field") String sourceField, | |||
@JsonProperty("target_field") String targetField, | |||
@JsonProperty("extractor_config") Map<String, Object> extractorConfig, | |||
@JsonProperty("creator_user_id") String creatorUserId, | |||
@JsonProperty("converters") List<Map<String, Object>> converters, | |||
@JsonProperty("condition_type") String conditionType, | |||
@JsonProperty("condition_value") String conditionValue, | |||
@JsonProperty("order") Long order, | |||
@JsonProperty("exceptions") Long exceptions, | |||
@JsonProperty("converter_exceptions") Long converterExceptions, | |||
@JsonProperty("metrics") ExtractorMetrics metrics) { | |||
return new AutoValue_ExtractorSummary(id, title, type, cursorStrategy, sourceField, targetField, extractorConfig, creatorUserId, converters, conditionType, conditionValue, order, exceptions, converterExceptions, metrics); | |||
} | |||
} |
28 changes: 28 additions & 0 deletions
28
...ava/org/graylog2/rest/models/system/inputs/extractors/responses/ExtractorSummaryList.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
package org.graylog2.rest.models.system.inputs.extractors.responses; | |||
|
|||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||
import com.fasterxml.jackson.annotation.JsonCreator; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import com.google.auto.value.AutoValue; | |||
|
|||
import java.util.List; | |||
|
|||
@AutoValue | |||
@JsonAutoDetect | |||
public abstract class ExtractorSummaryList { | |||
@JsonProperty | |||
public abstract int total(); | |||
|
|||
@JsonProperty | |||
public abstract List<ExtractorSummary> extractors(); | |||
|
|||
@JsonCreator | |||
public static ExtractorSummaryList create(@JsonProperty("total") int total, | |||
@JsonProperty("extractors") List<ExtractorSummary> extractors) { | |||
return new AutoValue_ExtractorSummaryList(total, extractors); | |||
} | |||
|
|||
public static ExtractorSummaryList create(List<ExtractorSummary> extractors) { | |||
return new AutoValue_ExtractorSummaryList(extractors.size(), extractors); | |||
} | |||
} |
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