Package org.apache.sshd.agent.unix
Class AgentServer
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.agent.unix.AgentServer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ExecutorServiceCarrier
public class AgentServer extends AbstractLoggingBean implements java.io.Closeable, ExecutorServiceCarrier
A server for an SSH Agent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAgentServer.SshAgentSession
-
Field Summary
Fields Modifier and Type Field Description private SshAgentagentprivate java.util.concurrent.Future<?>agentThreadprivate java.lang.StringauthSocketprivate longhandleprivate longpoolprivate CloseableExecutorServiceservice-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description AgentServer()AgentServer(SshAgent agent, CloseableExecutorService executor)AgentServer(CloseableExecutorService executor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()SshAgentgetAgent()CloseableExecutorServicegetExecutorService()java.lang.Stringstart()private static voidthrowException(int code)transform an APR error number in a more fancy exception
-
-
-
Field Detail
-
agent
private final SshAgent agent
-
service
private final CloseableExecutorService service
-
agentThread
private java.util.concurrent.Future<?> agentThread
-
authSocket
private java.lang.String authSocket
-
pool
private long pool
-
handle
private long handle
-
-
Constructor Detail
-
AgentServer
public AgentServer()
-
AgentServer
public AgentServer(CloseableExecutorService executor)
-
AgentServer
public AgentServer(SshAgent agent, CloseableExecutorService executor)
-
-
Method Detail
-
getAgent
public SshAgent getAgent()
-
getExecutorService
public CloseableExecutorService getExecutorService()
- Specified by:
getExecutorServicein interfaceExecutorServiceCarrier- Returns:
- The
CloseableExecutorServiceto use
-
start
public java.lang.String start() throws java.lang.Exception- Throws:
java.lang.Exception
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
throwException
private static void throwException(int code) throws java.io.IOExceptiontransform an APR error number in a more fancy exception- Parameters:
code- APR error code- Throws:
java.io.IOException- the produced exception for the given APR error number
-
-