Package com.volantis.shared.net.proxy

Examples of com.volantis.shared.net.proxy.Proxy


                if (proxyManager != null) {
                    try {
                        URL realUrl = new URL(url);

                        // Get the proxy config to use for the host.
                        Proxy proxy = proxyManager.getProxyForHost(
                                realUrl.getHost());
                        if (proxy != null) {
                            method.getHostConfiguration().
                                setProxy(proxy.getHost(), proxy.getPort());

                        if (proxy.useAuthorization()) {
                            method.setDoAuthentication(true);

                            // mock up a authentication challenge so we can get
                            // the response (which can be sent before the
                            // challenge if we want to save time and effort)
View Full Code Here


        configuration.setHost(url.getHost(), url.getPort(), url.getProtocol());
        method.setHostConfiguration(configuration);
        method.setFollowRedirects(true);

        // Get the proxy config to use for the host.
        final Proxy proxy = manager.getProxy(url.getHost());
        if (proxy != null) {
            configuration.setProxy(proxy.getHost(), proxy.getPort());

            if (proxy.useAuthorization()) {
                method.setDoAuthentication(true);

                // mock up a authentication challenge so we can get
                // the response (which can be sent before the
                // challenge if we want to save time and effort)
View Full Code Here

    public SystemProxyManager(
            ProxyFactory factory,
            SystemProperties systemProperties) {
        this.systemProperties = systemProperties;
        ProxyBuilder builder = factory.createProxyBuilder();
        Proxy sysProxy = null;
        Pattern exHostRE = null;

        if (initialiseAddress(builder)) {
            builder.setUser(getSystemPropertyAsString(HTTPSystemPropertyKeys.PROXY_USER));
            builder.setPassword(getSystemPropertyAsString(HTTPSystemPropertyKeys.PROXY_PASSWORD));
View Full Code Here

        return systemProxy;
    }

    // Javadoc inherited.
    public Proxy getProxyForHost(String host) {
        Proxy result = null;
        if (excludedHostRE == null) {
            result = systemProxy;
        } else {
            Matcher matcher = excludedHostRE.matcher(host);
View Full Code Here

                HTTPSystemPropertyKeys.PROXY_EXCLUDE, "").returns("");

        SystemProxyManager manager = new SystemProxyManager(
                ProxyFactory.getDefaultInstance(),
                systemPropertiesMock);
        Proxy proxy = manager.getSystemProxy();
        checkProxy(proxy, "foobar", 90, "me", "mine");
    }
View Full Code Here

        addHTTPPropertyExpectations("foobar", "", "", "", "");

        SystemProxyManager manager = new SystemProxyManager(
                ProxyFactory.getDefaultInstance(),
                systemPropertiesMock);
        Proxy proxy = manager.getSystemProxy();
        checkProxy(proxy, "foobar", 80, null, null);
    }
View Full Code Here

        addHTTPPropertyExpectations("foobar", "99", "me", "mine", "");

        SystemProxyManager manager = new SystemProxyManager(
                ProxyFactory.getDefaultInstance(),
                systemPropertiesMock);
        Proxy proxy;
        proxy = manager.getSystemProxy();
        checkProxy(proxy, "foobar", 99, "me", "mine");
    }
View Full Code Here

                "*.volantis.com|www.google.com");

        SystemProxyManager manager = new SystemProxyManager(
                ProxyFactory.getDefaultInstance(),
                systemPropertiesMock);
        Proxy systemProxy = manager.getSystemProxy();
        checkProxy(systemProxy, "foobar", 99, "me", "mine");

        assertNull(manager.getProxyForHost("www.volantis.com"));
        assertNull(manager.getProxyForHost("foo.volantis.com"));
        assertNull(manager.getProxyForHost("www.google.com"));
View Full Code Here

                "*.volantis.com|www.google.com");

        ProxyFactory factory = new ProxyFactoryImpl(systemPropertiesMock);
        ProxyManager manager = factory.getSystemProxyManager();

        Proxy proxy = manager.getProxyForHost("www.google.com2");
        assertNotNull(proxy);
        checkProxy(proxy, "foobar", 99, "me", "mine");

        assertNull(manager.getProxyForHost("www.volantis.com"));
        assertNull(manager.getProxyForHost("foo.volantis.com"));
View Full Code Here

TOP

Related Classes of com.volantis.shared.net.proxy.Proxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.