public abstract class AbstractFactoryManager extends AbstractKexFactoryManager implements FactoryManager
AbstractCloseable.StateAttributeRepository.AttributeKey<T>closeFuture, lock, statelogAGENT_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_TIMEOUTNONEEMPTYCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFactoryManager() |
getCipherFactories, getCompressionFactories, getDelegate, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKeyExchangeFactories, setMacFactories, setSignatureFactoriesdoCloseGracefully, doCloseImmediately, getInnerCloseableaddCloseFutureListener, builder, close, isClosed, isClosing, preClose, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAgentForwardingFilter, getTcpForwardingFilter, getX11ForwardingFilter, resolveAttribute, resolveAttributegetCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNamesgetSignatureFactories, getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, resolveSignatureFactories, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNamesresolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolverofAttributesMap, ofKeyValuePairgetBoolean, getBooleanProperty, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringPropertyclose, close, getMaxCloseWaitTime, isOpenprotected 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 FactoryManagerpublic IoServiceFactoryFactory getIoServiceFactoryFactory()
public void setIoServiceFactoryFactory(IoServiceFactoryFactory ioServiceFactory)
public IoServiceEventListener getIoServiceEventListener()
getIoServiceEventListener in interface IoServiceEventListenerManagerpublic void setIoServiceEventListener(IoServiceEventListener listener)
setIoServiceEventListener in interface IoServiceEventListenerManagerpublic Factory<Random> getRandomFactory()
FactoryManagerRandom factory to be used.getRandomFactory in interface FactoryManagerRandom factory, never nullpublic Map<String,Object> getProperties()
PropertyResolverA 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 PropertyResolverMap containing configuration values, never null.
Note: may be immutable.public int getAttributesCount()
getAttributesCount in interface AttributeRepositorypublic <T> T getAttribute(AttributeRepository.AttributeKey<T> key)
AttributeRepositorygetAttribute in interface AttributeRepositoryT - 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 AttributeRepositoryCollection 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)
AttributeStorenull), attempts to compute its value using the given mapping
function and enters it into this map unless null.computeAttributeIfAbsent in interface AttributeStoreT - 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)
AttributeStoresetAttribute in interface AttributeStoreT - 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)
AttributeStoreremoveAttribute in interface AttributeStoreT - The generic attribute typekey - The key of the attribute; must not be null.null if no previous valuepublic void clearAttributes()
AttributeStoreclearAttributes in interface AttributeStorepublic PropertyResolver getParentPropertyResolver()
getParentPropertyResolver in interface PropertyResolvernull if no parentpublic void setParentPropertyResolver(PropertyResolver parent)
public String getVersion()
FactoryManagerSSHD-CORE-1.0getVersion in interface FactoryManagerpublic List<NamedFactory<Channel>> getChannelFactories()
FactoryManagerChannel objects.getChannelFactories in interface FactoryManagerChannel factories, never nullpublic void setChannelFactories(List<NamedFactory<Channel>> channelFactories)
public int getNioWorkers()
public void setNioWorkers(int nioWorkers)
public SshAgentFactory getAgentFactory()
FactoryManagerSshAgent objects.getAgentFactory in interface FactoryManagerSshAgentFactorypublic void setAgentFactory(SshAgentFactory agentFactory)
public ScheduledExecutorService getScheduledExecutorService()
FactoryManagerScheduledExecutorService to be used.getScheduledExecutorService in interface FactoryManagerScheduledExecutorService, never nullpublic void setScheduledExecutorService(ScheduledExecutorService executor)
public void setScheduledExecutorService(ScheduledExecutorService executor, boolean shutdownExecutor)
public ForwardingFilterFactory getForwarderFactory()
FactoryManagergetForwarderFactory in interface FactoryManagerForwardingFilterFactorypublic void setForwarderFactory(ForwardingFilterFactory forwarderFactory)
public ForwardingFilter getForwardingFilter()
FactoryManagerForwardingFilter 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 FactoryManagerForwardingFilter or nullpublic void setForwardingFilter(ForwardingFilter forwardingFilter)
public FileSystemFactory getFileSystemFactory()
FactoryManagerFileSystemFactory to be used to traverse the file system.getFileSystemFactory in interface FactoryManagerFileSystemFactory instance or null if file based
interactions are not supported on this serverpublic void setFileSystemFactory(FileSystemFactory fileSystemFactory)
public List<ServiceFactory> getServiceFactories()
FactoryManagerService factories.getServiceFactories in interface FactoryManagerService factories, never nullpublic void setServiceFactories(List<ServiceFactory> serviceFactories)
public List<RequestHandler<ConnectionService>> getGlobalRequestHandlers()
FactoryManagergetGlobalRequestHandlers in interface FactoryManagerGlobalRequestHandlerpublic void setGlobalRequestHandlers(List<RequestHandler<ConnectionService>> globalRequestHandlers)
public ReservedSessionMessagesHandler getReservedSessionMessagesHandler()
getReservedSessionMessagesHandler in interface ReservedSessionMessagesManagerReservedSessionMessagesHandler - may be nullpublic void setReservedSessionMessagesHandler(ReservedSessionMessagesHandler handler)
setReservedSessionMessagesHandler in interface ReservedSessionMessagesManagerhandler - The ReservedSessionMessagesHandler to use - may be nullpublic ChannelStreamPacketWriterResolver getChannelStreamPacketWriterResolver()
getChannelStreamPacketWriterResolver in interface ChannelStreamPacketWriterResolverManagerpublic void setChannelStreamPacketWriterResolver(ChannelStreamPacketWriterResolver resolver)
setChannelStreamPacketWriterResolver in interface ChannelStreamPacketWriterResolverManagerpublic UnknownChannelReferenceHandler getUnknownChannelReferenceHandler()
getUnknownChannelReferenceHandler in interface UnknownChannelReferenceHandlerManagerUnknownChannelReferenceHandlerManager to use - if
null then any reference to unknown channel causes an SshChannelNotFoundExceptionpublic void setUnknownChannelReferenceHandler(UnknownChannelReferenceHandler unknownChannelReferenceHandler)
setUnknownChannelReferenceHandler in interface UnknownChannelReferenceHandlerManagerunknownChannelReferenceHandler - The UnknownChannelReferenceHandlerManager to use - if
null then any reference to unknown channel causes an SshChannelNotFoundExceptionpublic UnknownChannelReferenceHandler resolveUnknownChannelReferenceHandler()
UnknownChannelReferenceHandlerManagerresolveUnknownChannelReferenceHandler in interface UnknownChannelReferenceHandlerManagerpublic void addSessionListener(SessionListener listener)
SessionListenerManageraddSessionListener in interface SessionListenerManagerlistener - The SessionListener to add - not nullpublic void removeSessionListener(SessionListener listener)
SessionListenerManagerremoveSessionListener in interface SessionListenerManagerlistener - The SessionListener to removepublic SessionListener getSessionListenerProxy()
getSessionListenerProxy in interface SessionListenerManagernull 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)
ChannelListenerManageraddChannelListener in interface ChannelListenerManagerlistener - The ChannelListener to add - not nullpublic void removeChannelListener(ChannelListener listener)
ChannelListenerManagerremoveChannelListener in interface ChannelListenerManagerlistener - The ChannelListener to removepublic ChannelListener getChannelListenerProxy()
getChannelListenerProxy in interface ChannelListenerManagernull 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 PortForwardingEventListenerManagerpublic void addPortForwardingEventListener(PortForwardingEventListener listener)
PortForwardingEventListenerManageraddPortForwardingEventListener in interface PortForwardingEventListenerManagerlistener - The PortForwardingEventListener to add - never nullpublic void removePortForwardingEventListener(PortForwardingEventListener listener)
PortForwardingEventListenerManagerremovePortForwardingEventListener in interface PortForwardingEventListenerManagerlistener - The PortForwardingEventListener to remove - ignored if nullprotected void setupSessionTimeout(AbstractSessionFactory<?,?> sessionFactory)
protected void removeSessionTimeout(AbstractSessionFactory<?,?> sessionFactory)
protected SessionTimeoutListener createSessionTimeoutListener()
protected void stopSessionTimeoutListener(AbstractSessionFactory<?,?> sessionFactory)
protected void checkConfig()
Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.