diff --git a/alts/BUILD.bazel b/alts/BUILD.bazel index ff973dba51..cf67059fa0 100644 --- a/alts/BUILD.bazel +++ b/alts/BUILD.bazel @@ -11,6 +11,7 @@ java_library( ":handshaker_java_proto", "//api", "//core:internal", + "//grpclb", "//netty", "//stub", "@com_google_code_findbugs_jsr305//jar", @@ -32,7 +33,6 @@ java_library( "src/main/java/io/grpc/alts/*.java", ]), visibility = ["//visibility:public"], - runtime_deps = ["//grpclb"], deps = [ ":alts_internal", ":handshaker_java_grpc", diff --git a/alts/build.gradle b/alts/build.gradle index b534277028..b6110b8054 100644 --- a/alts/build.gradle +++ b/alts/build.gradle @@ -15,6 +15,7 @@ targetCompatibility = 1.7 dependencies { compile project(':grpc-auth'), project(':grpc-core'), + project(':grpc-grpclb'), project(':grpc-netty'), project(':grpc-protobuf'), project(':grpc-stub'), @@ -28,7 +29,6 @@ dependencies { exclude group: 'io.grpc', module: 'grpc-context' } compileOnly libraries.javax_annotation - runtime project(':grpc-grpclb') testCompile project(':grpc-testing'), project(':grpc-testing-proto'), libraries.guava, diff --git a/alts/src/main/java/io/grpc/alts/internal/AltsProtocolNegotiator.java b/alts/src/main/java/io/grpc/alts/internal/AltsProtocolNegotiator.java index 2a77e15bbb..c5adbd7376 100644 --- a/alts/src/main/java/io/grpc/alts/internal/AltsProtocolNegotiator.java +++ b/alts/src/main/java/io/grpc/alts/internal/AltsProtocolNegotiator.java @@ -29,7 +29,7 @@ import io.grpc.InternalChannelz.Security; import io.grpc.SecurityLevel; import io.grpc.Status; import io.grpc.alts.internal.RpcProtocolVersionsUtil.RpcVersionsCheckResult; -import io.grpc.internal.GrpcAttributes; +import io.grpc.grpclb.GrpclbConstants; import io.grpc.internal.ObjectPool; import io.grpc.netty.GrpcHttp2ConnectionHandler; import io.grpc.netty.InternalNettyChannelBuilder; @@ -223,13 +223,13 @@ public final class AltsProtocolNegotiator { return SCHEME; } - @SuppressWarnings("deprecation") @Override public ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHandler) { ChannelHandler gnh = InternalProtocolNegotiators.grpcNegotiationHandler(grpcHandler); ChannelHandler securityHandler; - if (grpcHandler.getEagAttributes().get(GrpcAttributes.ATTR_LB_ADDR_AUTHORITY) != null - || grpcHandler.getEagAttributes().get(GrpcAttributes.ATTR_LB_PROVIDED_BACKEND) != null) { + if (grpcHandler.getEagAttributes().get(GrpclbConstants.ATTR_LB_ADDR_AUTHORITY) != null + || grpcHandler.getEagAttributes().get( + GrpclbConstants.ATTR_LB_PROVIDED_BACKEND) != null) { TsiHandshaker handshaker = handshakerFactory.newHandshaker(grpcHandler.getAuthority()); NettyTsiHandshaker nettyHandshaker = new NettyTsiHandshaker(handshaker); securityHandler = diff --git a/alts/src/test/java/io/grpc/alts/internal/GoogleDefaultProtocolNegotiatorTest.java b/alts/src/test/java/io/grpc/alts/internal/GoogleDefaultProtocolNegotiatorTest.java index 15c3ae4cc8..5858fc3f52 100644 --- a/alts/src/test/java/io/grpc/alts/internal/GoogleDefaultProtocolNegotiatorTest.java +++ b/alts/src/test/java/io/grpc/alts/internal/GoogleDefaultProtocolNegotiatorTest.java @@ -24,8 +24,8 @@ import com.google.common.collect.ImmutableList; import io.grpc.Attributes; import io.grpc.Channel; import io.grpc.ManagedChannel; +import io.grpc.grpclb.GrpclbConstants; import io.grpc.inprocess.InProcessChannelBuilder; -import io.grpc.internal.GrpcAttributes; import io.grpc.internal.ObjectPool; import io.grpc.netty.GrpcHttp2ConnectionHandler; import io.grpc.netty.GrpcSslContexts; @@ -80,7 +80,7 @@ public final class GoogleDefaultProtocolNegotiatorTest { @Test public void altsHandler() { Attributes eagAttributes = - Attributes.newBuilder().set(GrpcAttributes.ATTR_LB_PROVIDED_BACKEND, true).build(); + Attributes.newBuilder().set(GrpclbConstants.ATTR_LB_PROVIDED_BACKEND, true).build(); GrpcHttp2ConnectionHandler mockHandler = mock(GrpcHttp2ConnectionHandler.class); when(mockHandler.getEagAttributes()).thenReturn(eagAttributes); diff --git a/core/src/main/java/io/grpc/internal/GrpcAttributes.java b/core/src/main/java/io/grpc/internal/GrpcAttributes.java index 0887466b10..da43ae1480 100644 --- a/core/src/main/java/io/grpc/internal/GrpcAttributes.java +++ b/core/src/main/java/io/grpc/internal/GrpcAttributes.java @@ -25,25 +25,6 @@ import io.grpc.SecurityLevel; * Special attributes that are only useful to gRPC. */ public final class GrpcAttributes { - /** - * The naming authority of a gRPC LB server address. It is an address-group-level attribute, - * present when the address group is a LoadBalancer. - * - *
Deprecated: this will be used for grpclb specific logic, which will be moved out of core.
- */
- @Deprecated
- @EquivalentAddressGroup.Attr
- public static final Attributes.Key> ATTR_LB_ADDRS =
Attributes.Key.create("io.grpc.grpclb.lbAddrs");
- @SuppressWarnings("deprecation")
+ /**
+ * The naming authority of a gRPC LB server address. It is an address-group-level attribute,
+ * present when the address group is a LoadBalancer.
+ */
@EquivalentAddressGroup.Attr
- static final Attributes.Key