Package org.apache.sshd.agent.unix
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 TypeFieldDescriptionstatic final longDefault value for "agent-client-message-poll-time"static final StringTime to wait for new incoming messages before checking if the client is still activeFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.agent.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 org.apache.sshd.agent.common.AbstractAgentProxy
addIdentity, createBuffer, createBuffer, getChannelType, getExecutorService, getIdentities, prepare, removeAllIdentities, removeIdentity, setChannelType, signMethods inherited from class org.apache.sshd.common.util.logging.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.agent.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"
-
-
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
public boolean isOpen() -
run
public void run() -
messageReceived
- Throws:
Exception
-
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
-