Package org.apache.sshd.server.shell
Class AggregateShellFactory
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.shell.AggregateShellFactory
- All Implemented Interfaces:
ShellFactory,ShellFactorySelector
public class AggregateShellFactory
extends AbstractLoggingBean
implements ShellFactory, ShellFactorySelector
Provides different shell(s) based on some criteria of the provided
ChannelSession-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ShellFactoryprotected final Collection<? extends ShellFactorySelector> Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
ConstructorsConstructorDescriptionAggregateShellFactory(Collection<? extends ShellFactorySelector> selectors) AggregateShellFactory(Collection<? extends ShellFactorySelector> selectors, ShellFactory defaultFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateShell(ChannelSession channel) selectShellFactory(ChannelSession channel)
-
Field Details
-
defaultFactory
-
selectors
-
-
Constructor Details
-
AggregateShellFactory
- Parameters:
selectors- SelectorShellFactorySelector-s being consulted whether they wish to provide aShellFactoryfor the providedChannelSessionargument. If a selector returnsnullthen the next in line is consulted. If no match found then the defaultInteractiveProcessShellFactoryis used
-
AggregateShellFactory
public AggregateShellFactory(Collection<? extends ShellFactorySelector> selectors, ShellFactory defaultFactory) - Parameters:
selectors- SelectorShellFactorySelector-s being consulted whether they wish to provide aShellFactoryfor the providedChannelSessionargument. If a selector returnsnullthen the next in line is consulted.defaultFactory- The (mandatory) defaultShellFactoryto use if no selector matched
-
-
Method Details
-
createShell
- Specified by:
createShellin interfaceShellFactory- Parameters:
channel- TheChannelSessionthrough which the command has been received- Returns:
- The
Commandrepresenting the shell to be executed - Throws:
IOException- If failed to create the shell
-
selectShellFactory
- Specified by:
selectShellFactoryin interfaceShellFactorySelector- Parameters:
channel- TheChannelSession- Returns:
- The
ShellFactoryto use for the channel -nullif none - Throws:
IOException- If failed the selection
-