public static final class FlightServer.Builder extends Object
Modifier and Type | Method and Description |
---|---|
FlightServer.Builder |
allocator(BufferAllocator allocator) |
FlightServer.Builder |
authHandler(ServerAuthHandler authHandler)
Set the authentication handler.
|
FlightServer |
build()
Create the server for this builder.
|
FlightServer.Builder |
executor(ExecutorService executor)
Set the executor used by the server.
|
FlightServer.Builder |
headerAuthenticator(CallHeaderAuthenticator headerAuthenticator)
Set the header-based authentication mechanism.
|
FlightServer.Builder |
location(Location location) |
FlightServer.Builder |
maxInboundMessageSize(int maxMessageSize)
Set the maximum size of a message.
|
<T extends FlightServerMiddleware> |
middleware(FlightServerMiddleware.Key<T> key,
FlightServerMiddleware.Factory<T> factory)
Add a Flight middleware component to inspect and modify requests to this service.
|
FlightServer.Builder |
producer(FlightProducer producer) |
FlightServer.Builder |
transportHint(String key,
Object option)
Provide a transport-specific option.
|
FlightServer.Builder |
useTls(File certChain,
File key)
Enable TLS on the server.
|
FlightServer.Builder |
useTls(InputStream certChain,
InputStream key)
Enable TLS on the server.
|
public FlightServer build()
public FlightServer.Builder maxInboundMessageSize(int maxMessageSize)
public FlightServer.Builder useTls(File certChain, File key) throws IOException
certChain
- The certificate chain to use.key
- The private key to use.IOException
public FlightServer.Builder useTls(InputStream certChain, InputStream key)
certChain
- The certificate chain to use.key
- The private key to use.public FlightServer.Builder executor(ExecutorService executor)
Flight will NOT take ownership of the executor. The application must clean it up if one is provided. (If not provided, Flight will use a default executor which it will clean up.)
public FlightServer.Builder authHandler(ServerAuthHandler authHandler)
public FlightServer.Builder headerAuthenticator(CallHeaderAuthenticator headerAuthenticator)
public FlightServer.Builder transportHint(String key, Object option)
public <T extends FlightServerMiddleware> FlightServer.Builder middleware(FlightServerMiddleware.Key<T> key, FlightServerMiddleware.Factory<T> factory)
T
- The middleware type.key
- An identifier for this middleware component. Service implementations can retrieve the middleware
instance for the current call using FlightProducer.CallContext
.factory
- A factory for the middleware.IllegalArgumentException
- if the key already existspublic FlightServer.Builder allocator(BufferAllocator allocator)
public FlightServer.Builder location(Location location)
public FlightServer.Builder producer(FlightProducer producer)
Copyright © 2023 The Apache Software Foundation. All rights reserved.