From 9fe32d1844376df51753ac23dc7874663eb6a7e8 Mon Sep 17 00:00:00 2001 From: Ankit Choudhary Date: Fri, 24 Dec 2021 17:41:15 +0530 Subject: [PATCH 1/4] merged label-application-rules schema into the labels schema --- .../graphql/impl/GraphQlModule.java | 2 - .../LabelApplicationRuleSchemaFragment.java | 23 ----------- .../LabelApplicationRuleSchemaModule.java | 21 ---------- .../LabelApplicationRuleMutationSchema.java | 41 ------------------- .../LabelApplicationRuleQuerySchema.java | 17 -------- .../build.gradle.kts | 2 + .../label}/dao/LabelApplicationRuleDao.java | 12 +++--- .../LabelApplicationRuleIdArgument.java | 2 +- .../fetcher/LabelApplicationRuleFetcher.java | 6 +-- .../LabelApplicationRuleCreateMutator.java | 8 ++-- .../LabelApplicationRuleDeleteMutator.java | 6 +-- .../LabelApplicationRuleUpdateMutator.java | 8 ++-- .../LabelApplicationRuleCreateRequest.java | 4 +- .../LabelApplicationRuleDeleteRequest.java | 2 +- .../LabelApplicationRuleRequestBuilder.java | 2 +- .../LabelApplicationRuleUpdateRequest.java | 4 +- .../graphql/label/schema}/Action.java | 2 +- .../graphql/label/schema}/Condition.java | 2 +- .../label/schema}/LabelApplicationRule.java | 2 +- .../schema}/LabelApplicationRuleData.java | 2 +- .../LabelApplicationRuleResultSet.java | 3 +- .../graphql/label/schema/LabelSchema.java | 8 ++++ .../graphql/label/schema}/LeafCondition.java | 2 +- .../graphql/label/schema}/StaticLabels.java | 2 +- .../label/schema}/StringCondition.java | 2 +- .../graphql/label/schema}/UnaryCondition.java | 2 +- .../graphql/label/schema}/ValueCondition.java | 2 +- .../schema/mutation/LabelMutationSchema.java | 32 +++++++++++++++ .../build.gradle.kts | 1 + .../graphql/label/LabelSchemaModule.java | 6 +++ .../LabelApplicationRuleConfigServiceDao.java | 12 +++--- .../dao/LabelApplicationRuleDaoModule.java | 2 +- .../LabelApplicationRuleRequestConverter.java | 35 +++++++--------- ...LabelApplicationRuleResponseConverter.java | 22 +++++----- ...licationRuleDataDeserializationConfig.java | 18 ++++---- ...lApplicationRuleDeserializationConfig.java | 20 ++++----- ...lApplicationRuleDeserializationModule.java | 2 +- ...abelApplicationRuleRequestBuilderImpl.java | 8 ++-- .../LabelApplicationRuleRequestModule.java | 2 +- 39 files changed, 144 insertions(+), 205 deletions(-) delete mode 100644 hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaFragment.java delete mode 100644 hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaModule.java delete mode 100644 hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/mutation/LabelApplicationRuleMutationSchema.java delete mode 100644 hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query/LabelApplicationRuleQuerySchema.java rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/dao/LabelApplicationRuleDao.java (50%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/deserialization/LabelApplicationRuleIdArgument.java (72%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/fetcher/LabelApplicationRuleFetcher.java (84%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/mutator/LabelApplicationRuleCreateMutator.java (80%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/mutator/LabelApplicationRuleDeleteMutator.java (84%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/mutator/LabelApplicationRuleUpdateMutator.java (80%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/request/LabelApplicationRuleCreateRequest.java (56%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/request/LabelApplicationRuleDeleteRequest.java (72%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/request/LabelApplicationRuleRequestBuilder.java (90%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label}/request/LabelApplicationRuleUpdateRequest.java (56%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/Action.java (95%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/Condition.java (86%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/LabelApplicationRule.java (90%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/LabelApplicationRuleData.java (93%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/LabelApplicationRuleResultSet.java (78%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/LeafCondition.java (89%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/StaticLabels.java (85%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/StringCondition.java (91%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/UnaryCondition.java (89%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared => hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema}/ValueCondition.java (93%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/dao/LabelApplicationRuleConfigServiceDao.java (90%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/dao/LabelApplicationRuleDaoModule.java (91%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/dao/LabelApplicationRuleRequestConverter.java (80%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/dao/LabelApplicationRuleResponseConverter.java (93%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/deserialization/LabelApplicationRuleDataDeserializationConfig.java (84%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/deserialization/LabelApplicationRuleDeserializationConfig.java (84%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/deserialization/LabelApplicationRuleDeserializationModule.java (92%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/request/LabelApplicationRuleRequestBuilderImpl.java (87%) rename {hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules => hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label}/request/LabelApplicationRuleRequestModule.java (85%) diff --git a/hypertrace-graphql-impl/src/main/java/org/hypertrace/graphql/impl/GraphQlModule.java b/hypertrace-graphql-impl/src/main/java/org/hypertrace/graphql/impl/GraphQlModule.java index f8198506..72e21f4a 100644 --- a/hypertrace-graphql-impl/src/main/java/org/hypertrace/graphql/impl/GraphQlModule.java +++ b/hypertrace-graphql-impl/src/main/java/org/hypertrace/graphql/impl/GraphQlModule.java @@ -27,7 +27,6 @@ import org.hypertrace.graphql.explorer.ExplorerSchemaModule; import org.hypertrace.graphql.explorer.context.HypertraceExplorerContextModule; import org.hypertrace.graphql.label.LabelSchemaModule; -import org.hypertrace.graphql.label.application.rules.LabelApplicationRuleSchemaModule; import org.hypertrace.graphql.metric.MetricModule; import org.hypertrace.graphql.spaces.SpacesSchemaModule; import org.hypertrace.graphql.utils.metrics.gateway.GatewayMetricUtilsModule; @@ -74,6 +73,5 @@ protected void configure() { install(new SpacesSchemaModule()); install(new RequestTransformationModule()); install(new LabelSchemaModule()); - install(new LabelApplicationRuleSchemaModule()); } } diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaFragment.java b/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaFragment.java deleted file mode 100644 index 2a2f6c17..00000000 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaFragment.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.hypertrace.graphql.label.application.rules; - -import org.hypertrace.core.graphql.spi.schema.GraphQlSchemaFragment; -import org.hypertrace.graphql.label.application.rules.schema.mutation.LabelApplicationRuleMutationSchema; -import org.hypertrace.graphql.label.application.rules.schema.query.LabelApplicationRuleQuerySchema; - -public class LabelApplicationRuleSchemaFragment implements GraphQlSchemaFragment { - - @Override - public String fragmentName() { - return "Label Application Rules Schema"; - } - - @Override - public Class annotatedQueryClass() { - return LabelApplicationRuleQuerySchema.class; - } - - @Override - public Class annotatedMutationClass() { - return LabelApplicationRuleMutationSchema.class; - } -} diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaModule.java b/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaModule.java deleted file mode 100644 index c3a37921..00000000 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/LabelApplicationRuleSchemaModule.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.hypertrace.graphql.label.application.rules; - -import com.google.inject.AbstractModule; -import com.google.inject.multibindings.Multibinder; -import org.hypertrace.core.graphql.spi.schema.GraphQlSchemaFragment; -import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDaoModule; -import org.hypertrace.graphql.label.application.rules.deserialization.LabelApplicationRuleDeserializationModule; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleRequestModule; - -public class LabelApplicationRuleSchemaModule extends AbstractModule { - @Override - protected void configure() { - Multibinder.newSetBinder(binder(), GraphQlSchemaFragment.class) - .addBinding() - .to(LabelApplicationRuleSchemaFragment.class); - - install(new LabelApplicationRuleDaoModule()); - install(new LabelApplicationRuleRequestModule()); - install(new LabelApplicationRuleDeserializationModule()); - } -} diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/mutation/LabelApplicationRuleMutationSchema.java b/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/mutation/LabelApplicationRuleMutationSchema.java deleted file mode 100644 index b811c638..00000000 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/mutation/LabelApplicationRuleMutationSchema.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.hypertrace.graphql.label.application.rules.schema.mutation; - -import graphql.annotations.annotationTypes.GraphQLDataFetcher; -import graphql.annotations.annotationTypes.GraphQLField; -import graphql.annotations.annotationTypes.GraphQLName; -import graphql.annotations.annotationTypes.GraphQLNonNull; -import org.hypertrace.graphql.label.application.rules.deserialization.LabelApplicationRuleIdArgument; -import org.hypertrace.graphql.label.application.rules.mutator.LabelApplicationRuleCreateMutator; -import org.hypertrace.graphql.label.application.rules.mutator.LabelApplicationRuleDeleteMutator; -import org.hypertrace.graphql.label.application.rules.mutator.LabelApplicationRuleUpdateMutator; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData; - -public interface LabelApplicationRuleMutationSchema { - String CREATE_LABEL_APPLICATION_RULE = "createLabelApplicationRule"; - String UPDATE_LABEL_APPLICATION_RULE = "updateLabelApplicationRule"; - String DELETE_LABEL_APPLICATION_RULE = "deleteLabelApplicationRule"; - - @GraphQLField - @GraphQLNonNull - @GraphQLName(CREATE_LABEL_APPLICATION_RULE) - @GraphQLDataFetcher(LabelApplicationRuleCreateMutator.class) - LabelApplicationRule createLabelApplicationRule( - @GraphQLNonNull @GraphQLName(LabelApplicationRuleData.ARGUMENT_NAME) - LabelApplicationRuleData labelApplicationRuleData); - - @GraphQLField - @GraphQLNonNull - @GraphQLName(UPDATE_LABEL_APPLICATION_RULE) - @GraphQLDataFetcher(LabelApplicationRuleUpdateMutator.class) - LabelApplicationRule updateLabelApplicationRule( - @GraphQLNonNull @GraphQLName(LabelApplicationRule.ARGUMENT_NAME) - LabelApplicationRule labelApplicationRule); - - @GraphQLField - @GraphQLNonNull - @GraphQLName(DELETE_LABEL_APPLICATION_RULE) - @GraphQLDataFetcher(LabelApplicationRuleDeleteMutator.class) - Boolean deleteLabelApplicationRule( - @GraphQLNonNull @GraphQLName(LabelApplicationRuleIdArgument.ARGUMENT_NAME) String id); -} diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query/LabelApplicationRuleQuerySchema.java b/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query/LabelApplicationRuleQuerySchema.java deleted file mode 100644 index bcde3c49..00000000 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query/LabelApplicationRuleQuerySchema.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.hypertrace.graphql.label.application.rules.schema.query; - -import graphql.annotations.annotationTypes.GraphQLDataFetcher; -import graphql.annotations.annotationTypes.GraphQLField; -import graphql.annotations.annotationTypes.GraphQLName; -import graphql.annotations.annotationTypes.GraphQLNonNull; -import org.hypertrace.graphql.label.application.rules.fetcher.LabelApplicationRuleFetcher; - -public interface LabelApplicationRuleQuerySchema { - String LABEL_APPLICATION_RULE_QUERY_NAME = "labelApplicationRules"; - - @GraphQLField - @GraphQLNonNull - @GraphQLName(LABEL_APPLICATION_RULE_QUERY_NAME) - @GraphQLDataFetcher(LabelApplicationRuleFetcher.class) - LabelApplicationRuleResultSet labelApplicationRules(); -} diff --git a/hypertrace-graphql-labels-schema-api/build.gradle.kts b/hypertrace-graphql-labels-schema-api/build.gradle.kts index 260d842f..60951475 100644 --- a/hypertrace-graphql-labels-schema-api/build.gradle.kts +++ b/hypertrace-graphql-labels-schema-api/build.gradle.kts @@ -13,6 +13,8 @@ dependencies { annotationProcessor("org.projectlombok:lombok") compileOnly("org.projectlombok:lombok") + + implementation("org.hypertrace.core.graphql:hypertrace-core-graphql-deserialization") } tasks.test { diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleDao.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDao.java similarity index 50% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleDao.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDao.java index a52ea49d..428917b1 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleDao.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDao.java @@ -1,12 +1,12 @@ -package org.hypertrace.graphql.label.application.rules.dao; +package org.hypertrace.graphql.label.dao; import io.reactivex.rxjava3.core.Single; import org.hypertrace.core.graphql.common.request.ContextualRequest; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleCreateRequest; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleDeleteRequest; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleUpdateRequest; -import org.hypertrace.graphql.label.application.rules.schema.query.LabelApplicationRuleResultSet; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; +import org.hypertrace.graphql.label.request.LabelApplicationRuleCreateRequest; +import org.hypertrace.graphql.label.request.LabelApplicationRuleDeleteRequest; +import org.hypertrace.graphql.label.request.LabelApplicationRuleUpdateRequest; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; public interface LabelApplicationRuleDao { Single createLabelApplicationRule( diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleIdArgument.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleIdArgument.java similarity index 72% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleIdArgument.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleIdArgument.java index b41688cc..611895d7 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleIdArgument.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleIdArgument.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.deserialization; +package org.hypertrace.graphql.label.deserialization; import org.hypertrace.core.graphql.deserialization.PrimitiveArgument; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/fetcher/LabelApplicationRuleFetcher.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/fetcher/LabelApplicationRuleFetcher.java similarity index 84% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/fetcher/LabelApplicationRuleFetcher.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/fetcher/LabelApplicationRuleFetcher.java index 444c7ddd..ac2603ed 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/fetcher/LabelApplicationRuleFetcher.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/fetcher/LabelApplicationRuleFetcher.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.fetcher; +package org.hypertrace.graphql.label.fetcher; import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; @@ -6,8 +6,8 @@ import javax.inject.Inject; import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher; import org.hypertrace.core.graphql.common.request.ContextualRequestBuilder; -import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao; -import org.hypertrace.graphql.label.application.rules.schema.query.LabelApplicationRuleResultSet; +import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; public class LabelApplicationRuleFetcher extends InjectableDataFetcher { diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleCreateMutator.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleCreateMutator.java similarity index 80% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleCreateMutator.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleCreateMutator.java index d8fe6fb1..855e8995 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleCreateMutator.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleCreateMutator.java @@ -1,13 +1,13 @@ -package org.hypertrace.graphql.label.application.rules.mutator; +package org.hypertrace.graphql.label.mutator; import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; import java.util.concurrent.CompletableFuture; import javax.inject.Inject; import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher; -import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleRequestBuilder; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; +import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao; +import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; public class LabelApplicationRuleCreateMutator extends InjectableDataFetcher { diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleDeleteMutator.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleDeleteMutator.java similarity index 84% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleDeleteMutator.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleDeleteMutator.java index c2fadffe..2cd2aa1e 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleDeleteMutator.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleDeleteMutator.java @@ -1,12 +1,12 @@ -package org.hypertrace.graphql.label.application.rules.mutator; +package org.hypertrace.graphql.label.mutator; import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; import java.util.concurrent.CompletableFuture; import javax.inject.Inject; import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher; -import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleRequestBuilder; +import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao; +import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder; public class LabelApplicationRuleDeleteMutator extends InjectableDataFetcher { public LabelApplicationRuleDeleteMutator() { diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleUpdateMutator.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleUpdateMutator.java similarity index 80% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleUpdateMutator.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleUpdateMutator.java index f9d8eea3..b8415201 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/mutator/LabelApplicationRuleUpdateMutator.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleUpdateMutator.java @@ -1,13 +1,13 @@ -package org.hypertrace.graphql.label.application.rules.mutator; +package org.hypertrace.graphql.label.mutator; import graphql.schema.DataFetcher; import graphql.schema.DataFetchingEnvironment; import java.util.concurrent.CompletableFuture; import javax.inject.Inject; import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher; -import org.hypertrace.graphql.label.application.rules.dao.LabelApplicationRuleDao; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleRequestBuilder; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; +import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao; +import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; public class LabelApplicationRuleUpdateMutator extends InjectableDataFetcher { diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleCreateRequest.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleCreateRequest.java similarity index 56% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleCreateRequest.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleCreateRequest.java index 2f9eb649..066a8e28 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleCreateRequest.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleCreateRequest.java @@ -1,7 +1,7 @@ -package org.hypertrace.graphql.label.application.rules.request; +package org.hypertrace.graphql.label.request; import org.hypertrace.core.graphql.common.request.ContextualRequest; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; public interface LabelApplicationRuleCreateRequest extends ContextualRequest { LabelApplicationRuleData labelApplicationRuleData(); diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleDeleteRequest.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleDeleteRequest.java similarity index 72% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleDeleteRequest.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleDeleteRequest.java index c7425dd4..7a71c1cb 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleDeleteRequest.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleDeleteRequest.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.request; +package org.hypertrace.graphql.label.request; import org.hypertrace.core.graphql.common.request.ContextualRequest; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestBuilder.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilder.java similarity index 90% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestBuilder.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilder.java index 589aaf2a..ff61d509 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestBuilder.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilder.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.request; +package org.hypertrace.graphql.label.request; import java.util.Map; import org.hypertrace.core.graphql.context.GraphQlRequestContext; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleUpdateRequest.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleUpdateRequest.java similarity index 56% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleUpdateRequest.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleUpdateRequest.java index 04f8ffc2..83760fdf 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleUpdateRequest.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleUpdateRequest.java @@ -1,7 +1,7 @@ -package org.hypertrace.graphql.label.application.rules.request; +package org.hypertrace.graphql.label.request; import org.hypertrace.core.graphql.common.request.ContextualRequest; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; public interface LabelApplicationRuleUpdateRequest extends ContextualRequest { LabelApplicationRule labelApplicationRule(); diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/Action.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Action.java similarity index 95% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/Action.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Action.java index e8673193..ce587a6b 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/Action.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Action.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/Condition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Condition.java similarity index 86% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/Condition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Condition.java index 6a3d1b1a..0de72ca6 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/Condition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Condition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LabelApplicationRule.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRule.java similarity index 90% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LabelApplicationRule.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRule.java index 4ffa4010..725b366f 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LabelApplicationRule.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRule.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LabelApplicationRuleData.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleData.java similarity index 93% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LabelApplicationRuleData.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleData.java index 3bd900e0..9d45da8d 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LabelApplicationRuleData.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleData.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query/LabelApplicationRuleResultSet.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleResultSet.java similarity index 78% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query/LabelApplicationRuleResultSet.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleResultSet.java index 3f002bf9..13f4a55c 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/query/LabelApplicationRuleResultSet.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleResultSet.java @@ -1,11 +1,10 @@ -package org.hypertrace.graphql.label.application.rules.schema.query; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; import java.util.List; import org.hypertrace.core.graphql.common.schema.results.ResultSet; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; @GraphQLName(LabelApplicationRuleResultSet.TYPE_NAME) public interface LabelApplicationRuleResultSet extends ResultSet { diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java index c5b7f0c1..5b9bdf3c 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java @@ -4,14 +4,22 @@ import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; +import org.hypertrace.graphql.label.fetcher.LabelApplicationRuleFetcher; import org.hypertrace.graphql.label.fetcher.LabelFetcher; public interface LabelSchema { String LABELS_QUERY_NAME = "labels"; + String LABEL_APPLICATION_RULE_QUERY_NAME = "labelApplicationRules"; @GraphQLField @GraphQLNonNull @GraphQLName(LABELS_QUERY_NAME) @GraphQLDataFetcher(LabelFetcher.class) LabelResultSet labels(); + + @GraphQLField + @GraphQLNonNull + @GraphQLName(LABEL_APPLICATION_RULE_QUERY_NAME) + @GraphQLDataFetcher(LabelApplicationRuleFetcher.class) + LabelApplicationRuleResultSet labelApplicationRules(); } diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LeafCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LeafCondition.java similarity index 89% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LeafCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LeafCondition.java index f5e60fa5..eccbe85d 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/LeafCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LeafCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/StaticLabels.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StaticLabels.java similarity index 85% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/StaticLabels.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StaticLabels.java index 697a96de..5be2574f 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/StaticLabels.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StaticLabels.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/StringCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StringCondition.java similarity index 91% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/StringCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StringCondition.java index d978293a..b1919b11 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/StringCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StringCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/UnaryCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/UnaryCondition.java similarity index 89% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/UnaryCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/UnaryCondition.java index 3887623a..eb26a775 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/UnaryCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/UnaryCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/ValueCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/ValueCondition.java similarity index 93% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/ValueCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/ValueCondition.java index d72063ec..2f5445f6 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/schema/shared/ValueCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/ValueCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java index 5d2e1687..ea7430f7 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java @@ -4,13 +4,22 @@ import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; +import org.hypertrace.graphql.label.deserialization.LabelApplicationRuleIdArgument; +import org.hypertrace.graphql.label.mutator.LabelApplicationRuleCreateMutator; +import org.hypertrace.graphql.label.mutator.LabelApplicationRuleDeleteMutator; +import org.hypertrace.graphql.label.mutator.LabelApplicationRuleUpdateMutator; import org.hypertrace.graphql.label.mutator.LabelCreateMutator; import org.hypertrace.graphql.label.mutator.LabelUpdateMutator; import org.hypertrace.graphql.label.schema.Label; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; public interface LabelMutationSchema { String CREATE_LABEL = "createLabel"; String UPDATE_LABEL = "updateLabel"; + String CREATE_LABEL_APPLICATION_RULE = "createLabelApplicationRule"; + String UPDATE_LABEL_APPLICATION_RULE = "updateLabelApplicationRule"; + String DELETE_LABEL_APPLICATION_RULE = "deleteLabelApplicationRule"; @GraphQLField @GraphQLNonNull @@ -23,4 +32,27 @@ public interface LabelMutationSchema { @GraphQLName(UPDATE_LABEL) @GraphQLDataFetcher(LabelUpdateMutator.class) Label updateLabel(@GraphQLNonNull @GraphQLName(Label.ARGUMENT_NAME) UpdateLabel label); + + @GraphQLField + @GraphQLNonNull + @GraphQLName(CREATE_LABEL_APPLICATION_RULE) + @GraphQLDataFetcher(LabelApplicationRuleCreateMutator.class) + LabelApplicationRule createLabelApplicationRule( + @GraphQLNonNull @GraphQLName(LabelApplicationRuleData.ARGUMENT_NAME) + LabelApplicationRuleData labelApplicationRuleData); + + @GraphQLField + @GraphQLNonNull + @GraphQLName(UPDATE_LABEL_APPLICATION_RULE) + @GraphQLDataFetcher(LabelApplicationRuleUpdateMutator.class) + LabelApplicationRule updateLabelApplicationRule( + @GraphQLNonNull @GraphQLName(LabelApplicationRule.ARGUMENT_NAME) + LabelApplicationRule labelApplicationRule); + + @GraphQLField + @GraphQLNonNull + @GraphQLName(DELETE_LABEL_APPLICATION_RULE) + @GraphQLDataFetcher(LabelApplicationRuleDeleteMutator.class) + Boolean deleteLabelApplicationRule( + @GraphQLNonNull @GraphQLName(LabelApplicationRuleIdArgument.ARGUMENT_NAME) String id); } diff --git a/hypertrace-graphql-labels-schema-impl/build.gradle.kts b/hypertrace-graphql-labels-schema-impl/build.gradle.kts index 641f70ec..50a46c62 100644 --- a/hypertrace-graphql-labels-schema-impl/build.gradle.kts +++ b/hypertrace-graphql-labels-schema-impl/build.gradle.kts @@ -18,6 +18,7 @@ dependencies { implementation("org.slf4j:slf4j-api") implementation("io.reactivex.rxjava3:rxjava") implementation("org.hypertrace.config.service:labels-config-service-api") + implementation("org.hypertrace.config.service:label-application-rule-config-service-api") implementation("com.google.protobuf:protobuf-java-util") implementation("com.google.guava:guava") diff --git a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/LabelSchemaModule.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/LabelSchemaModule.java index 584e2d58..6742196e 100644 --- a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/LabelSchemaModule.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/LabelSchemaModule.java @@ -3,9 +3,12 @@ import com.google.inject.AbstractModule; import com.google.inject.multibindings.Multibinder; import org.hypertrace.core.graphql.spi.schema.GraphQlSchemaFragment; +import org.hypertrace.graphql.label.dao.LabelApplicationRuleDaoModule; import org.hypertrace.graphql.label.dao.LabelDaoModule; +import org.hypertrace.graphql.label.deserialization.LabelApplicationRuleDeserializationModule; import org.hypertrace.graphql.label.deserialization.LabelDeserializationModule; import org.hypertrace.graphql.label.joiner.LabelJoinerModule; +import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestModule; import org.hypertrace.graphql.label.request.LabelRequestModule; public class LabelSchemaModule extends AbstractModule { @@ -19,5 +22,8 @@ protected void configure() { install(new LabelDeserializationModule()); install(new LabelRequestModule()); install(new LabelJoinerModule()); + install(new LabelApplicationRuleDaoModule()); + install(new LabelApplicationRuleRequestModule()); + install(new LabelApplicationRuleDeserializationModule()); } } diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleConfigServiceDao.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleConfigServiceDao.java similarity index 90% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleConfigServiceDao.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleConfigServiceDao.java index 40d0a2a0..2b05d21c 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleConfigServiceDao.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleConfigServiceDao.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.dao; +package org.hypertrace.graphql.label.dao; import io.grpc.CallCredentials; import io.reactivex.rxjava3.core.Single; @@ -8,11 +8,11 @@ import org.hypertrace.core.graphql.utils.grpc.GrpcChannelRegistry; import org.hypertrace.core.graphql.utils.grpc.GrpcContextBuilder; import org.hypertrace.graphql.config.HypertraceGraphQlServiceConfig; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleCreateRequest; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleDeleteRequest; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleUpdateRequest; -import org.hypertrace.graphql.label.application.rules.schema.query.LabelApplicationRuleResultSet; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; +import org.hypertrace.graphql.label.request.LabelApplicationRuleCreateRequest; +import org.hypertrace.graphql.label.request.LabelApplicationRuleDeleteRequest; +import org.hypertrace.graphql.label.request.LabelApplicationRuleUpdateRequest; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; import org.hypertrace.label.application.rule.config.service.v1.GetLabelApplicationRulesRequest; import org.hypertrace.label.application.rule.config.service.v1.LabelApplicationRuleConfigServiceGrpc; import org.hypertrace.label.application.rule.config.service.v1.LabelApplicationRuleConfigServiceGrpc.LabelApplicationRuleConfigServiceFutureStub; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleDaoModule.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDaoModule.java similarity index 91% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleDaoModule.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDaoModule.java index 7f7387dc..7ad8a776 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleDaoModule.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDaoModule.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.dao; +package org.hypertrace.graphql.label.dao; import com.google.inject.AbstractModule; import io.grpc.CallCredentials; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleRequestConverter.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleRequestConverter.java similarity index 80% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleRequestConverter.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleRequestConverter.java index 69a2eb7b..252e175f 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleRequestConverter.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleRequestConverter.java @@ -1,11 +1,11 @@ -package org.hypertrace.graphql.label.application.rules.dao; +package org.hypertrace.graphql.label.dao; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleCreateRequest; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleDeleteRequest; -import org.hypertrace.graphql.label.application.rules.request.LabelApplicationRuleUpdateRequest; +import org.hypertrace.graphql.label.request.LabelApplicationRuleCreateRequest; +import org.hypertrace.graphql.label.request.LabelApplicationRuleDeleteRequest; +import org.hypertrace.graphql.label.request.LabelApplicationRuleUpdateRequest; import org.hypertrace.label.application.rule.config.service.v1.CreateLabelApplicationRuleRequest; import org.hypertrace.label.application.rule.config.service.v1.DeleteLabelApplicationRuleRequest; import org.hypertrace.label.application.rule.config.service.v1.LabelApplicationRuleData; @@ -20,7 +20,7 @@ class LabelApplicationRuleRequestConverter { public CreateLabelApplicationRuleRequest convertCreationRequest( LabelApplicationRuleCreateRequest labelApplicationRuleCreateRequest) { - org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData data = + org.hypertrace.graphql.label.schema.LabelApplicationRuleData data = labelApplicationRuleCreateRequest.labelApplicationRuleData(); return CreateLabelApplicationRuleRequest.newBuilder() .setData(convertLabelApplicationRuleData(data)) @@ -47,7 +47,7 @@ public DeleteLabelApplicationRuleRequest convertDeleteRequest( } private LabelApplicationRuleData convertLabelApplicationRuleData( - org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData data) { + org.hypertrace.graphql.label.schema.LabelApplicationRuleData data) { LabelApplicationRuleData.Builder convertedDataBuilder = LabelApplicationRuleData.newBuilder() .setName(data.name()) @@ -59,7 +59,7 @@ private LabelApplicationRuleData convertLabelApplicationRuleData( } private Action.Operation getOperationFromAction( - org.hypertrace.graphql.label.application.rules.schema.shared.Action action) { + org.hypertrace.graphql.label.schema.Action action) { switch (action.operation()) { case OPERATION_MERGE: return Action.Operation.OPERATION_MERGE; @@ -68,8 +68,7 @@ private Action.Operation getOperationFromAction( } } - private Action convertLabelAction( - org.hypertrace.graphql.label.application.rules.schema.shared.Action action) { + private Action convertLabelAction(org.hypertrace.graphql.label.schema.Action action) { Action.Operation operation = getOperationFromAction(action); Action.Builder actionBuilder = Action.newBuilder().setOperation(operation).addAllEntityTypes(action.entityTypes()); @@ -87,7 +86,7 @@ private Action convertLabelAction( } Condition convertConditionList( - List conditionList) { + List conditionList) { if (conditionList.size() == 1) { return convertCondition(conditionList.get(0)); } else { @@ -103,14 +102,13 @@ Condition convertConditionList( } } - Condition convertCondition( - org.hypertrace.graphql.label.application.rules.schema.shared.Condition condition) { + Condition convertCondition(org.hypertrace.graphql.label.schema.Condition condition) { LeafCondition leafCondition = convertLeafCondition(condition.leafCondition()); return Condition.newBuilder().setLeafCondition(leafCondition).build(); } LeafCondition convertLeafCondition( - org.hypertrace.graphql.label.application.rules.schema.shared.LeafCondition leafCondition) { + org.hypertrace.graphql.label.schema.LeafCondition leafCondition) { LeafCondition.Builder leafConditionBuilder = LeafCondition.newBuilder() .setKeyCondition(convertStringCondition(leafCondition.keyCondition())); @@ -131,8 +129,7 @@ LeafCondition convertLeafCondition( } StringCondition convertStringCondition( - org.hypertrace.graphql.label.application.rules.schema.shared.StringCondition - stringCondition) { + org.hypertrace.graphql.label.schema.StringCondition stringCondition) { return StringCondition.newBuilder() .setOperator(convertStringConditionOperator(stringCondition.operator())) .setValue(stringCondition.value()) @@ -140,15 +137,14 @@ StringCondition convertStringCondition( } UnaryCondition convertUnaryCondition( - org.hypertrace.graphql.label.application.rules.schema.shared.UnaryCondition unaryCondition) { + org.hypertrace.graphql.label.schema.UnaryCondition unaryCondition) { return UnaryCondition.newBuilder() .setOperator(convertUnaryOperator(unaryCondition.operator())) .build(); } StringCondition.Operator convertStringConditionOperator( - org.hypertrace.graphql.label.application.rules.schema.shared.StringCondition.Operator - operator) { + org.hypertrace.graphql.label.schema.StringCondition.Operator operator) { switch (operator) { case OPERATOR_EQUALS: return StringCondition.Operator.OPERATOR_EQUALS; @@ -160,8 +156,7 @@ StringCondition.Operator convertStringConditionOperator( } UnaryCondition.Operator convertUnaryOperator( - org.hypertrace.graphql.label.application.rules.schema.shared.UnaryCondition.Operator - operator) { + org.hypertrace.graphql.label.schema.UnaryCondition.Operator operator) { switch (operator) { case OPERATOR_EXISTS: return UnaryCondition.Operator.OPERATOR_EXISTS; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleResponseConverter.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleResponseConverter.java similarity index 93% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleResponseConverter.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleResponseConverter.java index 80470aac..48c82666 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/dao/LabelApplicationRuleResponseConverter.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleResponseConverter.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.dao; +package org.hypertrace.graphql.label.dao; import io.reactivex.rxjava3.core.Maybe; import io.reactivex.rxjava3.core.Observable; @@ -10,16 +10,16 @@ import lombok.Value; import lombok.experimental.Accessors; import lombok.extern.slf4j.Slf4j; -import org.hypertrace.graphql.label.application.rules.schema.query.LabelApplicationRuleResultSet; -import org.hypertrace.graphql.label.application.rules.schema.shared.Action; -import org.hypertrace.graphql.label.application.rules.schema.shared.Condition; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData; -import org.hypertrace.graphql.label.application.rules.schema.shared.LeafCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.StaticLabels; -import org.hypertrace.graphql.label.application.rules.schema.shared.StringCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.UnaryCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.ValueCondition; +import org.hypertrace.graphql.label.schema.Action; +import org.hypertrace.graphql.label.schema.Condition; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; +import org.hypertrace.graphql.label.schema.LeafCondition; +import org.hypertrace.graphql.label.schema.StaticLabels; +import org.hypertrace.graphql.label.schema.StringCondition; +import org.hypertrace.graphql.label.schema.UnaryCondition; +import org.hypertrace.graphql.label.schema.ValueCondition; import org.hypertrace.label.application.rule.config.service.v1.CreateLabelApplicationRuleResponse; import org.hypertrace.label.application.rule.config.service.v1.GetLabelApplicationRulesResponse; import org.hypertrace.label.application.rule.config.service.v1.UpdateLabelApplicationRuleResponse; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDataDeserializationConfig.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDataDeserializationConfig.java similarity index 84% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDataDeserializationConfig.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDataDeserializationConfig.java index e8dab3c7..ac609177 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDataDeserializationConfig.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDataDeserializationConfig.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.deserialization; +package org.hypertrace.graphql.label.deserialization; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.Module; @@ -8,14 +8,14 @@ import lombok.Value; import lombok.experimental.Accessors; import org.hypertrace.core.graphql.deserialization.ArgumentDeserializationConfig; -import org.hypertrace.graphql.label.application.rules.schema.shared.Action; -import org.hypertrace.graphql.label.application.rules.schema.shared.Condition; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData; -import org.hypertrace.graphql.label.application.rules.schema.shared.LeafCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.StaticLabels; -import org.hypertrace.graphql.label.application.rules.schema.shared.StringCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.UnaryCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.ValueCondition; +import org.hypertrace.graphql.label.schema.Action; +import org.hypertrace.graphql.label.schema.Condition; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.LeafCondition; +import org.hypertrace.graphql.label.schema.StaticLabels; +import org.hypertrace.graphql.label.schema.StringCondition; +import org.hypertrace.graphql.label.schema.UnaryCondition; +import org.hypertrace.graphql.label.schema.ValueCondition; public class LabelApplicationRuleDataDeserializationConfig implements ArgumentDeserializationConfig { diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDeserializationConfig.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationConfig.java similarity index 84% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDeserializationConfig.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationConfig.java index 8c3a9151..47bea9ed 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDeserializationConfig.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationConfig.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.deserialization; +package org.hypertrace.graphql.label.deserialization; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.Module; @@ -8,15 +8,15 @@ import lombok.Value; import lombok.experimental.Accessors; import org.hypertrace.core.graphql.deserialization.ArgumentDeserializationConfig; -import org.hypertrace.graphql.label.application.rules.schema.shared.Action; -import org.hypertrace.graphql.label.application.rules.schema.shared.Condition; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData; -import org.hypertrace.graphql.label.application.rules.schema.shared.LeafCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.StaticLabels; -import org.hypertrace.graphql.label.application.rules.schema.shared.StringCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.UnaryCondition; -import org.hypertrace.graphql.label.application.rules.schema.shared.ValueCondition; +import org.hypertrace.graphql.label.schema.Action; +import org.hypertrace.graphql.label.schema.Condition; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.LeafCondition; +import org.hypertrace.graphql.label.schema.StaticLabels; +import org.hypertrace.graphql.label.schema.StringCondition; +import org.hypertrace.graphql.label.schema.UnaryCondition; +import org.hypertrace.graphql.label.schema.ValueCondition; public class LabelApplicationRuleDeserializationConfig implements ArgumentDeserializationConfig { @Override diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDeserializationModule.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationModule.java similarity index 92% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDeserializationModule.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationModule.java index a280c1a5..f156fd7b 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/deserialization/LabelApplicationRuleDeserializationModule.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationModule.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.deserialization; +package org.hypertrace.graphql.label.deserialization; import com.google.inject.AbstractModule; import com.google.inject.multibindings.Multibinder; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestBuilderImpl.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilderImpl.java similarity index 87% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestBuilderImpl.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilderImpl.java index cde65c0a..c8dedb9e 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestBuilderImpl.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilderImpl.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.request; +package org.hypertrace.graphql.label.request; import java.util.Map; import javax.inject.Inject; @@ -6,9 +6,9 @@ import lombok.experimental.Accessors; import org.hypertrace.core.graphql.context.GraphQlRequestContext; import org.hypertrace.core.graphql.deserialization.ArgumentDeserializer; -import org.hypertrace.graphql.label.application.rules.deserialization.LabelApplicationRuleIdArgument; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRule; -import org.hypertrace.graphql.label.application.rules.schema.shared.LabelApplicationRuleData; +import org.hypertrace.graphql.label.deserialization.LabelApplicationRuleIdArgument; +import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; public class LabelApplicationRuleRequestBuilderImpl implements LabelApplicationRuleRequestBuilder { private final ArgumentDeserializer argumentDeserializer; diff --git a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestModule.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestModule.java similarity index 85% rename from hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestModule.java rename to hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestModule.java index 4ef58515..401041cd 100644 --- a/hypertrace-graphql-label-application-rules-schema/src/main/java/org/hypertrace/graphql/label/application/rules/request/LabelApplicationRuleRequestModule.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestModule.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.request; +package org.hypertrace.graphql.label.request; import com.google.inject.AbstractModule; import org.hypertrace.core.graphql.deserialization.ArgumentDeserializer; From 484a1e1221789501f059202ad76c7d49e8da49bd Mon Sep 17 00:00:00 2001 From: saxenakshitiz Date: Fri, 24 Dec 2021 18:42:52 +0530 Subject: [PATCH 2/4] Remove label application rule schema from settings gradle --- hypertrace-graphql-impl/build.gradle.kts | 1 - .../build.gradle.kts | 34 ------------------- settings.gradle.kts | 1 - 3 files changed, 36 deletions(-) delete mode 100644 hypertrace-graphql-label-application-rules-schema/build.gradle.kts diff --git a/hypertrace-graphql-impl/build.gradle.kts b/hypertrace-graphql-impl/build.gradle.kts index 9e2a78b9..8dc2057b 100644 --- a/hypertrace-graphql-impl/build.gradle.kts +++ b/hypertrace-graphql-impl/build.gradle.kts @@ -32,7 +32,6 @@ dependencies { implementation(project(":hypertrace-graphql-entity-type")) implementation(project(":hypertrace-graphql-spaces-schema")) implementation(project(":hypertrace-graphql-labels-schema-impl")) - implementation(project(":hypertrace-graphql-label-application-rules-schema")) implementation("org.slf4j:slf4j-api") implementation("com.google.inject:guice") diff --git a/hypertrace-graphql-label-application-rules-schema/build.gradle.kts b/hypertrace-graphql-label-application-rules-schema/build.gradle.kts deleted file mode 100644 index a207d31a..00000000 --- a/hypertrace-graphql-label-application-rules-schema/build.gradle.kts +++ /dev/null @@ -1,34 +0,0 @@ -plugins { - `java-library` - jacoco - id("org.hypertrace.jacoco-report-plugin") -} - -dependencies { - api("com.google.inject:guice") - api("com.graphql-java:graphql-java") - api("org.hypertrace.core.graphql:hypertrace-core-graphql-spi") - api("io.github.graphql-java:graphql-java-annotations") - api("org.hypertrace.core.graphql:hypertrace-core-graphql-common-schema") - - annotationProcessor("org.projectlombok:lombok") - compileOnly("org.projectlombok:lombok") - - implementation("org.slf4j:slf4j-api") - implementation("io.reactivex.rxjava3:rxjava") - implementation("org.hypertrace.config.service:label-application-rule-config-service-api") - implementation("com.google.protobuf:protobuf-java-util") - implementation("com.google.guava:guava") - - implementation("org.hypertrace.core.graphql:hypertrace-core-graphql-context") - implementation("org.hypertrace.core.graphql:hypertrace-core-graphql-grpc-utils") - implementation("org.hypertrace.core.graphql:hypertrace-core-graphql-schema-utils") - implementation("org.hypertrace.core.graphql:hypertrace-core-graphql-rx-utils") - implementation("org.hypertrace.core.graphql:hypertrace-core-graphql-deserialization") - - implementation(project(":hypertrace-graphql-service-config")) -} - -tasks.test { - useJUnitPlatform() -} diff --git a/settings.gradle.kts b/settings.gradle.kts index 96b30404..b32a7d46 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -27,4 +27,3 @@ include(":hypertrace-graphql-platform") include(":hypertrace-graphql-spaces-schema") include(":hypertrace-graphql-labels-schema-api") include(":hypertrace-graphql-labels-schema-impl") -include(":hypertrace-graphql-label-application-rules-schema") \ No newline at end of file From a7eab3c9b6baa507187030968d1a6073e5514905 Mon Sep 17 00:00:00 2001 From: saxenakshitiz Date: Mon, 27 Dec 2021 01:50:40 +0530 Subject: [PATCH 3/4] Moved label application rule classes to 'rule' package --- .../label/dao/LabelApplicationRuleDao.java | 4 ++-- .../fetcher/LabelApplicationRuleFetcher.java | 2 +- .../LabelApplicationRuleCreateMutator.java | 2 +- .../LabelApplicationRuleUpdateMutator.java | 2 +- .../LabelApplicationRuleCreateRequest.java | 2 +- .../LabelApplicationRuleUpdateRequest.java | 2 +- .../graphql/label/schema/LabelSchema.java | 1 + .../schema/mutation/LabelMutationSchema.java | 4 ++-- .../label/schema/{ => rule}/Action.java | 2 +- .../label/schema/{ => rule}/Condition.java | 2 +- .../{ => rule}/LabelApplicationRule.java | 2 +- .../{ => rule}/LabelApplicationRuleData.java | 2 +- .../LabelApplicationRuleResultSet.java | 2 +- .../schema/{ => rule}/LeafCondition.java | 2 +- .../label/schema/{ => rule}/StaticLabels.java | 2 +- .../schema/{ => rule}/StringCondition.java | 2 +- .../schema/{ => rule}/UnaryCondition.java | 2 +- .../schema/{ => rule}/ValueCondition.java | 2 +- .../LabelApplicationRuleConfigServiceDao.java | 4 ++-- .../LabelApplicationRuleRequestConverter.java | 22 +++++++++---------- ...LabelApplicationRuleResponseConverter.java | 20 ++++++++--------- ...licationRuleDataDeserializationConfig.java | 16 +++++++------- ...lApplicationRuleDeserializationConfig.java | 18 +++++++-------- ...abelApplicationRuleRequestBuilderImpl.java | 4 ++-- 24 files changed, 62 insertions(+), 61 deletions(-) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/Action.java (96%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/Condition.java (89%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/LabelApplicationRule.java (92%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/LabelApplicationRuleData.java (95%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/LabelApplicationRuleResultSet.java (92%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/LeafCondition.java (92%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/StaticLabels.java (89%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/StringCondition.java (93%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/UnaryCondition.java (92%) rename hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/{ => rule}/ValueCondition.java (95%) diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDao.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDao.java index 428917b1..96e404b1 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDao.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleDao.java @@ -5,8 +5,8 @@ import org.hypertrace.graphql.label.request.LabelApplicationRuleCreateRequest; import org.hypertrace.graphql.label.request.LabelApplicationRuleDeleteRequest; import org.hypertrace.graphql.label.request.LabelApplicationRuleUpdateRequest; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet; public interface LabelApplicationRuleDao { Single createLabelApplicationRule( diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/fetcher/LabelApplicationRuleFetcher.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/fetcher/LabelApplicationRuleFetcher.java index ac2603ed..35d85fdc 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/fetcher/LabelApplicationRuleFetcher.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/fetcher/LabelApplicationRuleFetcher.java @@ -7,7 +7,7 @@ import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher; import org.hypertrace.core.graphql.common.request.ContextualRequestBuilder; import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet; public class LabelApplicationRuleFetcher extends InjectableDataFetcher { diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleCreateMutator.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleCreateMutator.java index 855e8995..4de7ccc5 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleCreateMutator.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleCreateMutator.java @@ -7,7 +7,7 @@ import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher; import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao; import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; public class LabelApplicationRuleCreateMutator extends InjectableDataFetcher { diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleUpdateMutator.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleUpdateMutator.java index b8415201..eb80dfdf 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleUpdateMutator.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/mutator/LabelApplicationRuleUpdateMutator.java @@ -7,7 +7,7 @@ import org.hypertrace.core.graphql.common.fetcher.InjectableDataFetcher; import org.hypertrace.graphql.label.dao.LabelApplicationRuleDao; import org.hypertrace.graphql.label.request.LabelApplicationRuleRequestBuilder; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; public class LabelApplicationRuleUpdateMutator extends InjectableDataFetcher { diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleCreateRequest.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleCreateRequest.java index 066a8e28..a984be09 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleCreateRequest.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleCreateRequest.java @@ -1,7 +1,7 @@ package org.hypertrace.graphql.label.request; import org.hypertrace.core.graphql.common.request.ContextualRequest; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData; public interface LabelApplicationRuleCreateRequest extends ContextualRequest { LabelApplicationRuleData labelApplicationRuleData(); diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleUpdateRequest.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleUpdateRequest.java index 83760fdf..830d92a5 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleUpdateRequest.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleUpdateRequest.java @@ -1,7 +1,7 @@ package org.hypertrace.graphql.label.request; import org.hypertrace.core.graphql.common.request.ContextualRequest; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; public interface LabelApplicationRuleUpdateRequest extends ContextualRequest { LabelApplicationRule labelApplicationRule(); diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java index 5b9bdf3c..c70cd966 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelSchema.java @@ -6,6 +6,7 @@ import graphql.annotations.annotationTypes.GraphQLNonNull; import org.hypertrace.graphql.label.fetcher.LabelApplicationRuleFetcher; import org.hypertrace.graphql.label.fetcher.LabelFetcher; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet; public interface LabelSchema { String LABELS_QUERY_NAME = "labels"; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java index ea7430f7..7298f724 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/mutation/LabelMutationSchema.java @@ -11,8 +11,8 @@ import org.hypertrace.graphql.label.mutator.LabelCreateMutator; import org.hypertrace.graphql.label.mutator.LabelUpdateMutator; import org.hypertrace.graphql.label.schema.Label; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData; public interface LabelMutationSchema { String CREATE_LABEL = "createLabel"; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Action.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/Action.java similarity index 96% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Action.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/Action.java index ce587a6b..1491cf8a 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Action.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/Action.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Condition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/Condition.java similarity index 89% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Condition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/Condition.java index 0de72ca6..3f01a05e 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/Condition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/Condition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRule.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRule.java similarity index 92% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRule.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRule.java index 725b366f..d3b2de02 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRule.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRule.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleData.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRuleData.java similarity index 95% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleData.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRuleData.java index 9d45da8d..ae3a0c98 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleData.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRuleData.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleResultSet.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRuleResultSet.java similarity index 92% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleResultSet.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRuleResultSet.java index 13f4a55c..c31595c0 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LabelApplicationRuleResultSet.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LabelApplicationRuleResultSet.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LeafCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LeafCondition.java similarity index 92% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LeafCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LeafCondition.java index eccbe85d..34474abf 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/LeafCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/LeafCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StaticLabels.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/StaticLabels.java similarity index 89% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StaticLabels.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/StaticLabels.java index 5be2574f..ede09344 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StaticLabels.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/StaticLabels.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StringCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/StringCondition.java similarity index 93% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StringCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/StringCondition.java index b1919b11..2790078d 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/StringCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/StringCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/UnaryCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/UnaryCondition.java similarity index 92% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/UnaryCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/UnaryCondition.java index eb26a775..94e84071 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/UnaryCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/UnaryCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/ValueCondition.java b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/ValueCondition.java similarity index 95% rename from hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/ValueCondition.java rename to hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/ValueCondition.java index 2f5445f6..27e58ad6 100644 --- a/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/ValueCondition.java +++ b/hypertrace-graphql-labels-schema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/ValueCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.schema; +package org.hypertrace.graphql.label.schema.rule; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; diff --git a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleConfigServiceDao.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleConfigServiceDao.java index 2b05d21c..aebf48b6 100644 --- a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleConfigServiceDao.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleConfigServiceDao.java @@ -11,8 +11,8 @@ import org.hypertrace.graphql.label.request.LabelApplicationRuleCreateRequest; import org.hypertrace.graphql.label.request.LabelApplicationRuleDeleteRequest; import org.hypertrace.graphql.label.request.LabelApplicationRuleUpdateRequest; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet; import org.hypertrace.label.application.rule.config.service.v1.GetLabelApplicationRulesRequest; import org.hypertrace.label.application.rule.config.service.v1.LabelApplicationRuleConfigServiceGrpc; import org.hypertrace.label.application.rule.config.service.v1.LabelApplicationRuleConfigServiceGrpc.LabelApplicationRuleConfigServiceFutureStub; diff --git a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleRequestConverter.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleRequestConverter.java index 252e175f..4700cf5e 100644 --- a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleRequestConverter.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleRequestConverter.java @@ -20,7 +20,7 @@ class LabelApplicationRuleRequestConverter { public CreateLabelApplicationRuleRequest convertCreationRequest( LabelApplicationRuleCreateRequest labelApplicationRuleCreateRequest) { - org.hypertrace.graphql.label.schema.LabelApplicationRuleData data = + org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData data = labelApplicationRuleCreateRequest.labelApplicationRuleData(); return CreateLabelApplicationRuleRequest.newBuilder() .setData(convertLabelApplicationRuleData(data)) @@ -47,7 +47,7 @@ public DeleteLabelApplicationRuleRequest convertDeleteRequest( } private LabelApplicationRuleData convertLabelApplicationRuleData( - org.hypertrace.graphql.label.schema.LabelApplicationRuleData data) { + org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData data) { LabelApplicationRuleData.Builder convertedDataBuilder = LabelApplicationRuleData.newBuilder() .setName(data.name()) @@ -59,7 +59,7 @@ private LabelApplicationRuleData convertLabelApplicationRuleData( } private Action.Operation getOperationFromAction( - org.hypertrace.graphql.label.schema.Action action) { + org.hypertrace.graphql.label.schema.rule.Action action) { switch (action.operation()) { case OPERATION_MERGE: return Action.Operation.OPERATION_MERGE; @@ -68,7 +68,7 @@ private Action.Operation getOperationFromAction( } } - private Action convertLabelAction(org.hypertrace.graphql.label.schema.Action action) { + private Action convertLabelAction(org.hypertrace.graphql.label.schema.rule.Action action) { Action.Operation operation = getOperationFromAction(action); Action.Builder actionBuilder = Action.newBuilder().setOperation(operation).addAllEntityTypes(action.entityTypes()); @@ -86,7 +86,7 @@ private Action convertLabelAction(org.hypertrace.graphql.label.schema.Action act } Condition convertConditionList( - List conditionList) { + List conditionList) { if (conditionList.size() == 1) { return convertCondition(conditionList.get(0)); } else { @@ -102,13 +102,13 @@ Condition convertConditionList( } } - Condition convertCondition(org.hypertrace.graphql.label.schema.Condition condition) { + Condition convertCondition(org.hypertrace.graphql.label.schema.rule.Condition condition) { LeafCondition leafCondition = convertLeafCondition(condition.leafCondition()); return Condition.newBuilder().setLeafCondition(leafCondition).build(); } LeafCondition convertLeafCondition( - org.hypertrace.graphql.label.schema.LeafCondition leafCondition) { + org.hypertrace.graphql.label.schema.rule.LeafCondition leafCondition) { LeafCondition.Builder leafConditionBuilder = LeafCondition.newBuilder() .setKeyCondition(convertStringCondition(leafCondition.keyCondition())); @@ -129,7 +129,7 @@ LeafCondition convertLeafCondition( } StringCondition convertStringCondition( - org.hypertrace.graphql.label.schema.StringCondition stringCondition) { + org.hypertrace.graphql.label.schema.rule.StringCondition stringCondition) { return StringCondition.newBuilder() .setOperator(convertStringConditionOperator(stringCondition.operator())) .setValue(stringCondition.value()) @@ -137,14 +137,14 @@ StringCondition convertStringCondition( } UnaryCondition convertUnaryCondition( - org.hypertrace.graphql.label.schema.UnaryCondition unaryCondition) { + org.hypertrace.graphql.label.schema.rule.UnaryCondition unaryCondition) { return UnaryCondition.newBuilder() .setOperator(convertUnaryOperator(unaryCondition.operator())) .build(); } StringCondition.Operator convertStringConditionOperator( - org.hypertrace.graphql.label.schema.StringCondition.Operator operator) { + org.hypertrace.graphql.label.schema.rule.StringCondition.Operator operator) { switch (operator) { case OPERATOR_EQUALS: return StringCondition.Operator.OPERATOR_EQUALS; @@ -156,7 +156,7 @@ StringCondition.Operator convertStringConditionOperator( } UnaryCondition.Operator convertUnaryOperator( - org.hypertrace.graphql.label.schema.UnaryCondition.Operator operator) { + org.hypertrace.graphql.label.schema.rule.UnaryCondition.Operator operator) { switch (operator) { case OPERATOR_EXISTS: return UnaryCondition.Operator.OPERATOR_EXISTS; diff --git a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleResponseConverter.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleResponseConverter.java index 48c82666..42a5a173 100644 --- a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleResponseConverter.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/dao/LabelApplicationRuleResponseConverter.java @@ -10,16 +10,16 @@ import lombok.Value; import lombok.experimental.Accessors; import lombok.extern.slf4j.Slf4j; -import org.hypertrace.graphql.label.schema.Action; -import org.hypertrace.graphql.label.schema.Condition; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleResultSet; -import org.hypertrace.graphql.label.schema.LeafCondition; -import org.hypertrace.graphql.label.schema.StaticLabels; -import org.hypertrace.graphql.label.schema.StringCondition; -import org.hypertrace.graphql.label.schema.UnaryCondition; -import org.hypertrace.graphql.label.schema.ValueCondition; +import org.hypertrace.graphql.label.schema.rule.Action; +import org.hypertrace.graphql.label.schema.rule.Condition; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet; +import org.hypertrace.graphql.label.schema.rule.LeafCondition; +import org.hypertrace.graphql.label.schema.rule.StaticLabels; +import org.hypertrace.graphql.label.schema.rule.StringCondition; +import org.hypertrace.graphql.label.schema.rule.UnaryCondition; +import org.hypertrace.graphql.label.schema.rule.ValueCondition; import org.hypertrace.label.application.rule.config.service.v1.CreateLabelApplicationRuleResponse; import org.hypertrace.label.application.rule.config.service.v1.GetLabelApplicationRulesResponse; import org.hypertrace.label.application.rule.config.service.v1.UpdateLabelApplicationRuleResponse; diff --git a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDataDeserializationConfig.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDataDeserializationConfig.java index ac609177..ec129a0d 100644 --- a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDataDeserializationConfig.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDataDeserializationConfig.java @@ -8,14 +8,14 @@ import lombok.Value; import lombok.experimental.Accessors; import org.hypertrace.core.graphql.deserialization.ArgumentDeserializationConfig; -import org.hypertrace.graphql.label.schema.Action; -import org.hypertrace.graphql.label.schema.Condition; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; -import org.hypertrace.graphql.label.schema.LeafCondition; -import org.hypertrace.graphql.label.schema.StaticLabels; -import org.hypertrace.graphql.label.schema.StringCondition; -import org.hypertrace.graphql.label.schema.UnaryCondition; -import org.hypertrace.graphql.label.schema.ValueCondition; +import org.hypertrace.graphql.label.schema.rule.Action; +import org.hypertrace.graphql.label.schema.rule.Condition; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.rule.LeafCondition; +import org.hypertrace.graphql.label.schema.rule.StaticLabels; +import org.hypertrace.graphql.label.schema.rule.StringCondition; +import org.hypertrace.graphql.label.schema.rule.UnaryCondition; +import org.hypertrace.graphql.label.schema.rule.ValueCondition; public class LabelApplicationRuleDataDeserializationConfig implements ArgumentDeserializationConfig { diff --git a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationConfig.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationConfig.java index 47bea9ed..efe75467 100644 --- a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationConfig.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/deserialization/LabelApplicationRuleDeserializationConfig.java @@ -8,15 +8,15 @@ import lombok.Value; import lombok.experimental.Accessors; import org.hypertrace.core.graphql.deserialization.ArgumentDeserializationConfig; -import org.hypertrace.graphql.label.schema.Action; -import org.hypertrace.graphql.label.schema.Condition; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; -import org.hypertrace.graphql.label.schema.LeafCondition; -import org.hypertrace.graphql.label.schema.StaticLabels; -import org.hypertrace.graphql.label.schema.StringCondition; -import org.hypertrace.graphql.label.schema.UnaryCondition; -import org.hypertrace.graphql.label.schema.ValueCondition; +import org.hypertrace.graphql.label.schema.rule.Action; +import org.hypertrace.graphql.label.schema.rule.Condition; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.rule.LeafCondition; +import org.hypertrace.graphql.label.schema.rule.StaticLabels; +import org.hypertrace.graphql.label.schema.rule.StringCondition; +import org.hypertrace.graphql.label.schema.rule.UnaryCondition; +import org.hypertrace.graphql.label.schema.rule.ValueCondition; public class LabelApplicationRuleDeserializationConfig implements ArgumentDeserializationConfig { @Override diff --git a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilderImpl.java b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilderImpl.java index c8dedb9e..1d5e6a4a 100644 --- a/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilderImpl.java +++ b/hypertrace-graphql-labels-schema-impl/src/main/java/org/hypertrace/graphql/label/request/LabelApplicationRuleRequestBuilderImpl.java @@ -7,8 +7,8 @@ import org.hypertrace.core.graphql.context.GraphQlRequestContext; import org.hypertrace.core.graphql.deserialization.ArgumentDeserializer; import org.hypertrace.graphql.label.deserialization.LabelApplicationRuleIdArgument; -import org.hypertrace.graphql.label.schema.LabelApplicationRule; -import org.hypertrace.graphql.label.schema.LabelApplicationRuleData; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleData; public class LabelApplicationRuleRequestBuilderImpl implements LabelApplicationRuleRequestBuilder { private final ArgumentDeserializer argumentDeserializer; From 45bab67c1aba847aabbdff51e00802d527cdaea0 Mon Sep 17 00:00:00 2001 From: saxenakshitiz Date: Mon, 27 Dec 2021 10:32:32 +0530 Subject: [PATCH 4/4] Upgrade hypertrace-core-graphql --- hypertrace-core-graphql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hypertrace-core-graphql b/hypertrace-core-graphql index dded099e..89becdae 160000 --- a/hypertrace-core-graphql +++ b/hypertrace-core-graphql @@ -1 +1 @@ -Subproject commit dded099ea2c483f4c3752d7e708e5100b16aae42 +Subproject commit 89becdaebb502d1f8c2e5c9f0ea9869cfd9d230f