Interface ShellFactorySelector

  • All Known Implementing Classes:
    AggregateShellFactory, ScpCommandFactory
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ShellFactorySelector
    • Method Detail

      • selectShellFactory

        ShellFactory selectShellFactory​(ChannelSession channelSession)
                                 throws java.io.IOException
        Parameters:
        channelSession - The ChannelSession
        Returns:
        The ShellFactory to use for the channel - null if none
        Throws:
        java.io.IOException - If failed the selection
      • selectShellFactory

        static ShellFactory selectShellFactory​(java.util.Collection<? extends ShellFactorySelector> selectors,
                                               ChannelSession channel)
                                        throws java.io.IOException
        Consults each selector whether it wants to provide a factory for the ChannelSession
        Parameters:
        selectors - The ShellFactorySelector-s to consult - ignored if null/empty
        channel - The ChannelSession instance
        Returns:
        The selected ShellFactory - null if no selector matched (in which case the default factory is used)
        Throws:
        java.io.IOException - if any selector threw it