Top Description Fields Constructors Methods
org.apache.sshd.agent.unix

public Class AgentClient

extends AbstractAgentProxy
implements Runnable, FactoryManagerHolder
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.FactoryManagerHolder, java.lang.Runnable
Imports
java.io.IOException, .InterruptedIOException, .StreamCorruptedException, java.util.Objects, .Queue, java.util.concurrent.ArrayBlockingQueue, .Future, .TimeUnit, java.util.concurrent.atomic.AtomicBoolean, org.apache.sshd.agent.common.AbstractAgentProxy, org.apache.sshd.common.FactoryManager, .FactoryManagerHolder, .PropertyResolverUtils, .SshException, org.apache.sshd.common.util.buffer.Buffer, .ByteArrayBuffer, org.apache.sshd.common.util.threads.CloseableExecutorService, .ThreadUtils, org.apache.tomcat.jni.Local, org.apache.tomcat.jni.Pool, org.apache.tomcat.jni.Socket, org.apache.tomcat.jni.Status

A client for a remote SSH agent

Field Summary

Modifier and TypeField and Description
private final String
public static final long
DEFAULT_MESSAGE_POLL_FREQUENCY

Default value for agent-client-message-poll-time

private final long
private final FactoryManager
public static final String
MESSAGE_POLL_FREQUENCY

Time to wait for new incoming messages before checking if the client is still active

private final Queue<Buffer>
private final AtomicBoolean
private final long
private Future<?>
private final Buffer

Constructor Summary

AccessConstructor and Description
public
AgentClient(FactoryManager manager, String authSocket)

public

Method Summary

Modifier and TypeMethod and Description
public void
public String
public FactoryManager
public boolean
isOpen()

Implements java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

protected void
protected synchronized Buffer
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

protected void
throwException(int
APR error code
code
)

transform an APR error number in a more fancy exception

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

protected Buffer
Inherited from org.apache.sshd.agent.common.AbstractAgentProxy:
addIdentitycreateBuffercreateBuffergetChannelTypegetExecutorServicegetIdentitiesprepareremoveAllIdentitiesremoveIdentitysetChannelTypesign

Field Detail

authSocketback to summary
private final String authSocket
DEFAULT_MESSAGE_POLL_FREQUENCYback to summary
public static final long DEFAULT_MESSAGE_POLL_FREQUENCY

Default value for agent-client-message-poll-time

handleback to summary
private final long handle
managerback to summary
private final FactoryManager manager
MESSAGE_POLL_FREQUENCYback to summary
public static final String MESSAGE_POLL_FREQUENCY

Time to wait for new incoming messages before checking if the client is still active

messagesback to summary
private final Queue<Buffer> messages
openback to summary
private final AtomicBoolean open
poolback to summary
private final long pool
pumperback to summary
private Future<?> pumper
receiveBufferback to summary
private final Buffer receiveBuffer

Constructor Detail

AgentClientback to summary
public AgentClient(FactoryManager manager, String authSocket) throws IOException
AgentClientback to summary
public AgentClient(FactoryManager manager, String authSocket, CloseableExecutorService executor) throws IOException

Method Detail

closeback to summary
public void close() throws IOException

Overrides org.apache.sshd.agent.common.AbstractAgentProxy.close.

Implements java.nio.channels.Channel.close.

Doc from java.nio.channels.Channel.close.

Closes this channel.

After a channel is closed, any further attempt to invoke I/O operations upon it will cause a ClosedChannelException to be thrown.

If this channel is already closed then invoking this method has no effect.

This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
getAuthSocketback to summary
public String getAuthSocket()
getFactoryManagerback to summary
public FactoryManager getFactoryManager()

Implements org.apache.sshd.common.FactoryManagerHolder.getFactoryManager.

Returns:FactoryManager

Doc from org.apache.sshd.common.FactoryManagerHolder.getFactoryManager.

The currently associated FactoryManager

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements java.nio.channels.Channel.isOpen.

Doc from java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

Returns:boolean

true if, and only if, this channel is open

Annotations
@Override
messageReceivedback to summary
protected void messageReceived(Buffer buffer) throws Exception
requestback to summary
protected synchronized Buffer request(Buffer buffer) throws IOException

Implements abstract org.apache.sshd.agent.common.AbstractAgentProxy.request.

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
throwExceptionback to summary
protected void throwException(int code) throws IOException

transform an APR error number in a more fancy exception

Parameters
code:int

APR error code

Exceptions
IOException:
the produced exception for the given APR error number
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
waitForMessageBufferback to summary
protected Buffer waitForMessageBuffer() throws IOException