Package autotest.common

Examples of autotest.common.JsonRpcCallback


            rpcMethod = "test_label_remove_tests";
        }

        JSONObject args = Utils.copyJSONObject(currentTestCondition);
        args.put("label_id", new JSONString(label));
        rpcProxy.rpcCall(rpcMethod, args, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                notifyManager.showMessage("Labels modified successfully");
            }
        });
View Full Code Here


            }
        });
    }

    private void updateLabels() {
        rpcProxy.rpcCall("get_test_labels", null, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                staticData.setData("test_labels", result);
            }
        });
View Full Code Here

        values.put("id", user.get("id"));
        values.put("reboot_before", new JSONString(rebootBefore.getSelectedChoice()));
        values.put("reboot_after", new JSONString(rebootAfter.getSelectedChoice()));
        values.put("drone_set", new JSONString(droneSet.getItemText(droneSet.getSelectedIndex())));
        values.put("show_experimental", JSONBoolean.getInstance(showExperimental.getValue()));
        proxy.rpcCall("modify_user", values, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                refresh();
            }
        });
View Full Code Here

        selector.setSelectedIndex(0);
       
        JSONObject params = new JSONObject();
        params.put("name", new JSONString(name));
        params.put("type", new JSONString(preconfigType));
        rpcProxy.rpcCall("get_preconfig", params, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                JSONObject config = result.isObject();
                Map<String, String> map = new HashMap<String, String>();
                for (String key : config.keySet()) {
View Full Code Here

    private void fillQueryList(final ListBox list) {
        StaticDataRepository staticData = StaticDataRepository.getRepository();
        JSONObject args = new JSONObject();
        args.put("owner", new JSONString(staticData.getCurrentUserLogin()));
        rpcProxy.rpcCall("get_saved_queries", args, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                for (JSONObject query : new JSONArrayList<JSONObject>(result.isArray())) {
                    int id = (int) query.get("id").isNumber().doubleValue();
                    list.addItem(query.get("name").isString().stringValue(),
View Full Code Here

        if (event.getSource() == addQueryDialog.actionButton) {
            addQueryDialog.hide();
            JSONObject args = new JSONObject();
            args.put("name", new JSONString(addQueryDialog.widget.getText()));
            args.put("url_token", new JSONString(CustomHistory.getLastHistoryToken().toString()));
            rpcProxy.rpcCall("add_saved_query", args, new JsonRpcCallback() {
                @Override
                public void onSuccess(JSONValue result) {
                    notifyManager.showMessage("Query saved");
                    populateMainList();
                }
            });
        } else {
            assert event.getSource() == deleteQueryDialog.actionButton;
            deleteQueryDialog.hide();
            String idString =
                deleteQueryDialog.widget.getValue(deleteQueryDialog.widget.getSelectedIndex());
            JSONObject args = new JSONObject();
            JSONArray ids = new JSONArray();
            ids.set(0, new JSONNumber(Integer.parseInt(idString)));
            args.put("id_list", ids);
            rpcProxy.rpcCall("delete_saved_queries", args, new JsonRpcCallback() {
                @Override
                public void onSuccess(JSONValue result) {
                    notifyManager.showMessage("Query deleted");
                    populateMainList();
                }
View Full Code Here

            return;
        }
       
        JSONObject args = new JSONObject();
        args.put("id", new JSONNumber(Integer.parseInt(idString)));
        rpcProxy.rpcCall("get_saved_queries", args, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                JSONArray queries = result.isArray();
                if (queries.size() == 0) {
                    notifyManager.showError("No saved query with ID " + idString);
View Full Code Here

        if (params == null) {
            graphButton.setEnabled(true);
            return;
        }

        plot.refresh(params, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                plot.setVisible(true);
                embeddingLink.setVisible(true);
                graphButton.setEnabled(true);
View Full Code Here

        final String param = Utils.jsonToString(drilldownParams.get("param"));

        JSONObject params = new JSONObject();
        params.put("query", new JSONString(query));
        params.put("param", new JSONString(param));
        rpcProxy.rpcCall("execute_query_with_param", params, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                JSONArray data = result.isArray();

                String title = series + " for " + param;
View Full Code Here

    protected abstract void showDrilldownImpl(JSONObject drilldownParams);

    public void refresh(JSONObject params, final JsonRpcCallback callback) {
        params.put("drilldown_callback", new JSONString(callbackName));
        rpcProxy.rpcCall(rpcName, params, new JsonRpcCallback() {
            @Override
            public void onSuccess(JSONValue result) {
                plotElement.setHTML(Utils.jsonToString(result));
                callback.onSuccess(result);
            }
View Full Code Here

TOP

Related Classes of autotest.common.JsonRpcCallback

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.