Package org.wiztools.restclient

Examples of org.wiztools.restclient.ProxyConfig


       
        String username = jtf_username.getText();
        char[] password = jpf_password.getPassword();
       
        // Setting proxy object
        ProxyConfig proxy = ProxyConfig.getInstance();
        proxy.acquire();
        if(enabled){
            proxy.setEnabled(true);
            proxy.setHost(host);
            proxy.setPort(port);
           
            if(authEnabled){
                proxy.setAuthEnabled(true);
                proxy.setUsername(username);
                proxy.setPassword(password);
            }
        }
        else{
            proxy.setEnabled(false);
        }
        proxy.release();
        return true;
    }
View Full Code Here


        proxy.release();
        return true;
    }
   
    private void setUIFromCache(){
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        jcb_enable.setSelected(proxy.isEnabled());
        jtf_host.setText(proxy.getHost());
        jtf_port.setText("" + proxy.getPort());
        jcb_auth_enable.setSelected(proxy.isAuthEnabled());
        jtf_username.setText(proxy.getUsername());
        if(proxy.getPassword() == null){
            jpf_password.setText("");
        }
        else{
            jpf_password.setText(new String(proxy.getPassword()));
        }
        proxy.release();

        // Disable/enable the interface:
        toggleEnable(proxy.isEnabled());
        // toggleAuthEnable(proxy.isAuthEnabled());
    }
View Full Code Here

    }

    @Override
    public void initOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        try{
            proxy.setEnabled(Boolean.valueOf(options.getProperty(PROP_PREFIX + "is_enabled")));
            proxy.setHost(options.getProperty(PROP_PREFIX + "host"));
            proxy.setPort(Integer.parseInt(options.getProperty(PROP_PREFIX + "port")));
            proxy.setAuthEnabled(Boolean.valueOf(options.getProperty(PROP_PREFIX + "is_auth_enabled")));
            proxy.setUsername(options.getProperty(PROP_PREFIX + "username"));
            proxy.setPassword(options.getProperty(PROP_PREFIX + "password").toCharArray());
            setUIFromCache();
        }
        catch(Exception ex){
            LOG.info("Cannot load Proxy options from properties.");
        }
        proxy.release();
    }
View Full Code Here

    }

    @Override
    public void shutdownOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        options.setProperty(PROP_PREFIX + "is_enabled", String.valueOf(proxy.isEnabled()));
        options.setProperty(PROP_PREFIX + "host", proxy.getHost());
        options.setProperty(PROP_PREFIX + "port", String.valueOf(proxy.getPort()));
        options.setProperty(PROP_PREFIX + "is_auth_enabled", String.valueOf(proxy.isAuthEnabled()));
        options.setProperty(PROP_PREFIX + "username", proxy.getUsername());
        String pwd = proxy.getPassword()==null? "": new String(proxy.getPassword());
        options.setProperty(PROP_PREFIX + "password", pwd);
        proxy.release();
    }
View Full Code Here

       
        String username = jtf_username.getText();
        char[] password = jpf_password.getPassword();
       
        // Setting proxy object
        ProxyConfig proxy = ProxyConfig.getInstance();
        proxy.acquire();
        if(enabled){
            proxy.setEnabled(true);
            proxy.setHost(host);
            proxy.setPort(port);
           
            if(authEnabled){
                proxy.setAuthEnabled(true);
                proxy.setUsername(username);
                proxy.setPassword(password);
            }
        }
        else{
            proxy.setEnabled(false);
        }
        proxy.release();
        return true;
    }
View Full Code Here

        proxy.release();
        return true;
    }
   
    private void setUIFromCache(){
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        jcb_enable.setSelected(proxy.isEnabled());
        jtf_host.setText(proxy.getHost());
        jtf_port.setText("" + proxy.getPort());
        jcb_auth_enable.setSelected(proxy.isAuthEnabled());
        jtf_username.setText(proxy.getUsername());
        if(proxy.getPassword() == null){
            jpf_password.setText("");
        }
        else{
            jpf_password.setText(new String(proxy.getPassword()));
        }
        proxy.release();

        // Disable/enable the interface:
        toggleEnable(proxy.isEnabled());
        // toggleAuthEnable(proxy.isAuthEnabled());
    }
View Full Code Here

        return true;
    }

    @Override
    public void initOptions() {
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        setUIFromCache();
        proxy.release();
    }
View Full Code Here

        proxy.release();
    }

    @Override
    public void shutdownOptions() {
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        proxy.write();
        proxy.release();
    }
View Full Code Here

TOP

Related Classes of org.wiztools.restclient.ProxyConfig

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.