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 class
AgentServer.SshAgentSession
-
Field Summary
Fields Modifier and Type Field Description private SshAgent
agent
private java.util.concurrent.Future<?>
agentThread
private java.lang.String
authSocket
private long
handle
private long
pool
private CloseableExecutorService
service
-
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 void
close()
SshAgent
getAgent()
CloseableExecutorService
getExecutorService()
java.lang.String
start()
private static void
throwException(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:
getExecutorService
in interfaceExecutorServiceCarrier
- Returns:
- The
CloseableExecutorService
to 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
throwException
private static void throwException(int code) throws java.io.IOException
transform 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
-
-