Package org.eclipse.jgit.transport
Interface SshConfigStore
-
- All Known Implementing Classes:
OpenSshConfigFile
public interface SshConfigStore
An abstraction for a SSH config storage, like the OpenSSH ~/.ssh/config file.- Since:
- 5.8
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SshConfigStore.HostConfig
A host entry from the ssh config.
-
Field Summary
Fields Modifier and Type Field Description static SshConfigStore.HostConfig
EMPTY_CONFIG
An emptySshConfigStore.HostConfig
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SshConfigStore.HostConfig
lookup(String hostName, int port, String userName)
Locate the configuration for a specific host request.SshConfigStore.HostConfig
lookupDefault(String hostName, int port, String userName)
Locate the configuration for a specific host request and if the configuration has no values forSshConstants.HOST_NAME
,SshConstants.PORT
,SshConstants.USER
, orSshConstants.CONNECTION_ATTEMPTS
, fill those values with defaults from the arguments: ssh config key value from argumentHostName
hostName
Port
port > 0 ? port : 22
User
userName
ConnectionAttempts
1
-
-
-
Field Detail
-
EMPTY_CONFIG
static final SshConfigStore.HostConfig EMPTY_CONFIG
An emptySshConfigStore.HostConfig
.
-
-
Method Detail
-
lookup
@NonNull SshConfigStore.HostConfig lookup(@NonNull String hostName, int port, String userName)
Locate the configuration for a specific host request.- Parameters:
hostName
- to look upport
- the user supplied; <= 0 if noneuserName
- the user supplied, may benull
or empty if none given- Returns:
- the configuration for the requested name.
-
lookupDefault
@NonNull SshConfigStore.HostConfig lookupDefault(@NonNull String hostName, int port, String userName)
Locate the configuration for a specific host request and if the configuration has no values forSshConstants.HOST_NAME
,SshConstants.PORT
,SshConstants.USER
, orSshConstants.CONNECTION_ATTEMPTS
, fill those values with defaults from the arguments:ssh config key value from argument HostName
hostName
Port
port > 0 ? port : 22
User
userName
ConnectionAttempts
1
- Parameters:
hostName
- host name to look upport
- port number; <= 0 if noneuserName
- the user name, may benull
or empty if none given- Returns:
- the configuration for the requested name.
- Since:
- 6.0
-
-