Class PageantConnector
- java.lang.Object
-
- org.eclipse.jgit.transport.sshd.agent.AbstractConnector
-
- org.eclipse.jgit.internal.transport.sshd.agent.connector.PageantConnector
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Connector
public class PageantConnector extends AbstractConnector
A connector using Pageant's shared memory IPC mechanism.
-
-
Field Summary
Fields Modifier and Type Field Description static ConnectorFactory.ConnectorDescriptorDESCRIPTORprivate PageantLibrarylib-
Fields inherited from class org.eclipse.jgit.transport.sshd.agent.AbstractConnector
DEFAULT_MAX_REPLY_LENGTH
-
-
Constructor Summary
Constructors Constructor Description PageantConnector()Creates a newPageantConnector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanconnect()Connects to an SSH agent if there is one running.byte[]rpc(byte command, byte[] message)Performs a remote call to the SSH agent and returns the result.-
Methods inherited from class org.eclipse.jgit.transport.sshd.agent.AbstractConnector
getMaximumMessageLength, prepareMessage, toLength
-
-
-
-
Field Detail
-
DESCRIPTOR
public static final ConnectorFactory.ConnectorDescriptor DESCRIPTOR
-
lib
private final PageantLibrary lib
-
-
Constructor Detail
-
PageantConnector
public PageantConnector()
Creates a newPageantConnector.
-
-
Method Detail
-
connect
public boolean connect() throws java.io.IOExceptionDescription copied from interface:ConnectorConnects to an SSH agent if there is one running. If called when already connected just returnstrue.- Returns:
trueif an SSH agent is available and connected, if no SSH agent is available- Throws:
java.io.IOException- if connecting to the SSH agent failed
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
rpc
public byte[] rpc(byte command, byte[] message) throws java.io.IOExceptionDescription copied from interface:ConnectorPerforms a remote call to the SSH agent and returns the result.- Parameters:
command- to sendmessage- to send; must have at least 5 bytes, and must have 5 unused bytes at the front.- Returns:
- the result received
- Throws:
java.io.IOException- if an error occurs
-
-