if (proxyId == null) {
throw new IllegalStateException("No " + SshAgent.SSH_AUTHSOCKET_ENV_NAME + " environment variable set");
}
AgentServerProxy proxy = proxies.get(proxyId);
if (proxy != null) {
return proxy.createClient();
}
SshAgent agent = locals.get(proxyId);
if (agent != null) {
return new AgentDelegate(agent);
}