Class Factory
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.agent.connector.Factory
-
- All Implemented Interfaces:
ConnectorFactory
public class Factory extends java.lang.Object implements ConnectorFactory
AnConnectorFactoryfor 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 Modifier and Type Field Description private static java.lang.StringNAME
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connectorcreate(java.lang.String identityAgent, java.io.File homeDir)Creates a newConnector.ConnectorFactory.ConnectorDescriptorgetDefaultConnector()Tells what kind ofConnectorthisConnectorFactorycreates ifConnectorFactory.create(String, File)is called withidentityAgent == null.java.lang.StringgetName()Retrieves a name for this factory.java.util.Collection<ConnectorFactory.ConnectorDescriptor>getSupportedConnectors()Tells which kinds of SSH agents thisConnectorFactorysupports.booleanisSupported()Tells whether thisConnectorFactoryis applicable on the currently running platform.
-
-
-
Field Detail
-
NAME
private static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public Connector create(java.lang.String identityAgent, java.io.File homeDir) throws java.io.IOException
Description copied from interface:ConnectorFactoryCreates a newConnector.- Specified by:
createin interfaceConnectorFactory- Parameters:
identityAgent- identifies the wanted agent connection; ifnull, the factory is free to provide aConnectorto a default agent. The value will typically come from theIdentityAgentsetting in~/.ssh/config.homeDir- the current local user's home directory as configured in theSshdSessionFactory- Returns:
- a new
Connector - Throws:
java.io.IOException- if no connector can be created
-
isSupported
public boolean isSupported()
Description copied from interface:ConnectorFactoryTells whether thisConnectorFactoryis applicable on the currently running platform.- Specified by:
isSupportedin interfaceConnectorFactory- Returns:
trueif the factory can be used,falseotherwise
-
getName
public java.lang.String getName()
Description copied from interface:ConnectorFactoryRetrieves a name for this factory.- Specified by:
getNamein interfaceConnectorFactory- Returns:
- the name
-
getSupportedConnectors
public java.util.Collection<ConnectorFactory.ConnectorDescriptor> getSupportedConnectors()
Tells which kinds of SSH agents thisConnectorFactorysupports.An implementation of this method should document the possible values it returns.
This factory returns on Windows a
ConnectorDescriptorfor the internal name "pageant"; on Unix one for "SSH_AUTH_SOCK".- Specified by:
getSupportedConnectorsin interfaceConnectorFactory- Returns:
- an immutable collection of
ConnectorFactory.ConnectorDescriptors, includingConnectorFactory.getDefaultConnector()and not including a descriptor for internal name "none"
-
getDefaultConnector
public ConnectorFactory.ConnectorDescriptor getDefaultConnector()
Description copied from interface:ConnectorFactoryTells what kind ofConnectorthisConnectorFactorycreates ifConnectorFactory.create(String, File)is called withidentityAgent == null.- Specified by:
getDefaultConnectorin interfaceConnectorFactory- Returns:
- a
ConnectorFactory.ConnectorDescriptorfor the default connector
-
-