Package org.wiztools.restclient

Examples of org.wiztools.restclient.IGlobalOptions


        return true;
    }

    @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.");
        }
View Full Code Here


        proxy.release();
    }

    @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

        this.add(jp);
    }

    private boolean isIndentSetInGlobalOptions(){
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        String indentStr = options.getProperty(INDENT_KEY);
        return indentStr==null? false: (indentStr.equals("true")? true: false);
    }
View Full Code Here

        String indentStr = options.getProperty(INDENT_KEY);
        return indentStr==null? false: (indentStr.equals("true")? true: false);
    }

    private boolean isResponseSyntaxSetInGlobalOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        String syntaxResponse = options.getProperty(SYNTAX_COLOR_RESPONSE);
        return syntaxResponse==null? true: Boolean.valueOf(syntaxResponse);
    }
View Full Code Here

        String syntaxResponse = options.getProperty(SYNTAX_COLOR_RESPONSE);
        return syntaxResponse==null? true: Boolean.valueOf(syntaxResponse);
    }

    private boolean isRequestSyntaxSetInGlobalOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        String syntaxRequest = options.getProperty(SYNTAX_COLOR_REQUEST);
        return syntaxRequest==null? true: Boolean.valueOf(syntaxRequest);
    }
View Full Code Here

        return null;
    }

    @Override
    public boolean saveOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        options.setProperty(INDENT_KEY, String.valueOf(jcb_indentResponse.isSelected()));

        options.setProperty(SYNTAX_COLOR_REQUEST, String.valueOf(jcb_syntaxRequest.isSelected()));
        options.setProperty(SYNTAX_COLOR_RESPONSE, String.valueOf(jcb_syntaxResponse.isSelected()));
        return true;
    }
View Full Code Here

            reqTimeout = 1000 * reqTimeout;
            ok_type = SECONDS;
        }
        ok_value = reqTimeout;
       
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        options.acquire();
        options.setProperty("request-timeout-in-millis", String.valueOf(reqTimeout));
        options.release();
       
        return true;
    }
View Full Code Here

        return true;
    }

    @Override
    public void initOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        try{
            String t = options.getProperty(PROP_PREFIX + "type");
            ok_type = t==null? ok_type: t;
            ok_value = Integer.parseInt(options.getProperty(PROP_PREFIX + "value"));
            // ok_value is always stored in milli-secs, so convertion is necessary:
            if(SECONDS.equals(ok_type)){
                lastSelected = SECONDS;
                ok_value = ok_value / 1000;
            }
View Full Code Here

        }
    }

    @Override
    public void shutdownOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        options.setProperty(PROP_PREFIX + "type", ok_type);
        options.setProperty(PROP_PREFIX + "value", String.valueOf(ok_value));
    }
View Full Code Here

       
        this.add(jp);
    }

    private boolean isIndentSetInGlobalOptions(){
        IGlobalOptions options = ServiceLocator.getInstance(IGlobalOptions.class);
        String indentStr = options.getProperty(INDENT_KEY);
        return indentStr==null? false: (indentStr.equals("true")? true: false);
    }
View Full Code Here

TOP

Related Classes of org.wiztools.restclient.IGlobalOptions

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.