Class 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 Detail

      • END_OF_STREAM_MESSAGE

        private static final byte[] END_OF_STREAM_MESSAGE
      • authSocket

        private final java.lang.String authSocket
      • pool

        private final long pool
      • handle

        private final long handle
      • piper

        private java.util.concurrent.Future<?> piper
      • 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
    • Method Detail

      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface java.nio.channels.Channel
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface SshAgentServer
        Returns:
        Agent server identifier
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.nio.channels.Channel
        Specified by:
        close in interface java.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