-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get /topics now retrieve partitions details
- Loading branch information
Showing
4 changed files
with
69 additions
and
41 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
29 changes: 4 additions & 25 deletions
29
src/main/java/com/greencomnetworks/franzmanager/entities/Topic.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 |
---|---|---|
@@ -1,49 +1,28 @@ | ||
package com.greencomnetworks.franzmanager.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class Topic { | ||
public final String id; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public final Integer partitions; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public final Integer replications; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public List<Partition> partitions; | ||
public final Map<String, String> configurations; | ||
|
||
@JsonCreator | ||
public Topic(@JsonProperty(value="id", required=true) String id, | ||
@JsonProperty("partitions") Integer partitions, | ||
@JsonProperty("replication") Integer replications, | ||
@JsonProperty("configurations") Map<String, String> configurations) { | ||
public Topic(String id, List<Partition> partitions, Map<String, String> configurations) { | ||
this.id = id; | ||
this.partitions = partitions; | ||
this.replications = replications; | ||
this.configurations = configurations; | ||
} | ||
|
||
public Topic(String id, | ||
Integer partitions, | ||
Integer replications) { | ||
this.id = id; | ||
this.partitions = partitions; | ||
this.replications = replications; | ||
this.configurations = null; | ||
} | ||
|
||
public Topic(String id) { | ||
this.id = id; | ||
this.partitions = null; | ||
this.replications = null; | ||
this.configurations = null; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Topic: " + id; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/greencomnetworks/franzmanager/entities/TopicCreation.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,33 @@ | ||
package com.greencomnetworks.franzmanager.entities; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Map; | ||
|
||
public class TopicCreation { | ||
public final String id; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public final Integer partitions; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public final Integer replications; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public final Map<String, String> configurations; | ||
|
||
@JsonCreator | ||
public TopicCreation(@JsonProperty(value = "id", required = true) String id, | ||
@JsonProperty("partitions") Integer partitions, | ||
@JsonProperty("replication") Integer replications, | ||
@JsonProperty("configurations") Map<String, String> configurations) { | ||
this.id = id; | ||
this.partitions = partitions; | ||
this.replications = replications; | ||
this.configurations = configurations; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Topic: " + id; | ||
} | ||
} |
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