package org.chenyang.http.impl.conn;

import org.chenyang.http.annotation.Contract;
import org.chenyang.http.annotation.ThreadingBehavior;
import org.chenyang.http.conn.scheme.PlainSocketFactory;
import org.chenyang.http.conn.scheme.Scheme;
import org.chenyang.http.conn.scheme.SchemeRegistry;
import org.chenyang.http.conn.ssl.SSLSocketFactory;

/** @deprecated */
@Deprecated
@Contract(
   threading = ThreadingBehavior.SAFE
)
public final class SchemeRegistryFactory {
   public static SchemeRegistry createDefault() {
      SchemeRegistry registry = new SchemeRegistry();
      registry.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
      registry.register(new Scheme("https", 443, SSLSocketFactory.getSocketFactory()));
      return registry;
   }

   public static SchemeRegistry createSystemDefault() {
      SchemeRegistry registry = new SchemeRegistry();
      registry.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
      registry.register(new Scheme("https", 443, SSLSocketFactory.getSystemSocketFactory()));
      return registry;
   }
}
