package Ġcom . gr afka . resolvers Ċ Ċ import Ġcom . co xa ut ode v . graphql . tools . GraphQL Mutation Resolver Ċ import Ġcom . gr afka . configs . Kafka Client Factory Ċ import Ġcom . gr afka . entities . topics . Kafka New Topic Request Ċ import Ġcom . gr afka . entities . topics . Kafka Replication Assignment Ċ import Ġcom . gr afka . entities . topics . Kafka Topic Config Ċ import Ġorg . springframework . stereotype . Component Ċ Ċ @ Component Ċ class ĠKafka Topic Mutation Resolver ( private Ġval Ġadmin Client Factory : ĠKafka Client Factory ) Ġ: ĠGraphQL Mutation Resolver Ġ{ ĊĊĠĠĠ Ġfun Ġnew Topic By Partition And Replication Factor ( cluster Id : ĠString , Ġtopic Name : ĠString , Ġpartition Count : ĠInt , Ġreplication Factor : ĠShort , Ġconfigs : ĠList < Kafka Topic Config > ?) Ġ= Ġcreate Topic ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcluster Id , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠKafka New Topic Request . create ( topic Name , Ġpartition Count , Ġreplication Factor , Ġconfigs ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġfun Ġnew Topic By Replication Assignments ( cluster Id : ĠString , Ġtopic Name : ĠString , Ġreplication Assignments : ĠList < Kafka Replication Assignment >, Ġconfigs : ĠList < Kafka Topic Config > ?) Ġ= Ġcreate Topic ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcluster Id , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠKafka New Topic Request . create ( topic Name , Ġreplication Assignments , Ġconfigs ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Topic ( cluster Id : ĠString , Ġrequest : ĠKafka New Topic Request ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġadmin Client Factory ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. get Admin Client ( cluster Id ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. create Topics ( listOf ( request . to New Topic ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. all () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. get () ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠ Ġ} Ċ Ċ }