public Object getUserToken(final HttpContext context) { Principal userPrincipal = null; AuthState targetAuthState = (AuthState) context.getAttribute( ClientContext.TARGET_AUTH_STATE); if (targetAuthState != null) { userPrincipal = getAuthPrincipal(targetAuthState); if (userPrincipal == null) { AuthState proxyAuthState = (AuthState) context.getAttribute( ClientContext.PROXY_AUTH_STATE); userPrincipal = getAuthPrincipal(proxyAuthState); } } if (userPrincipal == null) { ManagedClientConnection conn = (ManagedClientConnection) context.getAttribute( ExecutionContext.HTTP_CONNECTION); if (conn.isOpen()) { SSLSession sslsession = conn.getSSLSession(); if (sslsession != null) { userPrincipal = sslsession.getLocalPrincipal(); } } } return userPrincipal; }
if (!this.managedConn.isOpen()) { this.managedConn.open(route, context, this.params);
if (!this.managedConn.isOpen()) { this.managedConn.open(route, context, this.params);
if (!managedConn.isOpen()) { managedConn.open(route, context, params);
public Object getUserToken(final HttpContext context) { Principal userPrincipal = null; AuthState targetAuthState = (AuthState) context.getAttribute( ClientContext.TARGET_AUTH_STATE); if (targetAuthState != null) { userPrincipal = getAuthPrincipal(targetAuthState); if (userPrincipal == null) { AuthState proxyAuthState = (AuthState) context.getAttribute( ClientContext.PROXY_AUTH_STATE); userPrincipal = getAuthPrincipal(proxyAuthState); } } if (userPrincipal == null) { ManagedClientConnection conn = (ManagedClientConnection) context.getAttribute( ExecutionContext.HTTP_CONNECTION); if (conn.isOpen()) { SSLSession sslsession = conn.getSSLSession(); if (sslsession != null) { userPrincipal = sslsession.getLocalPrincipal(); } } } return userPrincipal; }
public Object getUserToken(final HttpContext context) { Principal userPrincipal = null; AuthState targetAuthState = (AuthState) context.getAttribute( ClientContext.TARGET_AUTH_STATE); if (targetAuthState != null) { userPrincipal = getAuthPrincipal(targetAuthState); if (userPrincipal == null) { AuthState proxyAuthState = (AuthState) context.getAttribute( ClientContext.PROXY_AUTH_STATE); userPrincipal = getAuthPrincipal(proxyAuthState); } } if (userPrincipal == null) { ManagedClientConnection conn = (ManagedClientConnection) context.getAttribute( ExecutionContext.HTTP_CONNECTION); if (conn.isOpen()) { SSLSession sslsession = conn.getSSLSession(); if (sslsession != null) { userPrincipal = sslsession.getLocalPrincipal(); } } } return userPrincipal; }
public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
public Object getUserToken(final HttpContext context) { Principal userPrincipal = null; AuthState targetAuthState = (AuthState) context.getAttribute( ClientContext.TARGET_AUTH_STATE); if (targetAuthState != null) { userPrincipal = getAuthPrincipal(targetAuthState); if (userPrincipal == null) { AuthState proxyAuthState = (AuthState) context.getAttribute( ClientContext.PROXY_AUTH_STATE); userPrincipal = getAuthPrincipal(proxyAuthState); } } if (userPrincipal == null) { ManagedClientConnection conn = (ManagedClientConnection) context.getAttribute( ExecutionContext.HTTP_CONNECTION); if (conn.isOpen()) { SSLSession sslsession = conn.getSSLSession(); if (sslsession != null) { userPrincipal = sslsession.getLocalPrincipal(); } } } return userPrincipal; }
public Object getUserToken(final HttpContext context) { Principal userPrincipal = null; AuthState targetAuthState = (AuthState) context.getAttribute( ClientContext.TARGET_AUTH_STATE); if (targetAuthState != null) { userPrincipal = getAuthPrincipal(targetAuthState); if (userPrincipal == null) { AuthState proxyAuthState = (AuthState) context.getAttribute( ClientContext.PROXY_AUTH_STATE); userPrincipal = getAuthPrincipal(proxyAuthState); } } if (userPrincipal == null) { ManagedClientConnection conn = (ManagedClientConnection) context.getAttribute( ExecutionContext.HTTP_CONNECTION); if (conn.isOpen()) { SSLSession sslsession = conn.getSSLSession(); if (sslsession != null) { userPrincipal = sslsession.getLocalPrincipal(); } } } return userPrincipal; }
@Override public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
@Override public boolean streamClosed(final InputStream wrapped) throws IOException { try { if (managedConn != null) { if (attemptReuse) { final boolean valid = managedConn.isOpen(); // this assumes that closing the stream will // consume the remainder of the response body: try { wrapped.close(); managedConn.markReusable(); } catch (final SocketException ex) { if (valid) { throw ex; } } } else { managedConn.unmarkReusable(); } } } finally { releaseManagedConnection(); } return false; }
if (!managedConn.isOpen()) { managedConn.open(route, context, params); } else {
if (!managedConn.isOpen()) { managedConn.open(route, context, params); } else {
if (!managedConn.isOpen()) { managedConn.open(route, context, params); } else {
if (!managedConn.isOpen()) { managedConn.open(route, context, params); } else {
if (!managedConn.isOpen()) {
if (!managedConn.isOpen()) {
if (!this.managedConn.isOpen()) { this.managedConn.open(route, context, this.params);