Example usage for org.apache.http.client AuthCache remove

List of usage examples for org.apache.http.client AuthCache remove

Introduction

In this page you can find the example usage for org.apache.http.client AuthCache remove.

Prototype

void remove(HttpHost host);

Source Link

Usage

From source file:com.joyent.http.signature.apache.httpclient.HttpSignatureAuthenticationStrategy.java

@Override
public void authFailed(final HttpHost authhost, final AuthScheme authScheme, final HttpContext context) {
    Objects.requireNonNull(authhost, "Authentication host must be present");
    Objects.requireNonNull(context, "HTTP context must be present");

    LOG.debug("HTTP Signature authentication failed");

    final HttpClientContext clientContext = HttpClientContext.adapt(context);

    final AuthCache authCache = clientContext.getAuthCache();
    if (authCache != null) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Clearing cached auth scheme for " + authhost);
        }/*w ww .j  av  a2  s . c o m*/
        authCache.remove(authhost);
    }
}

From source file:org.apache.http.client.protocol.ResponseAuthCache.java

private void uncache(final AuthCache authCache, final HttpHost host, final AuthScheme authScheme) {
    if (this.log.isDebugEnabled()) {
        this.log.debug("Removing from cache '" + authScheme.getSchemeName() + "' auth scheme for " + host);
    }/* ww w.  j a  v  a  2s  .c om*/
    authCache.remove(host);
}

From source file:org.apache.http.impl.client.AuthenticationStrategyAdaptor.java

public void authFailed(final HttpHost authhost, final AuthScheme authScheme, final HttpContext context) {
    final AuthCache authCache = (AuthCache) context.getAttribute(ClientContext.AUTH_CACHE);
    if (authCache == null) {
        return;//from  w ww.  ja  v a  2s .com
    }
    if (this.log.isDebugEnabled()) {
        this.log.debug("Removing from cache '" + authScheme.getSchemeName() + "' auth scheme for " + authhost);
    }
    authCache.remove(authhost);
}

From source file:org.apache.http.impl.client.AuthenticationStrategyImpl.java

public void authFailed(final HttpHost authhost, final AuthScheme authScheme, final HttpContext context) {
    Args.notNull(authhost, "Host");
    Args.notNull(context, "HTTP context");

    final HttpClientContext clientContext = HttpClientContext.adapt(context);

    final AuthCache authCache = clientContext.getAuthCache();
    if (authCache != null) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("Clearing cached auth scheme for " + authhost);
        }/*w ww . j a va 2  s  .co  m*/
        authCache.remove(authhost);
    }
}