diff options
author | Jorg Heymans <jorg.heymans@gmail.com> | 2018-05-01 01:12:41 +0200 |
---|---|---|
committer | zpencer <spencerfang@google.com> | 2018-04-30 16:12:41 -0700 |
commit | 48f103c1ed4603a4c60bed0b676f7917d7ba184a (patch) | |
tree | 5c4b23aa2b782c61b1c6aee828a5090fa5e24b14 /examples | |
parent | 6bd55821754f414934b83b282c4a158580ff9faf (diff) | |
download | grpc-grpc-java-48f103c1ed4603a4c60bed0b676f7917d7ba184a.tar.gz |
examples: remove deprecated usage of usePlainText(boolean) (#4396)
Update examples (including android) to use non deprecated version of method.
Diffstat (limited to 'examples')
11 files changed, 11 insertions, 11 deletions
diff --git a/examples/android/clientcache/app/src/main/java/io/grpc/clientcacheexample/ClientCacheExampleActivity.java b/examples/android/clientcache/app/src/main/java/io/grpc/clientcacheexample/ClientCacheExampleActivity.java index 036e3019f..b6096c8d5 100644 --- a/examples/android/clientcache/app/src/main/java/io/grpc/clientcacheexample/ClientCacheExampleActivity.java +++ b/examples/android/clientcache/app/src/main/java/io/grpc/clientcacheexample/ClientCacheExampleActivity.java @@ -110,7 +110,7 @@ public final class ClientCacheExampleActivity extends AppCompatActivity { boolean onlyIfCached = (boolean) params[5]; int port = TextUtils.isEmpty(portStr) ? 0 : Integer.valueOf(portStr); try { - channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build(); + channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); Channel channelToUse = ClientInterceptors.intercept( channel, SafeMethodCachingInterceptor.newSafeMethodCachingInterceptor(cache)); diff --git a/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java b/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java index ef730931c..89bcb83f6 100644 --- a/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java +++ b/examples/android/helloworld/app/src/main/java/io/grpc/helloworldexample/HelloworldActivity.java @@ -84,7 +84,7 @@ public class HelloworldActivity extends AppCompatActivity { String portStr = params[2]; int port = TextUtils.isEmpty(portStr) ? 0 : Integer.valueOf(portStr); try { - channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build(); + channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); GreeterGrpc.GreeterBlockingStub stub = GreeterGrpc.newBlockingStub(channel); HelloRequest request = HelloRequest.newBuilder().setName(message).build(); HelloReply reply = stub.sayHello(request); diff --git a/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java b/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java index 0d090ac9a..19ba4aa16 100644 --- a/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java +++ b/examples/android/routeguide/app/src/main/java/io/grpc/routeguideexample/RouteGuideActivity.java @@ -79,7 +79,7 @@ public class RouteGuideActivity extends AppCompatActivity { int port = TextUtils.isEmpty(portStr) ? 0 : Integer.valueOf(portStr); ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)) .hideSoftInputFromWindow(hostEdit.getWindowToken(), 0); - channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build(); + channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); hostEdit.setEnabled(false); portEdit.setEnabled(false); startRouteGuideButton.setEnabled(false); diff --git a/examples/src/main/java/io/grpc/examples/advanced/HelloJsonClient.java b/examples/src/main/java/io/grpc/examples/advanced/HelloJsonClient.java index 9ca4e77d6..d9d6f6aea 100644 --- a/examples/src/main/java/io/grpc/examples/advanced/HelloJsonClient.java +++ b/examples/src/main/java/io/grpc/examples/advanced/HelloJsonClient.java @@ -52,7 +52,7 @@ public final class HelloJsonClient { /** Construct client connecting to HelloWorld server at {@code host:port}. */ public HelloJsonClient(String host, int port) { channel = ManagedChannelBuilder.forAddress(host, port) - .usePlaintext(true) + .usePlaintext() .build(); blockingStub = new HelloJsonStub(channel); } diff --git a/examples/src/main/java/io/grpc/examples/errorhandling/DetailErrorSample.java b/examples/src/main/java/io/grpc/examples/errorhandling/DetailErrorSample.java index 86c8b4ba7..9d126e701 100644 --- a/examples/src/main/java/io/grpc/examples/errorhandling/DetailErrorSample.java +++ b/examples/src/main/java/io/grpc/examples/errorhandling/DetailErrorSample.java @@ -83,7 +83,7 @@ public class DetailErrorSample { } }).build().start(); channel = - ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext(true).build(); + ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); blockingCall(); futureCallDirect(); diff --git a/examples/src/main/java/io/grpc/examples/errorhandling/ErrorHandlingClient.java b/examples/src/main/java/io/grpc/examples/errorhandling/ErrorHandlingClient.java index d764f4f06..845eb93f5 100644 --- a/examples/src/main/java/io/grpc/examples/errorhandling/ErrorHandlingClient.java +++ b/examples/src/main/java/io/grpc/examples/errorhandling/ErrorHandlingClient.java @@ -63,7 +63,7 @@ public class ErrorHandlingClient { } }).build().start(); channel = - ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext(true).build(); + ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); blockingCall(); futureCallDirect(); diff --git a/examples/src/main/java/io/grpc/examples/experimental/CompressingHelloWorldClient.java b/examples/src/main/java/io/grpc/examples/experimental/CompressingHelloWorldClient.java index 3e6ad1cd3..ba46f0f80 100644 --- a/examples/src/main/java/io/grpc/examples/experimental/CompressingHelloWorldClient.java +++ b/examples/src/main/java/io/grpc/examples/experimental/CompressingHelloWorldClient.java @@ -43,7 +43,7 @@ public class CompressingHelloWorldClient { /** Construct client connecting to HelloWorld server at {@code host:port}. */ public CompressingHelloWorldClient(String host, int port) { channel = ManagedChannelBuilder.forAddress(host, port) - .usePlaintext(true) + .usePlaintext() .build(); blockingStub = GreeterGrpc.newBlockingStub(channel); } diff --git a/examples/src/main/java/io/grpc/examples/header/CustomHeaderClient.java b/examples/src/main/java/io/grpc/examples/header/CustomHeaderClient.java index a0bd96cf5..783ef80db 100644 --- a/examples/src/main/java/io/grpc/examples/header/CustomHeaderClient.java +++ b/examples/src/main/java/io/grpc/examples/header/CustomHeaderClient.java @@ -44,7 +44,7 @@ public class CustomHeaderClient { */ private CustomHeaderClient(String host, int port) { originChannel = ManagedChannelBuilder.forAddress(host, port) - .usePlaintext(true) + .usePlaintext() .build(); ClientInterceptor interceptor = new HeaderClientInterceptor(); Channel channel = ClientInterceptors.intercept(originChannel, interceptor); diff --git a/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldClient.java b/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldClient.java index 37fff679c..5d0582778 100644 --- a/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldClient.java +++ b/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldClient.java @@ -37,7 +37,7 @@ public class HelloWorldClient { this(ManagedChannelBuilder.forAddress(host, port) // Channels are secure by default (via SSL/TLS). For the example we disable TLS to avoid // needing certificates. - .usePlaintext(true) + .usePlaintext() .build()); } diff --git a/examples/src/main/java/io/grpc/examples/manualflowcontrol/ManualFlowControlClient.java b/examples/src/main/java/io/grpc/examples/manualflowcontrol/ManualFlowControlClient.java index 815d4e951..53d490bbc 100644 --- a/examples/src/main/java/io/grpc/examples/manualflowcontrol/ManualFlowControlClient.java +++ b/examples/src/main/java/io/grpc/examples/manualflowcontrol/ManualFlowControlClient.java @@ -38,7 +38,7 @@ public class ManualFlowControlClient { // Create a channel and a stub ManagedChannel channel = ManagedChannelBuilder .forAddress("localhost", 50051) - .usePlaintext(true) + .usePlaintext() .build(); StreamingGreeterGrpc.StreamingGreeterStub stub = StreamingGreeterGrpc.newStub(channel); diff --git a/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideClient.java b/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideClient.java index 9cbe8a08a..c96c53e0b 100644 --- a/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideClient.java +++ b/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideClient.java @@ -49,7 +49,7 @@ public class RouteGuideClient { /** Construct client for accessing RouteGuide server at {@code host:port}. */ public RouteGuideClient(String host, int port) { - this(ManagedChannelBuilder.forAddress(host, port).usePlaintext(true)); + this(ManagedChannelBuilder.forAddress(host, port).usePlaintext()); } /** Construct client for accessing RouteGuide server using the existing channel. */ |