Class AgentClient
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.agent.common.AbstractAgentProxy
org.apache.sshd.agent.unix.AgentClient
- All Implemented Interfaces:
Closeable, AutoCloseable, Runnable, Channel, SshAgent, FactoryManagerHolder, ExecutorServiceCarrier
A client for a remote SSH agent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringstatic final longDefault value for "agent-client-message-poll-time"private final longprivate final FactoryManagerstatic final StringTime to wait for new incoming messages before checking if the client is still activeprivate final AtomicBooleanprivate final longprivate Future<?> private final BufferFields inherited from class AbstractLoggingBean
logFields inherited from interface SshAgent
SSH_AUTHSOCKET_ENV_NAME -
Constructor Summary
ConstructorsConstructorDescriptionAgentClient(FactoryManager manager, String authSocket) AgentClient(FactoryManager manager, String authSocket, CloseableExecutorService executor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanisOpen()protected voidmessageReceived(Buffer buffer) protected Buffervoidrun()protected voidthrowException(int code) transform an APR error number in a more fancy exceptiontoString()protected BufferMethods inherited from class AbstractAgentProxy
addIdentity, createBuffer, createBuffer, getChannelType, getExecutorService, getIdentities, prepare, removeAllIdentities, removeIdentity, setChannelType, signMethods inherited from class AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface SshAgent
resolveLocalIdentity
-
Field Details
-
MESSAGE_POLL_FREQUENCY
Time to wait for new incoming messages before checking if the client is still active- See Also:
-
DEFAULT_MESSAGE_POLL_FREQUENCY
public static final long DEFAULT_MESSAGE_POLL_FREQUENCYDefault value for "agent-client-message-poll-time" -
authSocket
-
manager
-
pool
private final long pool -
handle
private final long handle -
receiveBuffer
-
messages
-
pumper
-
open
-
-
Constructor Details
-
AgentClient
- Throws:
IOException
-
AgentClient
public AgentClient(FactoryManager manager, String authSocket, CloseableExecutorService executor) throws IOException - Throws:
IOException
-
-
Method Details
-
getFactoryManager
- Specified by:
getFactoryManagerin interfaceFactoryManagerHolder- Returns:
- The currently associated
FactoryManager
-
getAuthSocket
-
isOpen
-
run
-
messageReceived
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractAgentProxy- Throws:
IOException
-
request
- Specified by:
requestin classAbstractAgentProxy- Throws:
IOException
-
waitForMessageBuffer
- Throws:
IOException
-
throwException
transform an APR error number in a more fancy exception- Parameters:
code- APR error code- Throws:
IOException- the produced exception for the given APR error number
-
toString
-