Package java.net

Examples of java.net.Proxy


     * Client Side Policy.
     *
     * @return The proxy server or null, if not set.
     */
    private Proxy getProxy(HTTPClientPolicy policy) {
        Proxy proxy = null;
        if (policy != null && policy.isSetProxyServer()) {
            proxy = new Proxy(
                    Proxy.Type.valueOf(policy.getProxyServerType().toString()),
                    new InetSocketAddress(policy.getProxyServer(),
                                          policy.getProxyServerPort()));
        }
        return proxy;
View Full Code Here


    /**
     * Construct a new {@code Proxy} instance from the given policy.
     */
    private Proxy createProxy(final HTTPClientPolicy policy) {
        return new Proxy(Proxy.Type.valueOf(policy.getProxyServerType().toString()),
                         new InetSocketAddress(policy.getProxyServer(),
                                               policy.getProxyServerPort()));
    }
View Full Code Here

    /**
     * Construct a new {@code Proxy} instance from the given policy.
     */
    private Proxy createProxy(final HTTPClientPolicy policy) {
        return new Proxy(Proxy.Type.valueOf(policy.getProxyServerType().toString()),
                         new InetSocketAddress(policy.getProxyServer(),
                                               policy.getProxyServerPort()));
    }
View Full Code Here

     *
     * @param proxyHost Proxy host
     * @param proxyPort Proxy port
     */
    public void setProxy(final String proxyHost, final int proxyPort) {
        this.proxy = new Proxy(Type.HTTP, InetSocketAddress
                .createUnresolved(proxyHost, proxyPort));
    }
View Full Code Here

    public void setProxy(final Proxy proxy) {
        this.proxy = proxy;
    }

    public void setProxy(final String host, final int port) {
        setProxy(new Proxy(Type.HTTP, InetSocketAddress.createUnresolved(host, port)));
    }
View Full Code Here

    public void setProxy(final Proxy proxy) {
        this.proxy = proxy;
    }

    public void setProxy(final String proxyHost, final int proxyPort) {
        this.proxy = new Proxy(Type.HTTP, InetSocketAddress
                .createUnresolved(proxyHost, proxyPort));
    }
View Full Code Here

   * connections in JSignPdf.
   *
   * @return initialized Proxy object.
   */
  public Proxy createProxy() {
    Proxy tmpResult = Proxy.NO_PROXY;
    if (isAdvanced() && getProxyType() != Proxy.Type.DIRECT) {
      tmpResult = new Proxy(getProxyType(), new InetSocketAddress(getProxyHost(), getProxyPort()));
    }
    return tmpResult;
  }
View Full Code Here

      dic.setLocation(sap.getLocation());
      dic.setContact(sap.getContact());
      dic.setDate(new PdfDate(sap.getSignDate()));
      sap.setCryptoDictionary(dic);

      final Proxy tmpProxy = options.createProxy();

      final CRLInfo crlInfo = new CRLInfo(options, chain);

      // CRLs are stored twice in PDF c.f.
      // PdfPKCS7.getAuthenticatedAttributeBytes
View Full Code Here

        String proxyUser =
                engineGetProperty(ResolverDirectHTTP.properties[ResolverDirectHTTP.HttpProxyUser]);
        String proxyPass =
                engineGetProperty(ResolverDirectHTTP.properties[ResolverDirectHTTP.HttpProxyPass]);

        Proxy proxy = null;
        if ((proxyHostProp != null) && (proxyPortProp != null)) {
            int port = Integer.parseInt(proxyPortProp);
            proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHostProp, port));
        }

        URLConnection urlConnection;
        if (proxy != null) {
            urlConnection = url.openConnection(proxy);
View Full Code Here

        _port = Controller.getInstance().getPreferenceStore().getInt(PreferenceConstants.PROXY_PORT);
        _username = Controller.getInstance().getPreferenceStore().getString(PreferenceConstants.PROXY_USERNAME);
        _password = Controller.getInstance().getPreferenceStore().getString(PreferenceConstants.PROXY_PASSWORD);
       
        if (proxyType.equals(Proxy.Type.HTTP.toString())) {       
          _proxy = new Proxy(Proxy.Type.HTTP,  new Socket(_url, _port).getRemoteSocketAddress());       
        } else if (proxyType.equals(Proxy.Type.SOCKS.toString())) {
          _proxy = new Proxy(Proxy.Type.SOCKS, new Socket(_url, _port).getRemoteSocketAddress());
        }
      }

    } catch (UnknownHostException e) {
      Log.getInstance(NetworkManager.class).warn("Error while creating proxy (UnknownHostException): " + e.getStackTrace());
View Full Code Here

TOP

Related Classes of java.net.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.