Package org.jenkinsci.remoting.engine
Class JnlpProtocolHandlerFactory
- java.lang.Object
-
- org.jenkinsci.remoting.engine.JnlpProtocolHandlerFactory
-
public class JnlpProtocolHandlerFactory extends Object
Builds a set ofJnlpProtocolHandler
instances from the supplied preconditions.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description JnlpProtocolHandlerFactory(ExecutorService threadPool)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<JnlpProtocolHandler<? extends JnlpConnectionState>>
handlers()
Creates the list ofJnlpProtocolHandler
instances that are available with the current configuration.JnlpProtocolHandlerFactory
withClientDatabase(JnlpClientDatabase clientDatabase)
Add aJnlpClientDatabase
.JnlpProtocolHandlerFactory
withIOHub(IOHub ioHub)
Add aIOHub
.JnlpProtocolHandlerFactory
withNioChannelHub(NioChannelHub nioChannelHub)
Add aNioChannelHub
.JnlpProtocolHandlerFactory
withPreferNonBlockingIO(boolean preferNio)
Set the I/O blocking mode preferencesJnlpProtocolHandlerFactory
withSSLClientAuthRequired(boolean needClientAuth)
Set the policy on client authentication certificates to use forJnlpProtocolHandler.handle(Socket, Map, List)
calls.JnlpProtocolHandlerFactory
withSSLContext(SSLContext context)
Add aSSLContext
.
-
-
-
Constructor Detail
-
JnlpProtocolHandlerFactory
public JnlpProtocolHandlerFactory(@NonNull ExecutorService threadPool)
Constructor.- Parameters:
threadPool
- the thread pool to use.
-
-
Method Detail
-
withNioChannelHub
public JnlpProtocolHandlerFactory withNioChannelHub(@CheckForNull NioChannelHub nioChannelHub)
Add aNioChannelHub
.- Parameters:
nioChannelHub
- theNioChannelHub
.- Returns:
this
for method chaining.
-
withIOHub
public JnlpProtocolHandlerFactory withIOHub(@CheckForNull IOHub ioHub)
Add aIOHub
.- Parameters:
ioHub
- theIOHub
.- Returns:
this
for method chaining.
-
withSSLContext
public JnlpProtocolHandlerFactory withSSLContext(@CheckForNull SSLContext context)
Add aSSLContext
.- Parameters:
context
- theSSLContext
.- Returns:
this
for method chaining.
-
withSSLClientAuthRequired
public JnlpProtocolHandlerFactory withSSLClientAuthRequired(boolean needClientAuth)
Set the policy on client authentication certificates to use forJnlpProtocolHandler.handle(Socket, Map, List)
calls.- Parameters:
needClientAuth
-true
to reject connections over TLS where the client does not present a client certificate.- Returns:
this
for method chaining.
-
withPreferNonBlockingIO
public JnlpProtocolHandlerFactory withPreferNonBlockingIO(boolean preferNio)
Set the I/O blocking mode preferences- Parameters:
preferNio
-true
to prefer using Non-Blocking I/O techniques,false
to prefer thread-per-connection Blocking I/O.- Returns:
this
for method chaining.
-
withClientDatabase
public JnlpProtocolHandlerFactory withClientDatabase(@CheckForNull JnlpClientDatabase clientDatabase)
Add aJnlpClientDatabase
.- Parameters:
clientDatabase
- theJnlpClientDatabase
.- Returns:
this
for method chaining.
-
handlers
@NonNull public List<JnlpProtocolHandler<? extends JnlpConnectionState>> handlers()
Creates the list ofJnlpProtocolHandler
instances that are available with the current configuration.- Returns:
- the
JnlpProtocolHandler
instances, may be empty, nevernull
-
-