Package org.apache.sshd.common
Interface NamedFactory<T>
-
- Type Parameters:
T
- The create object instance type
- All Superinterfaces:
Factory<T>
,NamedResource
,java.util.function.Supplier<T>
- All Known Subinterfaces:
BuiltinFactory<T>
,CipherFactory
,CompressionFactory
,DigestFactory
,MacFactory
,RandomFactory
,SignatureFactory
- All Known Implementing Classes:
AbstractRandomFactory
,BouncyCastleRandomFactory
,BuiltinCiphers
,BuiltinCompressions
,BuiltinDigests
,BuiltinIoServiceFactoryFactories
,BuiltinMacs
,BuiltinSignatures
,BuiltinUserAuthFactories
,BuiltinUserAuthFactories
,CompressionConfigValue
,JceRandomFactory
,KnownHostDigest
,SingletonRandomFactory
public interface NamedFactory<T> extends Factory<T>, NamedResource
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.
-
-
Field Summary
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T> T
create(java.util.Collection<? extends NamedFactory<? extends T>> factories, java.lang.String name)
Create an instance of the specified name by looking up the needed factory in the list.static <E extends NamedResource & OptionalFeature>
java.util.List<E>setUpBuiltinFactories(boolean ignoreUnsupported, java.util.Collection<? extends E> preferred)
Filters out unsupported factories from a given list ifignoreUnsupported == true
.static <S extends OptionalFeature,E extends NamedResource>
java.util.List<E>setUpTransformedFactories(boolean ignoreUnsupported, java.util.Collection<? extends S> preferred, java.util.function.Function<? super S,? extends E> xform)
Converts a list of factories to a list of transformed factories, optionally excluding unsupported factories.-
Methods inherited from interface org.apache.sshd.common.NamedResource
getName
-
-
-
-
Method Detail
-
create
static <T> T create(java.util.Collection<? extends NamedFactory<? extends T>> factories, java.lang.String name)
Create an instance of the specified name by looking up the needed factory in the list.- Type Parameters:
T
- type of object to create- Parameters:
factories
- list of available factoriesname
- the factory name to use- Returns:
- a newly created object or
null
if the factory is not in the list
-
setUpTransformedFactories
static <S extends OptionalFeature,E extends NamedResource> java.util.List<E> setUpTransformedFactories(boolean ignoreUnsupported, java.util.Collection<? extends S> preferred, java.util.function.Function<? super S,? extends E> xform)
Converts a list of factories to a list of transformed factories, optionally excluding unsupported factories.- Type Parameters:
S
- initial factory typeE
- transformed factory type- Parameters:
ignoreUnsupported
- whether to filter out unsupported factories frompreferred
preferred
- initial list to filterxform
- the transformation to apply- Returns:
- the filtered list of transformed factories
-
setUpBuiltinFactories
static <E extends NamedResource & OptionalFeature> java.util.List<E> setUpBuiltinFactories(boolean ignoreUnsupported, java.util.Collection<? extends E> preferred)
Filters out unsupported factories from a given list ifignoreUnsupported == true
.- Type Parameters:
E
- factory type- Parameters:
ignoreUnsupported
- whether to filter out unsupported factories frompreferred
preferred
- initial list to filter- Returns:
- the filtered list of factories
-
-