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.StringauthSocketprivate static byte[]END_OF_STREAM_MESSAGEprivate longhandleprivate java.util.concurrent.atomic.AtomicBooleaninnerFinishedprivate java.util.concurrent.atomic.AtomicBooleanopenprivate java.util.concurrent.Future<?>piperprivate CloseableExecutorServicepipeServiceprivate longpoolprivate ConnectionServiceservice-
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 voidclose()protected booleandeleteFile(java.io.File file, java.lang.String msg, boolean debugEnabled)CloseableExecutorServicegetExecutorService()java.lang.StringgetId()booleanisOpen()protected java.io.FileremoveSocketFile(java.lang.String socketPath, boolean debugEnabled)protected voidsignalEOS(AprLibrary libInstance, boolean debugEnabled)static java.io.IOExceptiontoIOException(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:
isOpenin interfacejava.nio.channels.Channel
-
getExecutorService
public CloseableExecutorService getExecutorService()
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceSshAgentServer- Returns:
- Agent server identifier
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein 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:
IOExceptionwith the exception details for the given APR error number
-
-