Top Description Fields Constructors Methods
org.eclipse.jgit.internal.transport.sshd.agent.connector

public Class Factory

extends Object
implements ConnectorFactory
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.transport.sshd.agent.ConnectorFactory
Imports
java.io.File, .IOException, java.text.MessageFormat, java.util.Collection, .Collections, .List, .Locale, org.eclipse.jgit.transport.sshd.agent.Connector, .ConnectorFactory, org.eclipse.jgit.util.StringUtils, .SystemReader

An ConnectorFactory for connecting to an OpenSSH SSH agent.

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Connector
create(String
identifies the wanted agent connection; if null, the factory is free to provide a Connector to a default agent. The value will typically come from the IdentityAgent setting in ~/.ssh/config.
identityAgent
,
File
the current local user's home directory as configured in the org.eclipse.jgit.transport.sshd.SshdSessionFactory
homeDir
)

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.create.

Creates a new Connector.

public ConnectorFactory.ConnectorDescriptor
public String
getName()

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.getName.

Retrieves a name for this factory.

public Collection<ConnectorFactory.ConnectorDescriptor>
public boolean
isSupported()

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.isSupported.

Tells whether this ConnectorFactory is applicable on the currently running platform.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NAMEback to summary
private static final String NAME

Constructor Detail

Factoryback to summary
public Factory()

Method Detail

createback to summary
public Connector create(String identityAgent, File homeDir) throws IOException

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.create.

Doc from org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.create.

Creates a new Connector.

Parameters
identityAgent:String

identifies the wanted agent connection; if null, the factory is free to provide a Connector to a default agent. The value will typically come from the IdentityAgent setting in ~/.ssh/config.

homeDir:File

the current local user's home directory as configured in the org.eclipse.jgit.transport.sshd.SshdSessionFactory

Returns:Connector

a new Connector

Annotations
@Override
Exceptions
IOException:
if no connector can be created
getDefaultConnectorback to summary
public ConnectorFactory.ConnectorDescriptor getDefaultConnector()

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.getDefaultConnector.

Doc from org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.getDefaultConnector.

Tells what kind of Connector this ConnectorFactory creates if ConnectorFactory#create(String, File) is called with identityAgent == null.

Returns:ConnectorFactory.ConnectorDescriptor

a ConnectorDescriptor for the default connector

Annotations
@Override
getNameback to summary
public String getName()

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.getName.

Doc from org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.getName.

Retrieves a name for this factory.

Returns:String

the name

Annotations
@Override
getSupportedConnectorsback to summary
public Collection<ConnectorFactory.ConnectorDescriptor> getSupportedConnectors()

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.getSupportedConnectors.

Doc from org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.getSupportedConnectors.

Tells which kinds of SSH agents this ConnectorFactory 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".

Returns:Collection<ConnectorFactory.ConnectorDescriptor>

an immutable collection of ConnectorDescriptors, including getDefaultConnector() and not including a descriptor for internal name "none"

Annotations
@Override
isSupportedback to summary
public boolean isSupported()

Implements org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.isSupported.

Doc from org.eclipse.jgit.transport.sshd.agent.ConnectorFactory.isSupported.

Tells whether this ConnectorFactory is applicable on the currently running platform.

Returns:boolean

true if the factory can be used, false otherwise

Annotations
@Override