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
TTransportFactory to create TSaslServerTransports. Ensures that a
given underlying TTransport instance receives the same TSaslServerTransport
. This is kind of an awful hack to work around the fact that Thrift is designed assuming
that TTransport instances are stateless, and thus the existing TServers
use different TTransport instances for input and output.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddServerDefinition(String mechanism, String protocol, String serverName, Map<String, String> props, CallbackHandler cbh) Add a supported server definition to the transports created by this factory.getTransport(TTransport base) Get a newTSaslServerTransportinstance, or reuse the existing one if aTSaslServerTransporthas already been created before using the givenTTransportas an underlying transport.
-
Constructor Details
-
Factory
public Factory()Create a new Factory. Assumes thataddServerDefinitionwill be called later. -
Factory
public Factory(String mechanism, String protocol, String serverName, Map<String, String> props, CallbackHandler cbh) Create a newFactory, initially with the single server definition given. You may still calladdServerDefinitionlater. See the Java documentation forSasl.createSaslServerfor the details of the parameters.
-
-
Method Details
-
addServerDefinition
public void addServerDefinition(String mechanism, String protocol, String serverName, Map<String, String> props, CallbackHandler cbh) Add a supported server definition to the transports created by this factory. See the Java documentation forSasl.createSaslServerfor the details of the parameters. -
getTransport
Get a newTSaslServerTransportinstance, or reuse the existing one if aTSaslServerTransporthas already been created before using the givenTTransportas an underlying transport. This ensures that a given underlying transport instance receives the sameTSaslServerTransport.- Overrides:
getTransportin classTTransportFactory- Parameters:
base- The base transport- Returns:
- Wrapped Transport
- Throws:
TTransportException
-