Package org.apache.sshd.sftp.client
Class SftpVersionSelector.NamedVersionSelector
- java.lang.Object
-
- org.apache.sshd.sftp.client.SftpVersionSelector.NamedVersionSelector
-
- All Implemented Interfaces:
NamedResource
,SftpVersionSelector
- Enclosing interface:
- SftpVersionSelector
public static class SftpVersionSelector.NamedVersionSelector extends Object implements SftpVersionSelector, NamedResource
Wraps aSftpVersionSelector
and assigns it a name. Note:SftpVersionSelector.NamedVersionSelector
are considered equal if they are assigned the same name - case insensitive- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sshd.sftp.client.SftpVersionSelector
SftpVersionSelector.NamedVersionSelector
-
-
Field Summary
Fields Modifier and Type Field Description protected SftpVersionSelector
selector
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Fields inherited from interface org.apache.sshd.sftp.client.SftpVersionSelector
CURRENT, MAXIMUM, MINIMUM
-
-
Constructor Summary
Constructors Constructor Description NamedVersionSelector(String name, SftpVersionSelector selector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getName()
int
hashCode()
int
selectVersion(ClientSession session, boolean initial, int current, List<Integer> available)
String
toString()
-
-
-
Field Detail
-
selector
protected final SftpVersionSelector selector
-
-
Constructor Detail
-
NamedVersionSelector
public NamedVersionSelector(String name, SftpVersionSelector selector)
-
-
Method Detail
-
selectVersion
public int selectVersion(ClientSession session, boolean initial, int current, List<Integer> available)
- Specified by:
selectVersion
in interfaceSftpVersionSelector
- Parameters:
session
- TheClientSession
through which the SFTP connection is madeinitial
- Iftrue
then this is the initial version sent viaSSH_FXP_INIT
otherwise it is a re-negotiation.current
- The current version negotiated with the serveravailable
- Extra versions available - may be empty and/or contain only the current one- Returns:
- The new requested version - if same as current, then nothing is done
-
getName
public String getName()
- Specified by:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
-