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 ShellFactorydefaultFactoryprotected 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 CommandcreateShell(ChannelSession channel)ShellFactoryselectShellFactory(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 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 Detail
-
createShell
public Command createShell(ChannelSession channel) throws IOException
- 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
public ShellFactory selectShellFactory(ChannelSession channel) throws IOException
- Specified by:
selectShellFactoryin interfaceShellFactorySelector- Parameters:
channel- TheChannelSession- Returns:
- The
ShellFactoryto use for the channel -nullif none - Throws:
IOException- If failed the selection
-
-