Package org.apache.sshd.agent.unix
Class AgentServerProxy
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.agent.unix.AgentServerProxy
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.Channel
,SshAgentServer
public class AgentServerProxy extends AbstractLoggingBean implements SshAgentServer
The server side fake agent, acting as an agent, but actually forwarding the requests to the auth channel on the client side.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
authSocket
private static byte[]
END_OF_STREAM_MESSAGE
private long
handle
private java.util.concurrent.atomic.AtomicBoolean
innerFinished
private java.util.concurrent.atomic.AtomicBoolean
open
private java.util.concurrent.Future<?>
piper
private CloseableExecutorService
pipeService
private long
pool
private ConnectionService
service
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description AgentServerProxy(ConnectionService service)
AgentServerProxy(ConnectionService service, CloseableExecutorService executor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected boolean
deleteFile(java.io.File file, java.lang.String msg, boolean debugEnabled)
CloseableExecutorService
getExecutorService()
java.lang.String
getId()
boolean
isOpen()
protected java.io.File
removeSocketFile(java.lang.String socketPath, boolean debugEnabled)
protected void
signalEOS(AprLibrary libInstance, boolean debugEnabled)
static java.io.IOException
toIOException(int code)
transform an APR error number in a more fancy exception
-
-
-
Field Detail
-
END_OF_STREAM_MESSAGE
private static final byte[] END_OF_STREAM_MESSAGE
-
service
private final ConnectionService service
-
authSocket
private final java.lang.String authSocket
-
pool
private final long pool
-
handle
private final long handle
-
piper
private java.util.concurrent.Future<?> piper
-
pipeService
private final CloseableExecutorService pipeService
-
open
private final java.util.concurrent.atomic.AtomicBoolean open
-
innerFinished
private final java.util.concurrent.atomic.AtomicBoolean innerFinished
-
-
Constructor Detail
-
AgentServerProxy
public AgentServerProxy(ConnectionService service) throws java.io.IOException
- Throws:
java.io.IOException
-
AgentServerProxy
public AgentServerProxy(ConnectionService service, CloseableExecutorService executor) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfacejava.nio.channels.Channel
-
getExecutorService
public CloseableExecutorService getExecutorService()
-
getId
public java.lang.String getId()
- Specified by:
getId
in interfaceSshAgentServer
- Returns:
- Agent server identifier
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.nio.channels.Channel
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
removeSocketFile
protected java.io.File removeSocketFile(java.lang.String socketPath, boolean debugEnabled) throws java.lang.Exception
- Throws:
java.lang.Exception
-
signalEOS
protected void signalEOS(AprLibrary libInstance, boolean debugEnabled) throws java.lang.Exception
- Throws:
java.lang.Exception
-
deleteFile
protected boolean deleteFile(java.io.File file, java.lang.String msg, boolean debugEnabled)
-
toIOException
public static java.io.IOException toIOException(int code)
transform an APR error number in a more fancy exception- Parameters:
code
- APR error code- Returns:
IOException
with the exception details for the given APR error number
-
-