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
- Author:
- Apache MINA SSHD Project
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ShellFactory
protected final Collection<? extends ShellFactorySelector>
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
ConstructorDescriptionAggregateShellFactory
(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 aShellFactory
for the providedChannelSession
argument. If a selector returnsnull
then the next in line is consulted. If no match found then the defaultInteractiveProcessShellFactory
is used
-
AggregateShellFactory
public AggregateShellFactory(Collection<? extends ShellFactorySelector> selectors, ShellFactory defaultFactory) - Parameters:
selectors
- SelectorShellFactorySelector
-s being consulted whether they wish to provide aShellFactory
for the providedChannelSession
argument. If a selector returnsnull
then the next in line is consulted.defaultFactory
- The (mandatory) defaultShellFactory
to use if no selector matched
-
-
Method Details
-
createShell
- Specified by:
createShell
in interfaceShellFactory
- Parameters:
channel
- TheChannelSession
through which the command has been received- Returns:
- The
Command
representing the shell to be executed - Throws:
IOException
- If failed to create the shell
-
selectShellFactory
- Specified by:
selectShellFactory
in interfaceShellFactorySelector
- Parameters:
channel
- TheChannelSession
- Returns:
- The
ShellFactory
to use for the channel -null
if none - Throws:
IOException
- If failed the selection
-