mirror of https://github.com/grpc/grpc-java.git
Revert "all: remove deprecated usePlaintext(boolean)"
This reverts commit 296857b4e7.
This commit is contained in:
parent
2c3ef874d8
commit
316a739e67
|
|
@ -95,6 +95,16 @@ public abstract class ForwardingChannelBuilder<T extends ForwardingChannelBuilde
|
||||||
return thisT();
|
return thisT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated use {@link #usePlaintext()} instead.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public T usePlaintext(boolean skipNegotiation) {
|
||||||
|
delegate().usePlaintext(skipNegotiation);
|
||||||
|
return thisT();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T usePlaintext() {
|
public T usePlaintext() {
|
||||||
delegate().usePlaintext();
|
delegate().usePlaintext();
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,27 @@ public abstract class ManagedChannelBuilder<T extends ManagedChannelBuilder<T>>
|
||||||
*/
|
*/
|
||||||
public abstract T overrideAuthority(String authority);
|
public abstract T overrideAuthority(String authority);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use of a plaintext connection to the server. By default a secure connection mechanism
|
||||||
|
* such as TLS will be used.
|
||||||
|
*
|
||||||
|
* <p>Should only be used for testing or for APIs where the use of such API or the data
|
||||||
|
* exchanged is not sensitive.
|
||||||
|
*
|
||||||
|
* @param skipNegotiation @{code true} if there is a priori knowledge that the endpoint supports
|
||||||
|
* plaintext, {@code false} if plaintext use must be negotiated.
|
||||||
|
* @deprecated Use {@link #usePlaintext()} instead.
|
||||||
|
*
|
||||||
|
* @throws UnsupportedOperationException if plaintext mode is not supported.
|
||||||
|
* @return this
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1772")
|
||||||
|
@Deprecated
|
||||||
|
public T usePlaintext(boolean skipNegotiation) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use of a plaintext connection to the server. By default a secure connection mechanism
|
* Use of a plaintext connection to the server. By default a secure connection mechanism
|
||||||
* such as TLS will be used.
|
* such as TLS will be used.
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,17 @@ public final class InProcessChannelBuilder extends
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does nothing.
|
||||||
|
*
|
||||||
|
* @deprecated use {@link #usePlaintext()} instead.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public InProcessChannelBuilder usePlaintext(boolean skipNegotiation) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does nothing.
|
* Does nothing.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,14 @@ public final class CronetChannelBuilder extends
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not supported for building cronet channel.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public final CronetChannelBuilder usePlaintext(boolean skipNegotiation) {
|
||||||
|
throw new IllegalArgumentException("Plaintext not currently supported");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets {@link android.net.TrafficStats} tag to use when accounting socket traffic caused by this
|
* Sets {@link android.net.TrafficStats} tag to use when accounting socket traffic caused by this
|
||||||
* channel. See {@link android.net.TrafficStats} for more information. If no tag is set (e.g. this
|
* channel. See {@link android.net.TrafficStats} for more information. If no tag is set (e.g. this
|
||||||
|
|
|
||||||
|
|
@ -285,6 +285,23 @@ public final class NettyChannelBuilder
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equivalent to using {@link #negotiationType(NegotiationType)} with {@code PLAINTEXT} or
|
||||||
|
* {@code PLAINTEXT_UPGRADE}.
|
||||||
|
*
|
||||||
|
* @deprecated use {@link #usePlaintext()} instead.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public NettyChannelBuilder usePlaintext(boolean skipNegotiation) {
|
||||||
|
if (skipNegotiation) {
|
||||||
|
negotiationType(NegotiationType.PLAINTEXT);
|
||||||
|
} else {
|
||||||
|
negotiationType(NegotiationType.PLAINTEXT_UPGRADE);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equivalent to using {@link #negotiationType(NegotiationType)} with {@code PLAINTEXT}.
|
* Equivalent to using {@link #negotiationType(NegotiationType)} with {@code PLAINTEXT}.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,22 @@ public class OkHttpChannelBuilder extends
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Equivalent to using {@link #negotiationType} with {@code PLAINTEXT}.
|
||||||
|
*
|
||||||
|
* @deprecated use {@link #usePlaintext()} instead.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public final OkHttpChannelBuilder usePlaintext(boolean skipNegotiation) {
|
||||||
|
if (skipNegotiation) {
|
||||||
|
negotiationType(io.grpc.okhttp.NegotiationType.PLAINTEXT);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Plaintext negotiation not currently supported");
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/** Sets the negotiation type for the HTTP/2 connection to plaintext. */
|
/** Sets the negotiation type for the HTTP/2 connection to plaintext. */
|
||||||
@Override
|
@Override
|
||||||
public final OkHttpChannelBuilder usePlaintext() {
|
public final OkHttpChannelBuilder usePlaintext() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue