Class Factory
java.lang.Object
org.eclipse.jgit.internal.transport.sshd.agent.connector.Factory
- All Implemented Interfaces:
ConnectorFactory
An
ConnectorFactory
for connecting to an OpenSSH SSH agent.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jgit.transport.sshd.agent.ConnectorFactory
ConnectorFactory.ConnectorDescriptor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a newConnector
.Tells what kind ofConnector
thisConnectorFactory
creates ifConnectorFactory.create(String, File)
is called withidentityAgent == null
.getName()
Retrieves a name for this factory.Tells which kinds of SSH agents thisConnectorFactory
supports.boolean
Tells whether thisConnectorFactory
is applicable on the currently running platform.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
create
Description copied from interface:ConnectorFactory
Creates a newConnector
.- Specified by:
create
in interfaceConnectorFactory
- Parameters:
identityAgent
- identifies the wanted agent connection; ifnull
, the factory is free to provide aConnector
to a default agent. The value will typically come from theIdentityAgent
setting in~/.ssh/config
.homeDir
- the current local user's home directory as configured in theSshdSessionFactory
- Returns:
- a new
Connector
- Throws:
IOException
- if no connector can be created
-
isSupported
public boolean isSupported()Description copied from interface:ConnectorFactory
Tells whether thisConnectorFactory
is applicable on the currently running platform.- Specified by:
isSupported
in interfaceConnectorFactory
- Returns:
true
if the factory can be used,false
otherwise
-
getName
Description copied from interface:ConnectorFactory
Retrieves a name for this factory.- Specified by:
getName
in interfaceConnectorFactory
- Returns:
- the name
-
getSupportedConnectors
Tells which kinds of SSH agents thisConnectorFactory
supports.An implementation of this method should document the possible values it returns.
This factory returns on Windows a
ConnectorDescriptor
for the internal name "pageant"; on Unix one for "SSH_AUTH_SOCK".- Specified by:
getSupportedConnectors
in interfaceConnectorFactory
- Returns:
- an immutable collection of
ConnectorFactory.ConnectorDescriptor
s, includingConnectorFactory.getDefaultConnector()
and not including a descriptor for internal name "none"
-
getDefaultConnector
Description copied from interface:ConnectorFactory
Tells what kind ofConnector
thisConnectorFactory
creates ifConnectorFactory.create(String, File)
is called withidentityAgent == null
.- Specified by:
getDefaultConnector
in interfaceConnectorFactory
- Returns:
- a
ConnectorFactory.ConnectorDescriptor
for the default connector
-