Package com.mongodb.connection.netty
Class NettyStreamFactory
- java.lang.Object
-
- com.mongodb.connection.netty.NettyStreamFactory
-
- All Implemented Interfaces:
StreamFactory
public class NettyStreamFactory extends Object implements StreamFactory
A StreamFactory for Streams based on Netty 4.x.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description NettyStreamFactory(SocketSettings settings, SslSettings sslSettings)
Construct a new instance of the factory with a default allocator, nio event loop group and nio socket channel.NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup)
Construct a new instance of the factory.NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup, io.netty.buffer.ByteBufAllocator allocator)
Construct a new instance of the factory.NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass, io.netty.buffer.ByteBufAllocator allocator)
Construct a new instance of the factory.NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass, io.netty.buffer.ByteBufAllocator allocator, io.netty.handler.ssl.SslContext sslContext)
Construct a new instance of the factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stream
create(ServerAddress serverAddress)
Create a Stream to the given address
-
-
-
Constructor Detail
-
NettyStreamFactory
public NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass, io.netty.buffer.ByteBufAllocator allocator, @Nullable io.netty.handler.ssl.SslContext sslContext)
Construct a new instance of the factory.- Parameters:
settings
- the socket settingssslSettings
- the SSL settingseventLoopGroup
- the event loop group that all channels created by this factory will be a part ofsocketChannelClass
- the socket channel classallocator
- the allocator to use for ByteBuf instancessslContext
- the NettySslContext
as specified byNettyStreamFactoryFactory.Builder.sslContext(SslContext)
.- Since:
- 4.3
-
NettyStreamFactory
public NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup, Class<? extends io.netty.channel.socket.SocketChannel> socketChannelClass, io.netty.buffer.ByteBufAllocator allocator)
Construct a new instance of the factory.- Parameters:
settings
- the socket settingssslSettings
- the SSL settingseventLoopGroup
- the event loop group that all channels created by this factory will be a part ofsocketChannelClass
- the socket channel classallocator
- the allocator to use for ByteBuf instances- Since:
- 3.3
-
NettyStreamFactory
public NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup, io.netty.buffer.ByteBufAllocator allocator)
Construct a new instance of the factory.- Parameters:
settings
- the socket settingssslSettings
- the SSL settingseventLoopGroup
- the event loop group that all channels created by this factory will be a part ofallocator
- the allocator to use for ByteBuf instances
-
NettyStreamFactory
public NettyStreamFactory(SocketSettings settings, SslSettings sslSettings, io.netty.channel.EventLoopGroup eventLoopGroup)
Construct a new instance of the factory.- Parameters:
settings
- the socket settingssslSettings
- the SSL settingseventLoopGroup
- the event loop group that all channels created by this factory will be a part of- Since:
- 3.4
-
NettyStreamFactory
public NettyStreamFactory(SocketSettings settings, SslSettings sslSettings)
Construct a new instance of the factory with a default allocator, nio event loop group and nio socket channel.- Parameters:
settings
- the socket settingssslSettings
- the SSL settings
-
-
Method Detail
-
create
public Stream create(ServerAddress serverAddress)
Description copied from interface:StreamFactory
Create a Stream to the given address- Specified by:
create
in interfaceStreamFactory
- Parameters:
serverAddress
- the address- Returns:
- the stream
-
-