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 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-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/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/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..96e404b1 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.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.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..35d85fdc 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.rule.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..4de7ccc5 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.rule.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..eb80dfdf 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.rule.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..a984be09 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.rule.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..830d92a5 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.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 c5b7f0c1..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 @@ -4,14 +4,23 @@ 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; +import org.hypertrace.graphql.label.schema.rule.LabelApplicationRuleResultSet; 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-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..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 @@ -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.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.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-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/rule/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/rule/Action.java index e8673193..1491cf8a 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/rule/Action.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/Condition.java index 6a3d1b1a..3f01a05e 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/rule/Condition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/LabelApplicationRule.java index 4ffa4010..d3b2de02 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/rule/LabelApplicationRule.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/LabelApplicationRuleData.java index 3bd900e0..ae3a0c98 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/rule/LabelApplicationRuleData.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/LabelApplicationRuleResultSet.java index 3f002bf9..c31595c0 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/rule/LabelApplicationRuleResultSet.java @@ -1,11 +1,10 @@ -package org.hypertrace.graphql.label.application.rules.schema.query; +package org.hypertrace.graphql.label.schema.rule; 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-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/rule/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/rule/LeafCondition.java index f5e60fa5..34474abf 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/rule/LeafCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/StaticLabels.java index 697a96de..ede09344 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/rule/StaticLabels.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/StringCondition.java index d978293a..2790078d 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/rule/StringCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/UnaryCondition.java index 3887623a..94e84071 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/rule/UnaryCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +package org.hypertrace.graphql.label.schema.rule; 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/rule/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/rule/ValueCondition.java index d72063ec..27e58ad6 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/rule/ValueCondition.java @@ -1,4 +1,4 @@ -package org.hypertrace.graphql.label.application.rules.schema.shared; +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/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..aebf48b6 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.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-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..4700cf5e 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.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.application.rules.schema.shared.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.application.rules.schema.shared.Action action) { + org.hypertrace.graphql.label.schema.rule.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.rule.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.rule.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.rule.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.rule.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.rule.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.rule.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.rule.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..42a5a173 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.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-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..ec129a0d 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.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-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..efe75467 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.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-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..1d5e6a4a 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.rule.LabelApplicationRule; +import org.hypertrace.graphql.label.schema.rule.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; 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