Package org.apache.thrift.transport
Class TSaslServerTransport.Factory
- java.lang.Object
-
- org.apache.thrift.transport.TTransportFactory
-
- org.apache.thrift.transport.TSaslServerTransport.Factory
-
- Enclosing class:
- TSaslServerTransport
public static class TSaslServerTransport.Factory extends TTransportFactory
TTransportFactory
to createTSaslServerTransports
. Ensures that a given underlying TTransport
instance receives the sameTSaslServerTransport
. This is kind of an awful hack to work around the fact that Thrift is designed assuming thatTTransport
instances are stateless, and thus the existingTServers
use differentTTransport
instances for input and output.
-
-
Constructor Summary
Constructors Constructor Description Factory()
Create a new Factory.Factory(java.lang.String mechanism, java.lang.String protocol, java.lang.String serverName, java.util.Map<java.lang.String,java.lang.String> props, javax.security.auth.callback.CallbackHandler cbh)
Create a newFactory
, initially with the single server definition given.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addServerDefinition(java.lang.String mechanism, java.lang.String protocol, java.lang.String serverName, java.util.Map<java.lang.String,java.lang.String> props, javax.security.auth.callback.CallbackHandler cbh)
Add a supported server definition to the transports created by this factory.TTransport
getTransport(TTransport base)
Get a newTSaslServerTransport
instance, or reuse the existing one if aTSaslServerTransport
has already been created before using the givenTTransport
as an underlying transport.
-
-
-
Constructor Detail
-
Factory
public Factory()
Create a new Factory. Assumes thataddServerDefinition
will be called later.
-
Factory
public Factory(java.lang.String mechanism, java.lang.String protocol, java.lang.String serverName, java.util.Map<java.lang.String,java.lang.String> props, javax.security.auth.callback.CallbackHandler cbh)
Create a newFactory
, initially with the single server definition given. You may still calladdServerDefinition
later. See the Java documentation forSasl.createSaslServer
for the details of the parameters.
-
-
Method Detail
-
addServerDefinition
public void addServerDefinition(java.lang.String mechanism, java.lang.String protocol, java.lang.String serverName, java.util.Map<java.lang.String,java.lang.String> props, javax.security.auth.callback.CallbackHandler cbh)
Add a supported server definition to the transports created by this factory. See the Java documentation forSasl.createSaslServer
for the details of the parameters.
-
getTransport
public TTransport getTransport(TTransport base)
Get a newTSaslServerTransport
instance, or reuse the existing one if aTSaslServerTransport
has already been created before using the givenTTransport
as an underlying transport. This ensures that a given underlying transport instance receives the sameTSaslServerTransport
.- Overrides:
getTransport
in classTTransportFactory
- Parameters:
base
- The base transport- Returns:
- Wrapped Transport
-
-