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 TypeFieldDescriptionprivate final String
static final long
Default value for "agent-client-message-poll-time"private final long
private final FactoryManager
static final String
Time to wait for new incoming messages before checking if the client is still activeprivate final AtomicBoolean
private final long
private Future
<?> private final Buffer
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
Fields 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 TypeMethodDescriptionvoid
close()
boolean
isOpen()
protected void
messageReceived
(Buffer buffer) protected Buffer
void
run()
protected void
throwException
(int code) transform an APR error number in a more fancy exceptiontoString()
protected Buffer
Methods inherited from class org.apache.sshd.agent.common.AbstractAgentProxy
addIdentity, createBuffer, createBuffer, getChannelType, getExecutorService, getIdentities, prepare, removeAllIdentities, removeIdentity, setChannelType, sign
Methods 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, warn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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" -
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:
getFactoryManager
in interfaceFactoryManagerHolder
- Returns:
- The currently associated
FactoryManager
-
getAuthSocket
-
isOpen
public boolean isOpen() -
run
public void run() -
messageReceived
- Throws:
Exception
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractAgentProxy
- Throws:
IOException
-
request
- Specified by:
request
in 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
-