@LimitedPrivate({"HDFS","MapReduce"})
@Evolving
public class SaslRpcClient
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static org.slf4j.Logger |
LOG |
| Constructor | Description |
|---|---|
SaslRpcClient(UserGroupInformation ugi,
java.lang.Class<?> protocol,
java.net.InetSocketAddress serverAddr,
Configuration conf) |
Create a SaslRpcClient that can be used by a RPC client to negotiate
SASL authentication with a RPC server
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
dispose() |
Release resources used by wrapped saslClient.
|
RpcAuthMethod |
getAuthMethod() |
|
java.io.InputStream |
getInputStream(java.io.InputStream in) |
Get SASL wrapped InputStream if SASL QoP requires unwrapping,
otherwise return original stream.
|
java.lang.Object |
getNegotiatedProperty(java.lang.String key) |
|
java.io.OutputStream |
getOutputStream(java.io.OutputStream out) |
Get SASL wrapped OutputStream if SASL QoP requires wrapping,
otherwise return original stream.
|
RpcAuthMethod |
saslConnect(Client.IpcStreams ipcStreams) |
Do client side SASL authentication with server via the given IpcStreams.
|
public SaslRpcClient(UserGroupInformation ugi, java.lang.Class<?> protocol, java.net.InetSocketAddress serverAddr, Configuration conf)
ugi - - connecting userprotocol - - RPC protocolserverAddr - - InetSocketAddress of remote serverconf - - Configuration@VisibleForTesting @Private public java.lang.Object getNegotiatedProperty(java.lang.String key)
@Private public RpcAuthMethod getAuthMethod()
public RpcAuthMethod saslConnect(Client.IpcStreams ipcStreams) throws java.io.IOException
ipcStreams - ipcStreams.java.io.IOException - raised on errors performing I/O.public java.io.InputStream getInputStream(java.io.InputStream in)
throws java.io.IOException
in - - InputStream used to make the connectionjava.io.IOException - raised on errors performing I/O.public java.io.OutputStream getOutputStream(java.io.OutputStream out)
throws java.io.IOException
out - - OutputStream used to make the connectionjava.io.IOException - raised on errors performing I/O.public void dispose()
throws javax.security.sasl.SaslException
javax.security.sasl.SaslException - if authentication or generating response fails,
or SASL protocol mixupCopyright © 2008–2025 Apache Software Foundation. All rights reserved.