Package org.apache.airavata.xbaya

Examples of org.apache.airavata.xbaya.XBayaRuntimeException


        for (DataPort port : this.inputPorts) {
            if (port.getID().equals(id)) {
                return port;
            }
        }
        throw new XBayaRuntimeException("Port with id not found :" + id);
    }
View Full Code Here


                if (!(fromType == null || fromType
                        .equals(WSConstants.XSD_ANY_TYPE))) {
                    toDataPort.copyType(fromDataPort);
                }
            } else {
                throw new XBayaRuntimeException();
            }
        }
    }
View Full Code Here

        if (kind == Kind.DATA_IN) {
            index = inputPorts.indexOf(port);
        } else if (kind == Kind.DATA_OUT) {
            index = outputPorts.indexOf(port);
        } else {
            throw new XBayaRuntimeException();
        }

        SystemDataPort inputPort = (SystemDataPort) inputPorts.get(index);
        SystemDataPort outputPort = (SystemDataPort) outputPorts.get(index);

        QName inputType = inputPort.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort) {
            // input -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
              //  outputPort.copyType(port, -1);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                // XXX cannot parse array from WSDL.
                // String message = "The type of input " + index + " ("
                // + inputType + ") of " + getID()
                // + " must be same as the type of output " + index + " ("
                // + outputType + ").";
                // throw new GraphException(message);
            }

        } else if (port == outputPort) {
            // output -> input1
            if (inputType.equals(WSConstants.XSD_ANY_TYPE)) {
               // inputPort.copyType(port, 1);
            } else if (inputType.equals(portType)) {
                // Do nothing.
            } else {
                // XXX cannot parse array from WSDL.
                // String message = "The type of input " + index + " ("
                // + inputType + ") of " + getID()
                // + " must be same as the type of output " + index + " ("
                // + outputType + ").";
                // throw new GraphException(message);
            }
        } else {
            throw new XBayaRuntimeException();
        }
    }
View Full Code Here

        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int ret = fileChooser.showOpenDialog(this.engine.getGUI().getFrame());
        if (JFileChooser.APPROVE_OPTION != ret) {
            throw new XBayaRuntimeException("Cannot proceed without valid directory");
        }
        File selectedDir = fileChooser.getSelectedFile();
        File rootDir = new File(selectedDir, "xbaya");
        deleteDir(rootDir);
        rootDir.mkdir();
View Full Code Here

            if (toNodes.size() == 1 && toNodes.get(0) instanceof WSPort) {
                WSPort outPort = (WSPort) toNodes.get(0);
                returnElement = outPort.getComponentPort().getElement();
                returnType = outPort.getType();
            } else {
                throw new XBayaRuntimeException("Unhandled  port type for Dynamic component or to many outputs");
            }
            for (Port port : toNodes) {
                if (toNodes.get(0) instanceof DataPort) {
                    if (!returnType.equals(((DataPort) toNodes.get(0)).getType())) {
                        throw new XBayaRuntimeException(
                                "Dynamic output port connected to input ports of different types.");
                    }
                } else {
                    throw new XBayaRuntimeException("Unhandled  port type for Dynamic component");
                }
            }
            int index = BasicTypeMapping.getSimpleTypeIndex(returnElement);
            if (-1 != index) {
                function += SPACE + BasicTypeMapping.getTypeName(index);
            } else {
                throw new XBayaRuntimeException("WIll be fixed with complex type mappign");
            }
        }

        function += SPACE + "operationName(";
        List<DataPort> inputPorts = this.node.getInputPorts();
        boolean first = true;

        // variable list in function prototype
        for (DataPort inPort : inputPorts) {
            Port fromPort = inPort.getFromPort();
            if (fromPort instanceof WSPort) {
                WSPort wsPort = (WSPort) fromPort;
                XmlElement element = wsPort.getComponentPort().getElement();

                // QName inType = ((DataPort) fromPort).getType();
                int typeIndex = BasicTypeMapping.getSimpleTypeIndex(element);
                if (-1 != typeIndex) {
                    if (first) {
                        first = false;
                    } else {
                        function += SPACE + ",";
                    }
                    function += BasicTypeMapping.getTypeName(typeIndex) + SPACE
                            + BasicTypeMapping.getTypeVariableName(typeIndex);
                } else {
                    throw new XBayaRuntimeException("Complex Type occured:This will be fixed!!!!!");
                }
            } else {
                throw new XBayaRuntimeException("Dynamic Node connected to non data port");
            }
        }

        function += ")";
        ret += function;
View Full Code Here

                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }

                } else {
                    throw new XBayaRuntimeException("Unknown port for code generation" + fromPort);
                }
            } else {
                throw new XBayaRuntimeException("Unknown from node for code generation" + fromNode);
            }
        }
    }
View Full Code Here

                index = i;
                break;
            }
        }
        if (index == -1) {
            throw new XBayaRuntimeException("Operation name not found");
        }
        return publicSplit[index].substring(0, publicSplit[index].indexOf(searchStr)).trim().split(" ")[1];
    }
View Full Code Here

        if (kind == Kind.DATA_IN) {
            index = inputPorts.indexOf(port) % size;
        } else if (kind == Kind.DATA_OUT) {
            index = outputPorts.indexOf(port);
        } else {
            throw new XBayaRuntimeException();
        }

        DataPort inputPort1 = inputPorts.get(index);
        DataPort inputPort2 = inputPorts.get(size + index);
        DataPort outputPort = outputPorts.get(index);

        QName inputType1 = inputPort1.getType();
        QName inputType2 = inputPort2.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort1) {
            // input1 -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input1 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }

        } else if (port == inputPort2) {
            // input2 -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input2 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " (" + inputType2 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
        } else if (port == outputPort) {
            // output -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
            // output -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " (" + inputType2 + ") of " + getID()
                        + " must be same as the type of input " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
        } else {
            throw new XBayaRuntimeException();
        }
    }
View Full Code Here

   */
  public static Node findEndForEachFor(ForEachNode node) {

    Collection<Node> toNodes = node.getOutputPort(0).getToNodes();
    if(toNodes.size() != 1){
      throw new XBayaRuntimeException("ForEach output does not contain single out-edge");
    }
    Node middleNode = toNodes.iterator().next();
    List<DataPort> outputPorts = middleNode.getOutputPorts();
    for (DataPort dataPort : outputPorts) {
      if(dataPort.getToNodes().size() == 1){
        Node possibleEndForEachNode = dataPort.getToNodes().get(0);
        if(possibleEndForEachNode instanceof EndForEachNode){
          return possibleEndForEachNode;
        }
      }
    }
    throw new XBayaRuntimeException("EndForEachNode not found");
  }
View Full Code Here

        if (kind == Kind.DATA_IN) {
            index = inputPorts.indexOf(port) % size;
        } else if (kind == Kind.DATA_OUT) {
            index = outputPorts.indexOf(port);
        } else {
            throw new XBayaRuntimeException();
        }

        DataPort inputPort1 = inputPorts.get(index);
        DataPort inputPort2 = inputPorts.get(size + index);
        DataPort outputPort = outputPorts.get(index);

        QName inputType1 = inputPort1.getType();
        QName inputType2 = inputPort2.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort1) {
            // input1 -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input1 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }

        } else if (port == inputPort2) {
            // input2 -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input2 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " (" + inputType2 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
        } else if (port == outputPort) {
            // output -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
            // output -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " (" + inputType2 + ") of " + getID()
                        + " must be same as the type of input " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
        } else {
            throw new XBayaRuntimeException();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.XBayaRuntimeException

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.