Top Description Fields Methods
org.apache.sshd.common

public Interface NamedFactory<T>

extends Factory<T>, NamedResource
Known Direct Subinterfaces
org.apache.sshd.common.digest.DigestFactory, org.apache.sshd.common.BuiltinFactory
Known Direct Implementers
org.apache.sshd.client.config.hosts.KnownHostDigest
Type Parameters
<T>
The create object instance type
Imports
java.util.Collection, .List, java.util.function.Function, java.util.stream.Collectors

A named factory is a factory identified by a name. Such names are used mainly in the algorithm negotiation at the beginning of the SSH connection.
Author
Apache MINA SSHD Project

Field Summary

Inherited from org.apache.sshd.common.NamedResource:
BY_NAME_COMPARATORNAME_EXTRACTOR

Method Summary

Modifier and TypeMethod and Description
public static <
type of object to create
T
>
T

Returns:

a newly created object or null if the factory is not in the list
create
(Collection<? extends NamedFactory<? extends T>>
list of available factories
factories
,
String
the factory name to use
name
)

Create an instance of the specified name by looking up the needed factory in the list.

public static <
factory type
E extends NamedResource & OptionalFeature
>
List<E>

Returns:

the filtered list of factories
setUpBuiltinFactories
(boolean
whether to filter out unsupported factories from preferred
ignoreUnsupported
,
Collection<? extends E>
initial list to filter
preferred
)

Filters out unsupported factories from a given list if ignoreUnsupported == true.

public static <
initial factory type
S extends OptionalFeature
,
transformed factory type
E extends NamedResource
>
List<E>

Returns:

the filtered list of transformed factories
setUpTransformedFactories
(boolean
whether to filter out unsupported factories from preferred
ignoreUnsupported
,
Collection<? extends S>
initial list to filter
preferred
,
Function<? super S, ? extends E>
the transformation to apply
xform
)

Converts a list of factories to a list of transformed factories, optionally excluding unsupported factories.

Inherited from org.apache.sshd.common.Factory:
createget
Inherited from org.apache.sshd.common.NamedResource:
findByNamefindFirstMatchByNamegetNamegetNameListgetNamesofNameremoveByNamesafeCompareByName

Method Detail

createback to summary
public static <T> T create(Collection<? extends NamedFactory<? extends T>> factories, String name)

Create an instance of the specified name by looking up the needed factory in the list.

Parameters
<T>
type of object to create
factories:Collection<? extends NamedFactory<? extends T>>

list of available factories

name:String

the factory name to use

Returns:T

a newly created object or null if the factory is not in the list

setUpBuiltinFactoriesback to summary
public static <E extends NamedResource & OptionalFeature> List<E> setUpBuiltinFactories(boolean ignoreUnsupported, Collection<? extends E> preferred)

Filters out unsupported factories from a given list if ignoreUnsupported == true.

Parameters
<E>
factory type
ignoreUnsupported:boolean

whether to filter out unsupported factories from preferred

preferred:Collection<? extends E>

initial list to filter

Returns:List<E>

the filtered list of factories

setUpTransformedFactoriesback to summary
public static <S extends OptionalFeature, E extends NamedResource> List<E> setUpTransformedFactories(boolean ignoreUnsupported, Collection<? extends S> preferred, Function<? super S, ? extends E> xform)

Converts a list of factories to a list of transformed factories, optionally excluding unsupported factories.

Parameters
<S>
initial factory type
<E>
transformed factory type
ignoreUnsupported:boolean

whether to filter out unsupported factories from preferred

preferred:Collection<? extends S>

initial list to filter

xform:Function<? super S, ? extends E>

the transformation to apply

Returns:List<E>

the filtered list of transformed factories