Package org.apache.sshd.common
Interface NamedResource
- All Known Subinterfaces:
BuiltinFactory<T>
,ChannelFactory
,CheckFileHandleExtension
,CheckFileNameExtension
,CipherFactory
,Compression
,CompressionFactory
,CompressionInformation
,CopyDataExtension
,CopyFileExtension
,DHFactory
,DigestFactory
,ExtensionParser<T>
,FilenameTranslationControlExtension
,FullAccessSftpClient
,Identity
,IoResource<T>
,KexExtensionParser<T>
,KeyExchange
,KeyExchangeFactory
,MacFactory
,MD5FileExtension
,MD5HandleExtension
,NamedFactory<T>
,OpenSSHFsyncExtension
,OpenSSHKdfOptions
,OpenSSHLimitsExtension
,OpenSSHPosixRenameExtension
,OpenSSHStatHandleExtension
,OpenSSHStatPathExtension
,Property<T>
,Random
,RandomFactory
,SecurityProviderChoice
,SecurityProviderRegistrar
,ServiceFactory
,SftpClient
,SftpClientExtension
,SftpClientExtensionFactory
,SignatureFactory
,SpaceAvailableExtension
,SubsystemClient
,SubsystemFactory
,UserAuth
,UserAuth
,UserAuthFactory
,UserAuthFactory
,UserAuthInstance<S>
,UserAuthMethodFactory<S,
M>
- All Known Implementing Classes:
AbstractChannelExitRequestHandler
,AbstractCheckFileExtension
,AbstractDHClientKeyExchange
,AbstractDHKeyExchange
,AbstractDHServerKeyExchange
,AbstractIoResource
,AbstractKexExtensionParser
,AbstractMD5HashExtension
,AbstractOpenSSHExtensionParser
,AbstractOpenSSHExtensionParser.OpenSSHExtension
,AbstractOpenSSHStatCommandExtension
,AbstractParser
,AbstractRandom
,AbstractRandomFactory
,AbstractSecurityProviderRegistrar
,AbstractSftpClient
,AbstractSftpClientExtension
,AbstractSubsystemClient
,AbstractUserAuth
,AbstractUserAuth
,AbstractUserAuthFactory
,AbstractUserAuthFactory
,AbstractUserAuthMethodFactory
,AbstractUserAuthServiceFactory
,AclSupportedParser
,BaseCompression
,BCryptKdfOptions
,BouncyCastleRandom
,BouncyCastleRandomFactory
,BouncyCastleSecurityProviderRegistrar
,BuiltinCiphers
,BuiltinCompressions
,BuiltinDHFactories
,BuiltinDigests
,BuiltinIdentities
,BuiltinIoServiceFactoryFactories
,BuiltinKEM
,BuiltinMacs
,BuiltinSftpClientExtensions
,BuiltinSignatures
,BuiltinUserAuthFactories
,BuiltinUserAuthFactories
,ChannelAgentForwardingFactory
,ChannelAgentForwardingFactory
,ChannelSessionFactory
,CheckFileHandleExtensionImpl
,CheckFileNameExtensionImpl
,ClassLoaderResource
,ClientConnectionServiceFactory
,ClientUserAuthServiceFactory
,CompressionConfigValue
,CompressionDelayedZlib
,CompressionNone
,CompressionZlib
,CopyDataExtensionImpl
,CopyFileExtensionImpl
,DefaultSftpClient
,DelayCompression
,DHGClient
,DHGEXClient
,DHGEXServer
,DHGServer
,DirectTcpipFactory
,ECCurves
,EdDSASecurityProviderRegistrar
,Elevation
,ExitSignalChannelRequestHandler
,ExitStatusChannelRequestHandler
,FilenameCharsetParser
,FilenameTranslationControlExtensionImpl
,ForwardedTcpipFactory
,FstatVfsExtensionParser
,FsyncExtensionParser
,HardLinkExtensionParser
,HostBoundPubkeyAuthentication
,JceRandom
,JceRandomFactory
,KnownHostDigest
,LimitsExtensionParser
,LSetStatExtensionParser
,MD5FileExtensionImpl
,MD5HandleExtensionImpl
,NewlineParser
,NoFlowControl
,OpenSSHFsyncExtensionImpl
,OpenSSHLimitsExtensionImpl
,OpenSSHPosixRenameExtensionImpl
,OpenSSHStatHandleExtensionImpl
,OpenSSHStatPathExtensionImpl
,PathResource
,PosixRenameExtensionParser
,Property.BaseProperty
,Property.BooleanProperty
,Property.CharsetProperty
,Property.DurationInSecondsProperty
,Property.DurationProperty
,Property.EnumProperty
,Property.IntegerProperty
,Property.LongProperty
,Property.ObjectProperty
,Property.StringProperty
,Property.Validating
,RawKdfOptions
,ScpPathCommandDetailsSupport
,ScpReceiveDirCommandDetails
,ScpReceiveFileCommandDetails
,ServerConnectionServiceFactory
,ServerSignatureAlgorithms
,ServerUserAuthServiceFactory
,SftpFileSystem.Wrapper
,SftpSubsystemFactory
,SftpUniversalOwnerAndGroup
,SftpVersionSelector.NamedVersionSelector
,SingletonRandomFactory
,SpaceAvailableExtensionImpl
,StatVfsExtensionParser
,SunJCESecurityProviderRegistrar
,Supported2Parser
,SupportedParser
,TcpForwardingFilter.Type
,TcpipClientChannel.Type
,TcpipServerChannel.TcpipFactory
,URIResource
,URLResource
,UserAuthGSS
,UserAuthGSSFactory
,UserAuthHostBased
,UserAuthHostBased
,UserAuthHostBasedFactory
,UserAuthHostBasedFactory
,UserAuthKeyboardInteractive
,UserAuthKeyboardInteractive
,UserAuthKeyboardInteractiveFactory
,UserAuthKeyboardInteractiveFactory
,UserAuthNone
,UserAuthNoneFactory
,UserAuthPassword
,UserAuthPassword
,UserAuthPasswordFactory
,UserAuthPasswordFactory
,UserAuthPublicKey
,UserAuthPublicKey
,UserAuthPublicKeyFactory
,UserAuthPublicKeyFactory
,VendorIdParser
,VersionsParser
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator
<NamedResource> Compares 2NamedResource
s according to theirgetName()
value case insensitivestatic final Function
<NamedResource, String> -
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends NamedResource>
RfindByName
(String name, Comparator<? super String> c, Collection<? extends R> resources) static <R extends NamedResource>
RfindFirstMatchByName
(Collection<String> names, Comparator<? super String> c, Collection<? extends R> resources) getName()
getNameList
(Collection<? extends NamedResource> resources) static String
getNames
(Collection<? extends NamedResource> resources) static NamedResource
Wraps a name value inside aNamedResource
static <R extends NamedResource>
RremoveByName
(String name, Comparator<? super String> c, Collection<? extends R> resources) Remove the resource identified by the name from the list.static int
safeCompareByName
(NamedResource r1, NamedResource r2, boolean caseSensitive)
-
Field Details
-
NAME_EXTRACTOR
-
BY_NAME_COMPARATOR
Compares 2NamedResource
s according to theirgetName()
value case insensitive
-
-
Method Details
-
getName
String getName()- Returns:
- The resource name
-
getNameList
- Parameters:
resources
- The named resources- Returns:
- A
List
of all the factories names - in same order as they appear in the input collection
-
getNames
- Parameters:
resources
- list of available resources- Returns:
- A comma separated list of factory names
-
removeByName
static <R extends NamedResource> R removeByName(String name, Comparator<? super String> c, Collection<? extends R> resources) Remove the resource identified by the name from the list.- Type Parameters:
R
- The generic resource type- Parameters:
name
- Name of the resource - ignored ifnull
/emptyc
- TheComparator
to decide whether thegetName()
matches the name parameterresources
- TheNamedResource
to check - ignored ifnull
/empty- Returns:
- the removed resource from the list or
null
if not in the list
-
findByName
static <R extends NamedResource> R findByName(String name, Comparator<? super String> c, Collection<? extends R> resources) - Type Parameters:
R
- The generic resource type- Parameters:
name
- Name of the resource - ignored ifnull
/emptyc
- TheComparator
to decide whether thegetName()
matches the name parameterresources
- TheNamedResource
to check - ignored ifnull
/empty- Returns:
- The first resource whose name matches the parameter (by invoking
Comparator.compare(Object, Object)
-null
if no match found
-
findFirstMatchByName
static <R extends NamedResource> R findFirstMatchByName(Collection<String> names, Comparator<? super String> c, Collection<? extends R> resources) -
ofName
Wraps a name value inside aNamedResource
- Parameters:
name
- The name value to wrap- Returns:
- The wrapper instance
-
safeCompareByName
-