package com.jscape.inet.proxy;

import java.util.logging.Logger;

/**
 * @author Alex Usun
 */
public class Proxies {

    public static final Proxy HTTP_PROXY = new HttpProxy(Logger.getLogger("com.jscape.inet.proxy"));
    public static final Proxy SOCKS4_PROXY = new Socks4Proxy(Logger.getLogger("com.jscape.inet.proxy"));
    public static final Proxy SOCKS5_PROXY = new Socks5Proxy(Logger.getLogger("com.jscape.inet.proxy"));

    public static Proxy proxyFor(String name) {
        switch (name.toUpperCase()) {
            case "HTTP":
                return HTTP_PROXY;
            case "SOCKS4":
                return SOCKS4_PROXY;
            case "SOCKS5":
                return SOCKS5_PROXY;
            default:
                return Proxy.NULL;
        }
    }

    public static Proxy proxyFor(ProxyType type) {
        return proxyFor(type.name);
    }

    private Proxies() {
        // empty
    }
}
