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 java.lang.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
-
-
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 private java.lang.String
name
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(java.lang.String name, SftpVersionSelector selector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getName()
int
hashCode()
int
selectVersion(ClientSession session, boolean initial, int current, java.util.List<java.lang.Integer> available)
java.lang.String
toString()
-
-
-
Field Detail
-
selector
protected final SftpVersionSelector selector
-
name
private final java.lang.String name
-
-
Constructor Detail
-
NamedVersionSelector
public NamedVersionSelector(java.lang.String name, SftpVersionSelector selector)
-
-
Method Detail
-
selectVersion
public int selectVersion(ClientSession session, boolean initial, int current, java.util.List<java.lang.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 java.lang.String getName()
- Specified by:
getName
in interfaceNamedResource
- Returns:
- The resource name
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-