public class SshEngineContext
extends java.lang.Object
SshEngine has a single configuration context.| Modifier and Type | Method and Description |
|---|---|
static void |
addEventListener(EventListener listener) |
ListeningInterface |
addListeningInterface(java.net.InetAddress addressToBind,
int portToBind,
ProtocolContextFactory<?> contextFactory,
boolean reuseAddress)
Add an interface and port to the listening socket list and provide the
protocol context.
|
ListeningInterface |
addListeningInterface(java.lang.String addressToBind,
int portToBind,
ProtocolContextFactory<?> contextFactory,
boolean reuseAddress)
Add an interface and port to the listening socket list and provide the
protocol context.
|
<K> K |
getAttribute(java.lang.String name,
K defaultValue) |
com.sshtools.common.util.ByteBufferPool |
getBufferPool()
Returns a direct buffer pool.
|
SshEngine |
getEngine()
Get the instance of the SSHD for this context.
|
int |
getIdleServiceRunPeriod()
Get the time in seconds for each idle period service run.
|
int |
getInactiveServiceRunsPerIdleEvent()
To determine whether any channels are idle a service run is performed to
evaluate the state of each channel.
|
java.lang.String |
getIpv6WorkaroundBindAddress() |
int |
getIpv6WorkaroundPort() |
ListeningInterface[] |
getListeningInterfaces()
Get the listening socket list.
|
int |
getMaximumChannelsPerThread()
Get the maximum number of channels that can be serviced by a single
selector thread.
|
int |
getMaximumConnections()
Get the maximum number of connections allowed at any one time.
|
int |
getPermanentAcceptThreads()
Get the number of permanent accept threads.
|
int |
getPermanentConnectThreads()
Get the number of permanent connect threads.
|
int |
getPermanentTransferThreads()
Get the number of permanent transfer threads.
|
java.lang.String |
getProduct()
Get the product name used to prefix thread names
|
java.nio.channels.spi.SelectorProvider |
getSelectorProvider()
Get the SelectorProvider used to create Selector instances.
|
java.lang.String |
getTooManyConnectionsText()
Get the text used when disconnecting when the maximum connection threshold has been reached.
|
boolean |
isUsingDirectBuffers()
Determine whether the daemon is using direct byte buffers.
|
static void |
removeEventListener(EventListener listener) |
void |
removeListeningInterface(java.net.InetAddress addressBound,
int portBound)
Remove a listening interface from the daemon at runtime.
|
void |
removeListeningInterface(java.lang.String anInterface)
Deprecated.
use
removeListeningInterface(String, int) instead. |
void |
removeListeningInterface(java.lang.String addressBound,
int portBound)
Remove a listening interface from the daemon at runtime.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value) |
void |
setBufferPoolArraySize(int bufferPoolArraySize)
Set the size of the byte buffers in the pool.
|
void |
setIdleServiceRunPeriod(int idleServicePeriod) |
void |
setInactiveServiceRunsPerIdleEvent(int inactivePeriodsPerIdleEvent)
To determine whether any channels are idle a service run is performed to
evaluate the state of each channel.
|
void |
setIpv6WorkaroundBindAddress(java.lang.String ipv6WorkaroundBindAddress) |
void |
setIpv6WorkaroundPort(int ipv6WorkaroundPort) |
void |
setMaximumChannelsPerThread(int maximumChannelsPerThread)
Set the maximum number of channels that can be serviced by a single
selector thread.
|
void |
setMaximumConnections(int maximumConnections)
Set the maximum number of connections allowed at any one time.
|
void |
setPermanentAcceptThreads(int permanentAcceptThreads)
Set the number of permanent accept threads.
|
void |
setPermanentConnectThreads(int permanentConnectThreads)
Set the number of permanent connect threads.
|
void |
setPermanentTransferThreads(int permanentTransferThreads)
Set the number of permanent transfer threads.
|
void |
setProduct(java.lang.String product)
Set the product name
|
void |
setSelectorProvider(java.nio.channels.spi.SelectorProvider selectorProvider)
Set the SelectorProvider used by the Selector threads.
|
void |
setTooManyConnectionsText(java.lang.String tooManyConnectionsText)
Set the text used when disconnecting when the maximum connection threshold has been reached.
|
void |
setUsingDirectBuffers(boolean useDirectByteBuffers)
Configure the byte buffer pool to use direct byte buffers.
|
public void setProduct(java.lang.String product)
String - productpublic java.lang.String getProduct()
public void setMaximumConnections(int maximumConnections)
maximumConnections - intpublic int getMaximumConnections()
public java.lang.String getTooManyConnectionsText()
public void setTooManyConnectionsText(java.lang.String tooManyConnectionsText)
tooManyConnectionsText - public com.sshtools.common.util.ByteBufferPool getBufferPool()
public void setSelectorProvider(java.nio.channels.spi.SelectorProvider selectorProvider)
selectorProvider - SelectorProviderpublic java.nio.channels.spi.SelectorProvider getSelectorProvider()
public SshEngine getEngine()
public boolean isUsingDirectBuffers()
public void setUsingDirectBuffers(boolean useDirectByteBuffers)
useDirectByteBuffers - booleanpublic void setBufferPoolArraySize(int bufferPoolArraySize)
bufferPoolArraySize - intpublic ListeningInterface addListeningInterface(java.lang.String addressToBind, int portToBind, ProtocolContextFactory<?> contextFactory, boolean reuseAddress) throws java.io.IOException
addressToBind - StringportToBind - intprotocolContext - java.io.IOExceptionjava.io.IOExceptionpublic ListeningInterface addListeningInterface(java.net.InetAddress addressToBind, int portToBind, ProtocolContextFactory<?> contextFactory, boolean reuseAddress) throws java.io.IOException
addressToBind - portToBind - context - java.io.IOExceptionpublic void removeListeningInterface(java.net.InetAddress addressBound,
int portBound)
addressBound - portBound - public void removeListeningInterface(java.lang.String addressBound,
int portBound)
throws java.net.UnknownHostException
addressBound - portBound - java.net.UnknownHostExceptionpublic void removeListeningInterface(java.lang.String anInterface)
throws java.io.IOException
removeListeningInterface(String, int) instead.String - anInterfacejava.io.IOExceptionpublic ListeningInterface[] getListeningInterfaces()
public int getPermanentAcceptThreads()
public void setPermanentAcceptThreads(int permanentAcceptThreads)
An accept thread services the asynchronous server socket by processing requests for connections. Once a connection has been accepted it is then registered with a transfer thread where all IO is handled.
The server maintains this number of permanent threads but will also dynamically create additional threads if the permanent threads are overloaded.
permanentAcceptThreads - public int getPermanentConnectThreads()
public void setPermanentConnectThreads(int permanentConnectThreads)
permanentConnectThreads - public int getPermanentTransferThreads()
public void setPermanentTransferThreads(int permanentTransferThreads)
permanentAcceptThreads - public int getMaximumChannelsPerThread()
public void setMaximumChannelsPerThread(int maximumChannelsPerThread)
maximumChannelsPerThread - public int getIdleServiceRunPeriod()
public void setIdleServiceRunPeriod(int idleServicePeriod)
idleServicePeriod - intpublic int getInactiveServiceRunsPerIdleEvent()
public void setInactiveServiceRunsPerIdleEvent(int inactivePeriodsPerIdleEvent)
inactivePeriodsPerIdleEvent - intpublic static void addEventListener(EventListener listener)
public static void removeEventListener(EventListener listener)
public int getIpv6WorkaroundPort()
public void setIpv6WorkaroundPort(int ipv6WorkaroundPort)
public java.lang.String getIpv6WorkaroundBindAddress()
public void setIpv6WorkaroundBindAddress(java.lang.String ipv6WorkaroundBindAddress)
public void setAttribute(java.lang.String name,
java.lang.Object value)
public <K> K getAttribute(java.lang.String name,
K defaultValue)
Copyright © 2021. All rights reserved.