public abstract class AbstractFactoryManager extends AbstractKexFactoryManager implements FactoryManager
AbstractCloseable.State
AttributeRepository.AttributeKey<T>
SessionHeartbeatController.HeartbeatType
closeFuture, futureLock, state
log
DEFAULT_VERSION
NONE
EMPTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractFactoryManager() |
getCipherFactories, getCompressionFactories, getDelegate, getKexExtensionHandler, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKexExtensionHandler, setKeyExchangeFactories, setMacFactories, setSignatureFactories
doCloseGracefully, doCloseImmediately, getInnerCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, preClose, removeCloseFutureListener
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
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, resolveSignatureFactories, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames
getKexExtensionHandler, setKexExtensionHandler
resolveChannelStreamWriter, resolveChannelStreamWriterResolver
ofAttributesMap, ofKeyValuePair
disableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeat, setSessionHeartbeat
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmpty, isEmpty
close, close, getMaxCloseWaitTime, isOpen
protected IoServiceFactoryFactory ioServiceFactoryFactory
protected IoServiceFactory ioServiceFactory
protected List<? extends ChannelFactory> channelFactories
protected SshAgentFactory agentFactory
protected ScheduledExecutorService executor
protected boolean shutdownExecutor
protected ForwarderFactory forwarderFactory
protected ForwardingFilter forwardingFilter
protected FileSystemFactory fileSystemFactory
protected List<? extends 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<? extends 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<? extends ChannelFactory> getChannelFactories()
FactoryManager
Channel
objects.getChannelFactories
in interface FactoryManager
ChannelFactory
-ies, never null
public void setChannelFactories(List<? extends ChannelFactory> 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 ForwarderFactory getForwarderFactory()
FactoryManager
getForwarderFactory
in interface FactoryManager
ForwarderFactory
public void setForwarderFactory(ForwarderFactory 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<? extends ServiceFactory> getServiceFactories()
FactoryManager
Service
factories.getServiceFactories
in interface FactoryManager
Service
factories, never null
public void setServiceFactories(List<? extends 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 SessionDisconnectHandler getSessionDisconnectHandler()
getSessionDisconnectHandler
in interface SessionDisconnectHandlerManager
public void setSessionDisconnectHandler(SessionDisconnectHandler sessionDisconnectHandler)
setSessionDisconnectHandler
in interface SessionDisconnectHandlerManager
public ChannelStreamWriterResolver getChannelStreamWriterResolver()
getChannelStreamWriterResolver
in interface ChannelStreamWriterResolverManager
public void setChannelStreamWriterResolver(ChannelStreamWriterResolver resolver)
setChannelStreamWriterResolver
in interface ChannelStreamWriterResolverManager
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–2024 The Apache Software Foundation. All rights reserved.