public abstract class AbstractFactoryManager extends AbstractKexFactoryManager implements FactoryManager
AbstractCloseable.State
AttributeRepository.AttributeKey<T>
closeFuture, lock, state
log
AGENT_FORWARDING_TYPE, AGENT_FORWARDING_TYPE_IETF, AGENT_FORWARDING_TYPE_OPENSSH, AUTH_TIMEOUT, CHANNEL_CLOSE_TIMEOUT, DEFAULT_AUTH_TIMEOUT, DEFAULT_CHANNEL_CLOSE_TIMEOUT, DEFAULT_DISCONNECT_TIMEOUT, DEFAULT_IDLE_TIMEOUT, DEFAULT_IGNORE_MESSAGE_FREQUENCY, DEFAULT_IGNORE_MESSAGE_SIZE, DEFAULT_IGNORE_MESSAGE_VARIANCE, DEFAULT_LIMIT_PACKET_SIZE, DEFAULT_MAX_IDENTIFICATION_SIZE, DEFAULT_MAX_PACKET_SIZE, DEFAULT_NIO_WORKERS, DEFAULT_NIO2_MIN_WRITE_TIMEOUT, DEFAULT_NIO2_READ_TIMEOUT, DEFAULT_REKEY_BYTES_LIMIT, DEFAULT_REKEY_PACKETS_LIMIT, DEFAULT_REKEY_TIME_LIMIT, DEFAULT_STOP_WAIT_TIME, DEFAULT_VERSION, DEFAULT_WINDOW_SIZE, DEFAULT_WINDOW_TIMEOUT, DISCONNECT_TIMEOUT, IDLE_TIMEOUT, IGNORE_MESSAGE_FREQUENCY, IGNORE_MESSAGE_SIZE, IGNORE_MESSAGE_VARIANCE, LIMIT_PACKET_SIZE, MAX_IDENTIFICATION_SIZE, MAX_PACKET_SIZE, NIO_WORKERS, NIO2_MIN_WRITE_TIMEOUT, NIO2_READ_BUFFER_SIZE, NIO2_READ_TIMEOUT, REKEY_BLOCKS_LIMIT, REKEY_BYTES_LIMIT, REKEY_PACKETS_LIMIT, REKEY_TIME_LIMIT, SOCKET_BACKLOG, SOCKET_KEEPALIVE, SOCKET_LINGER, SOCKET_RCVBUF, SOCKET_REUSEADDR, SOCKET_SNDBUF, STOP_WAIT_TIME, TCP_NODELAY, WINDOW_SIZE, WINDOW_TIMEOUT
NONE
EMPTY
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
AbstractFactoryManager() |
getCipherFactories, getCompressionFactories, getDelegate, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKeyExchangeFactories, setMacFactories, setSignatureFactories
doCloseGracefully, doCloseImmediately, getInnerCloseable
addCloseFutureListener, builder, close, isClosed, isClosing, preClose, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAgentForwardingFilter, getTcpForwardingFilter, getX11ForwardingFilter, resolveAttribute, resolveAttribute
getCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNames
getSignatureFactories, getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, resolveSignatureFactories, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver
ofAttributesMap, ofKeyValuePair
getBoolean, getBooleanProperty, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty
close, close, getMaxCloseWaitTime, isOpen
protected IoServiceFactoryFactory ioServiceFactoryFactory
protected IoServiceFactory ioServiceFactory
protected List<NamedFactory<Channel>> channelFactories
protected SshAgentFactory agentFactory
protected ScheduledExecutorService executor
protected boolean shutdownExecutor
protected ForwardingFilterFactory forwarderFactory
protected ForwardingFilter forwardingFilter
protected FileSystemFactory fileSystemFactory
protected List<ServiceFactory> serviceFactories
protected List<RequestHandler<ConnectionService>> globalRequestHandlers
protected SessionTimeoutListener sessionTimeoutListener
protected ScheduledFuture<?> timeoutListenerFuture
protected final Collection<SessionListener> sessionListeners
protected final SessionListener sessionListenerProxy
protected final Collection<ChannelListener> channelListeners
protected final ChannelListener channelListenerProxy
protected final Collection<PortForwardingEventListener> tunnelListeners
protected final PortForwardingEventListener tunnelListenerProxy
public IoServiceFactory getIoServiceFactory()
getIoServiceFactory
in interface FactoryManager
public IoServiceFactoryFactory getIoServiceFactoryFactory()
public void setIoServiceFactoryFactory(IoServiceFactoryFactory ioServiceFactory)
public IoServiceEventListener getIoServiceEventListener()
getIoServiceEventListener
in interface IoServiceEventListenerManager
public void setIoServiceEventListener(IoServiceEventListener listener)
setIoServiceEventListener
in interface IoServiceEventListenerManager
public Factory<Random> getRandomFactory()
FactoryManager
Random
factory to be used.getRandomFactory
in interface FactoryManager
Random
factory, never null
public Map<String,Object> getProperties()
PropertyResolver
A map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the
expected configuration value type - Long, Integer, Boolean,
String
, etc.... If it doesn't, the toString()
result of the
mapped value is used to convert it to the required type. E.g., if the
mapped value is the string "1234" and the expected value
is a long
then it will be parsed into one. Also, if the mapped
value is an Integer
but a long
is expected, then it will
be converted into one.
getProperties
in interface PropertyResolver
Map
containing configuration values, never null
.
Note: may be immutable.public int getAttributesCount()
getAttributesCount
in interface AttributeRepository
public <T> T getAttribute(AttributeRepository.AttributeKey<T> key)
AttributeRepository
getAttribute
in interface AttributeRepository
T
- The generic attribute typekey
- The key of the attribute; must not be null
.null
if there is no value associated with the specified keypublic Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
attributeKeys
in interface AttributeRepository
Collection
snapshot of all the currently registered
attributes in the repositorypublic <T> T computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)
AttributeStore
null
), attempts to compute its value using the given mapping
function and enters it into this map unless null
.computeAttributeIfAbsent
in interface AttributeStore
T
- The generic attribute typekey
- The key of the attribute; must not be null
.resolver
- The (never null
) mapping function to use if value
not already mapped. If returns null
then value is not mapped to
the provided key.null
if value not mapped and resolver
did not return a non-null
value for itpublic <T> T setAttribute(AttributeRepository.AttributeKey<T> key, T value)
AttributeStore
setAttribute
in interface AttributeStore
T
- The generic attribute typekey
- The key of the attribute; must not be null
.value
- The value of the attribute; must not be null
.null
if it is new.public <T> T removeAttribute(AttributeRepository.AttributeKey<T> key)
AttributeStore
removeAttribute
in interface AttributeStore
T
- The generic attribute typekey
- The key of the attribute; must not be null
.null
if no previous valuepublic void clearAttributes()
AttributeStore
clearAttributes
in interface AttributeStore
public PropertyResolver getParentPropertyResolver()
getParentPropertyResolver
in interface PropertyResolver
null
if no parentpublic void setParentPropertyResolver(PropertyResolver parent)
public String getVersion()
FactoryManager
SSHD-CORE-1.0
getVersion
in interface FactoryManager
public List<NamedFactory<Channel>> getChannelFactories()
FactoryManager
Channel
objects.getChannelFactories
in interface FactoryManager
Channel
factories, never null
public void setChannelFactories(List<NamedFactory<Channel>> channelFactories)
public int getNioWorkers()
public void setNioWorkers(int nioWorkers)
public SshAgentFactory getAgentFactory()
FactoryManager
SshAgent
objects.getAgentFactory
in interface FactoryManager
SshAgentFactory
public void setAgentFactory(SshAgentFactory agentFactory)
public ScheduledExecutorService getScheduledExecutorService()
FactoryManager
ScheduledExecutorService
to be used.getScheduledExecutorService
in interface FactoryManager
ScheduledExecutorService
, never null
public void setScheduledExecutorService(ScheduledExecutorService executor)
public void setScheduledExecutorService(ScheduledExecutorService executor, boolean shutdownExecutor)
public ForwardingFilterFactory getForwarderFactory()
FactoryManager
getForwarderFactory
in interface FactoryManager
ForwardingFilterFactory
public void setForwarderFactory(ForwardingFilterFactory forwarderFactory)
public ForwardingFilter getForwardingFilter()
FactoryManager
ForwardingFilter
to be used by the SSH server.
If no filter has been configured (i.e. this method returns
null
), then all forwarding requests will be rejected.getForwardingFilter
in interface FactoryManager
ForwardingFilter
or null
public void setForwardingFilter(ForwardingFilter forwardingFilter)
public FileSystemFactory getFileSystemFactory()
FactoryManager
FileSystemFactory
to be used to traverse the file system.getFileSystemFactory
in interface FactoryManager
FileSystemFactory
instance or null
if file based
interactions are not supported on this serverpublic void setFileSystemFactory(FileSystemFactory fileSystemFactory)
public List<ServiceFactory> getServiceFactories()
FactoryManager
Service
factories.getServiceFactories
in interface FactoryManager
Service
factories, never null
public void setServiceFactories(List<ServiceFactory> serviceFactories)
public List<RequestHandler<ConnectionService>> getGlobalRequestHandlers()
FactoryManager
getGlobalRequestHandlers
in interface FactoryManager
GlobalRequestHandler
public void setGlobalRequestHandlers(List<RequestHandler<ConnectionService>> globalRequestHandlers)
public ReservedSessionMessagesHandler getReservedSessionMessagesHandler()
getReservedSessionMessagesHandler
in interface ReservedSessionMessagesManager
ReservedSessionMessagesHandler
- may be null
public void setReservedSessionMessagesHandler(ReservedSessionMessagesHandler handler)
setReservedSessionMessagesHandler
in interface ReservedSessionMessagesManager
handler
- The ReservedSessionMessagesHandler
to use - may be null
public ChannelStreamPacketWriterResolver getChannelStreamPacketWriterResolver()
getChannelStreamPacketWriterResolver
in interface ChannelStreamPacketWriterResolverManager
public void setChannelStreamPacketWriterResolver(ChannelStreamPacketWriterResolver resolver)
setChannelStreamPacketWriterResolver
in interface ChannelStreamPacketWriterResolverManager
public UnknownChannelReferenceHandler getUnknownChannelReferenceHandler()
getUnknownChannelReferenceHandler
in interface UnknownChannelReferenceHandlerManager
UnknownChannelReferenceHandlerManager
to use - if
null
then any reference to unknown channel causes an SshChannelNotFoundException
public void setUnknownChannelReferenceHandler(UnknownChannelReferenceHandler unknownChannelReferenceHandler)
setUnknownChannelReferenceHandler
in interface UnknownChannelReferenceHandlerManager
unknownChannelReferenceHandler
- The UnknownChannelReferenceHandlerManager
to use - if
null
then any reference to unknown channel causes an SshChannelNotFoundException
public UnknownChannelReferenceHandler resolveUnknownChannelReferenceHandler()
UnknownChannelReferenceHandlerManager
resolveUnknownChannelReferenceHandler
in interface UnknownChannelReferenceHandlerManager
public void addSessionListener(SessionListener listener)
SessionListenerManager
addSessionListener
in interface SessionListenerManager
listener
- The SessionListener
to add - not null
public void removeSessionListener(SessionListener listener)
SessionListenerManager
removeSessionListener
in interface SessionListenerManager
listener
- The SessionListener
to removepublic SessionListener getSessionListenerProxy()
getSessionListenerProxy
in interface SessionListenerManager
null
proxy SessionListener
that represents
all the currently registered listeners. Any method invocation on the proxy
is replicated to the currently registered listenerspublic void addChannelListener(ChannelListener listener)
ChannelListenerManager
addChannelListener
in interface ChannelListenerManager
listener
- The ChannelListener
to add - not null
public void removeChannelListener(ChannelListener listener)
ChannelListenerManager
removeChannelListener
in interface ChannelListenerManager
listener
- The ChannelListener
to removepublic ChannelListener getChannelListenerProxy()
getChannelListenerProxy
in interface ChannelListenerManager
null
proxy ChannelListener
that represents
all the currently registered listeners. Any method invocation on the proxy
is replicated to the currently registered listenerspublic PortForwardingEventListener getPortForwardingEventListenerProxy()
getPortForwardingEventListenerProxy
in interface PortForwardingEventListenerManager
public void addPortForwardingEventListener(PortForwardingEventListener listener)
PortForwardingEventListenerManager
addPortForwardingEventListener
in interface PortForwardingEventListenerManager
listener
- The PortForwardingEventListener
to add - never null
public void removePortForwardingEventListener(PortForwardingEventListener listener)
PortForwardingEventListenerManager
removePortForwardingEventListener
in interface PortForwardingEventListenerManager
listener
- The PortForwardingEventListener
to remove - ignored if null
protected void setupSessionTimeout(AbstractSessionFactory<?,?> sessionFactory)
protected void removeSessionTimeout(AbstractSessionFactory<?,?> sessionFactory)
protected SessionTimeoutListener createSessionTimeoutListener()
protected void stopSessionTimeoutListener(AbstractSessionFactory<?,?> sessionFactory)
protected void checkConfig()
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.