package org.chenyang.http.client.protocol;

import org.chenyang.http.auth.AuthSchemeRegistry;
import org.chenyang.http.client.CookieStore;
import org.chenyang.http.client.CredentialsProvider;
import org.chenyang.http.cookie.CookieSpecRegistry;
import org.chenyang.http.protocol.HttpContext;
import org.chenyang.http.util.Args;

/** @deprecated */
@Deprecated
public class ClientContextConfigurer implements ClientContext {
   private final HttpContext context;

   public ClientContextConfigurer(HttpContext context) {
      Args.notNull(context, "HTTP context");
      this.context = context;
   }

   public void setCookieSpecRegistry(CookieSpecRegistry registry) {
      this.context.setAttribute("http.cookiespec-registry", registry);
   }

   public void setAuthSchemeRegistry(AuthSchemeRegistry registry) {
      this.context.setAttribute("http.authscheme-registry", registry);
   }

   public void setCookieStore(CookieStore store) {
      this.context.setAttribute("http.cookie-store", store);
   }

   public void setCredentialsProvider(CredentialsProvider provider) {
      this.context.setAttribute("http.auth.credentials-provider", provider);
   }
}
