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 providedChannelSession
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description protected ShellFactory
defaultFactory
protected Collection<? extends ShellFactorySelector>
selectors
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description AggregateShellFactory(Collection<? extends ShellFactorySelector> selectors)
AggregateShellFactory(Collection<? extends ShellFactorySelector> selectors, ShellFactory defaultFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Command
createShell(ChannelSession channel)
ShellFactory
selectShellFactory(ChannelSession channel)
-
-
-
Field Detail
-
defaultFactory
protected final ShellFactory defaultFactory
-
selectors
protected final Collection<? extends ShellFactorySelector> selectors
-
-
Constructor Detail
-
AggregateShellFactory
public AggregateShellFactory(Collection<? extends ShellFactorySelector> selectors)
- 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 Detail
-
createShell
public Command createShell(ChannelSession channel) throws IOException
- 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
public ShellFactory selectShellFactory(ChannelSession channel) throws IOException
- 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
-
-