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 aSftpVersionSelectorand assigns it a name. Note:SftpVersionSelector.NamedVersionSelectorare 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.Stringnameprotected SftpVersionSelectorselector-
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 booleanequals(java.lang.Object obj)java.lang.StringgetName()inthashCode()intselectVersion(ClientSession session, boolean initial, int current, java.util.List<java.lang.Integer> available)java.lang.StringtoString()
-
-
-
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:
selectVersionin interfaceSftpVersionSelector- Parameters:
session- TheClientSessionthrough which the SFTP connection is madeinitial- Iftruethen this is the initial version sent viaSSH_FXP_INITotherwise 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:
getNamein interfaceNamedResource- Returns:
- The resource name
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-