Package org.eclipse.jgit.transport
Class OpenSshConfig.Host
- java.lang.Object
-
- org.eclipse.jgit.transport.OpenSshConfig.Host
-
- Enclosing class:
- OpenSshConfig
public static class OpenSshConfig.Host extends java.lang.ObjectConfiguration of one "Host" block in the configuration file.If returned from
OpenSshConfig.lookup(String)some or all of the properties may not be populated. The properties which are not populated should be defaulted by the caller.When returned from
OpenSshConfig.lookup(String)any wildcard entries which appear later in the configuration file will have been already merged into this block.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.BooleanbatchModeprivate com.jcraft.jsch.ConfigRepository.Configconfig(package private) intconnectionAttemptsprivate OpenSshConfigFile.HostEntryentry(package private) java.lang.StringhostName(package private) java.io.FileidentityFileprivate static java.util.Map<java.lang.String,java.lang.String>KEY_MAP(package private) intport(package private) java.lang.StringpreferredAuthentications(package private) java.lang.StringstrictHostKeyChecking(package private) java.lang.Stringuser
-
Constructor Summary
Constructors Constructor Description Host()Creates a new uninitializedOpenSshConfig.Host.Host(OpenSshConfigFile.HostEntry entry, java.lang.String hostName, java.lang.String localUserName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcomplete(java.lang.String initialHostName, java.lang.String localUserName)(package private) com.jcraft.jsch.ConfigRepository.ConfiggetConfig()intgetConnectionAttempts()java.lang.StringgetHostName()java.io.FilegetIdentityFile()intgetPort()java.lang.StringgetPreferredAuthentications()java.lang.StringgetStrictHostKeyChecking()java.lang.StringgetUser()booleanisBatchMode()private static java.lang.StringmapKey(java.lang.String key)java.lang.StringtoString()
-
-
-
Field Detail
-
hostName
java.lang.String hostName
-
port
int port
-
identityFile
java.io.File identityFile
-
user
java.lang.String user
-
preferredAuthentications
java.lang.String preferredAuthentications
-
batchMode
java.lang.Boolean batchMode
-
strictHostKeyChecking
java.lang.String strictHostKeyChecking
-
connectionAttempts
int connectionAttempts
-
entry
private OpenSshConfigFile.HostEntry entry
-
config
private com.jcraft.jsch.ConfigRepository.Config config
-
KEY_MAP
private static final java.util.Map<java.lang.String,java.lang.String> KEY_MAP
-
-
Constructor Detail
-
Host
public Host()
Creates a new uninitializedOpenSshConfig.Host.
-
Host
Host(OpenSshConfigFile.HostEntry entry, java.lang.String hostName, java.lang.String localUserName)
-
-
Method Detail
-
mapKey
private static java.lang.String mapKey(java.lang.String key)
-
getStrictHostKeyChecking
public java.lang.String getStrictHostKeyChecking()
- Returns:
- the value StrictHostKeyChecking property, the valid values are "yes" (unknown hosts are not accepted), "no" (unknown hosts are always accepted), and "ask" (user should be asked before accepting the host)
-
getHostName
public java.lang.String getHostName()
- Returns:
- the real IP address or host name to connect to; never null.
-
getPort
public int getPort()
- Returns:
- the real port number to connect to; never 0.
-
getIdentityFile
public java.io.File getIdentityFile()
- Returns:
- path of the private key file to use for authentication; null if the caller should use default authentication strategies.
-
getUser
public java.lang.String getUser()
- Returns:
- the real user name to connect as; never null.
-
getPreferredAuthentications
public java.lang.String getPreferredAuthentications()
- Returns:
- the preferred authentication methods, separated by commas if more than one authentication method is preferred.
-
isBatchMode
public boolean isBatchMode()
- Returns:
- true if batch (non-interactive) mode is preferred for this host connection.
-
getConnectionAttempts
public int getConnectionAttempts()
- Returns:
- the number of tries (one per second) to connect before exiting. The argument must be an integer. This may be useful in scripts if the connection sometimes fails. The default is 1.
- Since:
- 3.4
-
complete
private void complete(java.lang.String initialHostName, java.lang.String localUserName)
-
getConfig
com.jcraft.jsch.ConfigRepository.Config getConfig()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-