Package org.apache.airavata.xbaya.monitor

Examples of org.apache.airavata.xbaya.monitor.MonitorConfiguration


        invoke(workflow, inputs, redeploy, null);
    }

    private void runInThread(final Workflow workflow, final List<WSComponentPort> inputs,
            LeadResourceMapping resourceMapping) {
        MonitorConfiguration monitorConfiguration = this.engine.getMonitor().getConfiguration();
        XBayaConfiguration configuration = this.engine.getConfiguration();

        // Create the invoker
        LEADWorkflowInvoker invoker = null;
        try {

            WsdlDefinitions wsdl = workflow.getOdeInvokableWSDL(configuration.getDSCURL(), configuration.getODEURL());

            LeadContextHeader leadContext = XBayaUtil.buildLeadContextHeader(this.engine, monitorConfiguration,
                    StringUtil.convertToJavaIdentifier(engine.getWorkflow().getName()), resourceMapping);
            // /////////////////////////////////////
            leadContext.setExperimentId(monitorConfiguration.getTopic());

            // ////////////////////////////////////////////////////////////

            URI messageBoxURL = null;
            if (monitorConfiguration.isPullMode()) {
                messageBoxURL = monitorConfiguration.getMessageBoxURL();
            }

            // create an invoker with LEAD Context
            GsiInvoker secureInvoker = null;
            if (this.engine.getWorkflowClient().isSecure()) {
View Full Code Here


     */
    public void show() {
        this.workflow = this.engine.getWorkflow();

        XBayaConfiguration configuration = this.engine.getConfiguration();
        MonitorConfiguration monitorConfiguration = this.engine.getMonitor().getConfiguration();

        // Topic
        String topic = monitorConfiguration.getTopic();
        if (topic != null) {
            this.topicTextField.setText(topic);
        } else {
            this.topicTextField.setText(UUID.randomUUID().toString());
        }
View Full Code Here

        try {
          if (this.mode == GUI_MODE) {
            leadCtxHeader = XBayaUtil.buildLeadContextHeader(
                this.getWorkflow(),
                this.configuration,
                new MonitorConfiguration(this.configuration
                    .getBrokerURL(), this.topic, true,
                    this.configuration.getMessageBoxURL()),
                wsNode.getID(), null);
          } else {
            leadCtxHeader = XBayaUtil.buildLeadContextHeader(
                this.getWorkflow(),
                this.configuration,
                new MonitorConfiguration(this.configuration
                    .getBrokerURL(), this.topic, true,
                    this.configuration.getMessageBoxURL()),
                wsNode.getID(), null);
          }
        } catch (URISyntaxException e) {
View Full Code Here

        try {
          if (this.mode == GUI_MODE) {
            leadCtxHeader = XBayaUtil.buildLeadContextHeader(
                this.getWorkflow(),
                this.configuration,
                new MonitorConfiguration(this.configuration
                    .getBrokerURL(), this.topic, true,
                    this.configuration.getMessageBoxURL()),
                foreachWSNode.getID(), null);
          } else {
            leadCtxHeader = XBayaUtil.buildLeadContextHeader(
                this.getWorkflow(),
                this.configuration,
                new MonitorConfiguration(this.configuration
                    .getBrokerURL(), this.topic, true,
                    this.configuration.getMessageBoxURL()),
                foreachWSNode.getID(), null);
          }
        } catch (URISyntaxException e) {
View Full Code Here

            this.graphCanvas.setWorkflow(workflow);
            monitor = this.engine.getMonitor();
            this.engine.getGUI().eventReceived(new Event(Type.MONITOR_STARTED));
            repaintAndWait(2);
        } else {
            MonitorConfiguration monitorConfiguration = new MonitorConfiguration(this.configuration.getBrokerURL(),
                    this.configuration.getTopic(), this.configuration.isPullMode(),
                    this.configuration.getMessageBoxURL());
            monitor = new Monitor(monitorConfiguration);
        }
View Full Code Here

     */
    public void show() {
        this.workflow = this.engine.getWorkflow();
        this.script = new JythonScript(this.workflow, this.engine.getConfiguration());

        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
        }

        // Check if the workflow is valid before the user types in input
        // values.
        ArrayList<String> warnings = new ArrayList<String>();
        if (!this.script.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getErrorWindow().warning(buf.toString());
            return;
        }

        // Create a script here. It might throw some exception because the
        // validation is not perfect.
        try {
            this.script.create();
        } catch (GraphException e) {
            this.engine.getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e);
            hide();
            return;
        } catch (RuntimeException e) {
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
            hide();
            return;
        } catch (Error e) {
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
            hide();
            return;
        }

        // Create input fields
        Collection<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
        for (InputNode node : inputNodes) {
            String id = node.getID();
            QName parameterType = node.getParameterType();
            JLabel nameLabel = new JLabel(id);
            JLabel typeField = new JLabel(parameterType.getLocalPart());
            XBayaTextField paramField = new XBayaTextField();
            Object value = node.getDefaultValue();

            String valueString;
            if (value == null) {
                valueString = "";
            } else {
                if (value instanceof XmlElement) {
                    XmlElement valueElement = (XmlElement) value;
                    valueString = XMLUtil.xmlElementToString(valueElement);
                } else {
                    // Only string comes here for now.
                    valueString = value.toString();
                }
            }
            paramField.setText(valueString);
            this.parameterPanel.add(nameLabel);
            this.parameterPanel.add(typeField);
            this.parameterPanel.add(paramField);
            this.parameterTextFields.add(paramField);
        }
        this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);

        if (notifConfig.getTopic() == null) {
            this.topicTextField.setText(UUID.randomUUID().toString());
        } else {
            this.topicTextField.setText(notifConfig.getTopic());
        }

        XBayaConfiguration config = this.engine.getConfiguration();

        URI gfacURL = config.getGFacURL();
View Full Code Here

        // Use topic as a base of workflow instance ID so that the monitor can
        // find it.
        URI workfowInstanceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
        this.workflow.setGPELInstanceID(workfowInstanceID);

        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
        notifConfig.setTopic(topic);
        arguments.add("-" + JythonScript.TOPIC_VARIABLE);
        arguments.add(topic);

        // TODO error check for user inputs

        List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
        for (int i = 0; i < inputNodes.size(); i++) {
            InputNode inputNode = inputNodes.get(i);
            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
            String id = inputNode.getID();
            String value = parameterTextField.getText();
            arguments.add("-" + id);
            arguments.add(value);
        }

        XBayaConfiguration config = this.engine.getConfiguration();

        String gfacString = this.gfacTextField.getText();
        if (gfacString.length() != 0) {
            try {
                URI uri = new URI(gfacString).parseServerAuthority();
                config.setGFacURL(uri);
            } catch (URISyntaxException e) {
                this.engine.getErrorWindow().error(ErrorMessages.GFAC_URL_WRONG, e);
                return;
            }
            arguments.add("-" + JythonScript.GFAC_VARIABLE);
            arguments.add(gfacString);
        }

        arguments.add("-" + JythonScript.BROKER_URL_VARIABLE);
        arguments.add(notifConfig.getBrokerURL().toString());

        if (notifConfig.isPullMode()) {
            arguments.add("-" + JythonScript.MESSAGE_BOX_URL_VARIABLE);
            arguments.add(notifConfig.getMessageBoxURL().toString());
        }

        try {
            for (WSNode node : GraphUtil.getWSNodes(this.workflow.getGraph())) {
                WSComponent component = node.getComponent();
View Full Code Here

    public void show() {
        this.workflow = this.engine.getWorkflow();

        this.script = new ScuflScript(this.workflow, this.engine.getConfiguration());

        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
        }

        // Check if the workflow is valid before the user types in input
        // values.
        JythonScript jythonScript = new JythonScript(this.workflow, this.engine.getConfiguration());
        ArrayList<String> warnings = new ArrayList<String>();
        if (!jythonScript.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getErrorWindow().warning(buf.toString());
            return;
        }

        // Create a script here. It might throw some exception because the
        // validation is not perfect.
        try {
            this.script.create();
        } catch (GraphException e) {
            this.engine.getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e);
            hide();
            return;
        } catch (RuntimeException e) {
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
            hide();
            return;
        } catch (Error e) {
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
            hide();
            return;
        }

        // Create input fields
        Collection<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
        for (InputNode node : inputNodes) {
            String id = node.getID();
            QName parameterType = node.getParameterType();
            JLabel nameLabel = new JLabel(id);
            JLabel typeField = new JLabel(parameterType.getLocalPart());
            XBayaTextField paramField = new XBayaTextField();
            Object value = node.getDefaultValue();

            String valueString;
            if (value == null) {
                valueString = "";
            } else {
                if (value instanceof XmlElement) {
                    XmlElement valueElement = (XmlElement) value;
                    valueString = XMLUtil.xmlElementToString(valueElement);
                } else {
                    // Only string comes here for now.
                    valueString = value.toString();
                }
            }
            paramField.setText(valueString);
            this.parameterPanel.add(nameLabel);
            this.parameterPanel.add(typeField);
            this.parameterPanel.add(paramField);
            this.parameterTextFields.add(paramField);
        }
        this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);

        this.topicTextField.setText(notifConfig.getTopic());

        this.engine.getConfiguration();

        this.dialog.show();
    }
View Full Code Here

        // Use topic as a base of workflow instance ID so that the monitor can
        // find it.
        URI workfowInstanceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
        this.workflow.setGPELInstanceID(workfowInstanceID);

        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
        notifConfig.setTopic(topic);
        arguments.add("-" + JythonScript.TOPIC_VARIABLE);
        arguments.add(topic);

        // TODO error check for user inputs

        List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
        final org.xmlpull.v1.builder.XmlElement inputs = builder.newFragment("inputs");
        for (int i = 0; i < inputNodes.size(); i++) {
            InputNode inputNode = inputNodes.get(i);
            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
            String id = inputNode.getID();
            String value = parameterTextField.getText();
            org.xmlpull.v1.builder.XmlElement input = inputs.addElement(id);
            input.addChild(value);
        }

        this.script.getScript();
        final String topicString = topic;
        new Thread() {
            /**
             * @see java.lang.Thread#run()
             */
            @Override
            public void run() {
                try {
                    MonitorConfiguration notifConfig = TavernaRunnerWindow.this.engine.getMonitor().getConfiguration();
                    TavernaRunnerWindow.this.engine.getMonitor().start();
                    notifConfig.setTopic(topicString);
                    new WorkflowInterpreter(TavernaRunnerWindow.this.engine, topicString).scheduleDynamically();
                } catch (XBayaException e) {
                    TavernaRunnerWindow.this.engine.getErrorWindow().error(e);
                }

View Full Code Here

                return;
            }
        }

        // Set to the config so that they will be reused.
        MonitorConfiguration monitorConfig = this.engine.getMonitor().getConfiguration();
        monitorConfig.setTopic(topic);
        XBayaConfiguration config = this.engine.getConfiguration();
        // config.setXRegistryURL(xRegistryURL);
        config.setGFacURL(gfacURL);

        // Deal with the Lead resource mapping
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.monitor.MonitorConfiguration

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.