|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.blur.thirdparty.thrift_0_9_0.transport.TTransport
org.apache.blur.thirdparty.thrift_0_9_0.transport.TSaslClientTransport
public class TSaslClientTransport
Wraps another Thrift TTransport
, but performs SASL client
negotiation on the call to open()
. This class will wrap ensuing
communication over it, if a SASL QOP is negotiated with the other party.
Constructor Summary | |
---|---|
TSaslClientTransport(javax.security.sasl.SaslClient saslClient,
TTransport transport)
Uses the given SaslClient . |
|
TSaslClientTransport(String mechanism,
String authorizationId,
String protocol,
String serverName,
Map<String,String> props,
CallbackHandler cbh,
TTransport transport)
Creates a SaslClient using the given SASL-specific parameters. |
Method Summary | |
---|---|
void |
close()
Closes the underlying transport and disposes of the SASL implementation underlying this transport. |
void |
flush()
Flushes to the underlying transport. |
javax.security.sasl.SaslClient |
getSaslClient()
Get the underlying SaslClient . |
javax.security.sasl.SaslServer |
getSaslServer()
Get the underlying SaslServer . |
TTransport |
getUnderlyingTransport()
Get the underlying transport that Sasl is using. |
boolean |
isOpen()
True if the underlying transport is open and the SASL handshake is complete. |
void |
open()
Opens the underlying transport if it's not already open and then performs SASL negotiation. |
int |
read(byte[] buf,
int off,
int len)
Read from the underlying transport. |
void |
write(byte[] buf,
int off,
int len)
Write to the underlying transport. |
Methods inherited from class org.apache.blur.thirdparty.thrift_0_9_0.transport.TTransport |
---|
consumeBuffer, getBuffer, getBufferPosition, getBytesRemainingInBuffer, peek, readAll, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TSaslClientTransport(javax.security.sasl.SaslClient saslClient, TTransport transport)
SaslClient
.
saslClient
- The SaslClient
to use for the subsequent SASL
negotiation.transport
- Transport underlying this one.public TSaslClientTransport(String mechanism, String authorizationId, String protocol, String serverName, Map<String,String> props, CallbackHandler cbh, TTransport transport) throws javax.security.sasl.SaslException
SaslClient
using the given SASL-specific parameters.
See the Java documentation for Sasl.createSaslClient
for the
details of the parameters.
transport
- The underlying Thrift transport.
javax.security.sasl.SaslException
Method Detail |
---|
public void open() throws TTransportException
open
in class TTransport
TTransportException
- if the transport could not be openedpublic javax.security.sasl.SaslClient getSaslClient()
SaslClient
.
SaslClient
, or null
if this transport
is backed by a SaslServer
.public TTransport getUnderlyingTransport()
TTransport
transportpublic javax.security.sasl.SaslServer getSaslServer()
SaslServer
.
SaslServer
, or null
if this transport
is backed by a SaslClient
.public void close()
close
in class TTransport
public boolean isOpen()
isOpen
in class TTransport
public int read(byte[] buf, int off, int len) throws TTransportException
read
in class TTransport
buf
- Array to read intooff
- Index to start reading atlen
- Maximum number of bytes to read
TTransportException
- if there was an error reading datapublic void write(byte[] buf, int off, int len) throws TTransportException
write
in class TTransport
buf
- The output data bufferoff
- The offset to start writing fromlen
- The number of bytes to write
TTransportException
- if there was an error writing datapublic void flush() throws TTransportException
flush
in class TTransport
TTransportException
- if there was an error writing out data.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |