Package org.apache.airavata.xbaya.graph

Examples of org.apache.airavata.xbaya.graph.GraphException


                }
            } else if (edges.size() > 1) {
                // Not the first edge.
                QName parameterType = getParameterType();
                if (!toType.equals(WSConstants.XSD_ANY_TYPE) && !parameterType.equals(toType)) {
                    throw new GraphException("Cannot connect ports with different types.");
                }

            } else {
                // Should not happen.
                throw new XBayaRuntimeException("edges.size(): " + edges.size());
View Full Code Here


        String id = node.getID();
        Port port = node.getPort();

        Node fromNode = port.getFromNode();
        if (fromNode == null) {
            throw new GraphException("Output parameter has to be connected to some node.");
        }
        Port fromPort = port.getFromPort();
        if (fromNode instanceof InputNode) {
            // The OutputNode is directly connected to an InputNode.
            pw.println(TAB + id + VALUE_SUFFIX + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
View Full Code Here

            return false;
        }
        for (Port port : node.getInputPorts()) {
            Collection<Node> fromNodes = port.getFromNodes();
            if (fromNodes.isEmpty()) {
                throw new GraphException("There is a port that is not connected to any.");
            } else {
                for (Node fromNode : fromNodes) {
                    if (this.notYetInvokedNodes.contains(fromNode)) {
                        // There is a node that should be executed before this
                        // node.
View Full Code Here

    public void removeNode(Node node) throws GraphException {
        if (node == null) {
            throw new IllegalArgumentException("null");
        }
        if (!this.nodes.contains(node)) {
            throw new GraphException("The graph doesn't contain the node that is being removed.");
        }

        NodeImpl nodeImpl = (NodeImpl) node;

        // Have to be very careful to remove the node.
View Full Code Here

    public void removePort(Port port) throws GraphException {
        if (port == null) {
            throw new IllegalArgumentException("null");
        }
        if (!this.ports.contains(port)) {
            throw new GraphException("The graph doesn't contain the port that is being removed.");
        }

        // copy it so that we can remove edge without worrying about the
        // iteration issue.
        ArrayList<Edge> edgesToBeRemoved = new ArrayList<Edge>(port.getEdges());
View Full Code Here

            return null;
        }

        if (!this.ports.contains(fromPort) || !this.ports.contains(toPort)) {
            // The specified port doesn't belong to the graph.
            throw new GraphException("The graph doesn't contain the specified port.");
        }

        PortImpl fromPortImpl = (PortImpl) fromPort;
        PortImpl toPortImpl = (PortImpl) toPort;
        NodeImpl fromNode = fromPortImpl.getNode();
View Full Code Here

     * @throws GraphException
     * @see org.apache.airavata.xbaya.graph.Graph#removeEdge(org.apache.airavata.xbaya.graph.Edge)
     */
    public void removeEdge(Edge edge) throws GraphException {
        if (!this.edges.contains(edge)) {
            throw new GraphException("The graph doesn't contain the specified edge.");
        }
        EdgeImpl edgeImpl = (EdgeImpl) edge;

        PortImpl fromPort = edgeImpl.getFromPort();
        PortImpl toPort = edgeImpl.getToPort();
View Full Code Here

     */
    public void importGraph(Graph graph) throws GraphException {

        // Does not support other implementations.
        if (!(graph instanceof GraphImpl)) {
            throw new GraphException("Cannot import this graph implementation");
        }

        GraphImpl graphImpl = (GraphImpl) graph;

        for (NodeImpl node : graphImpl.getNodes()) {
View Full Code Here

                // The first edge.
                this.type = toType;
            } else if (edges.size() > 1) {
                // Not the first edge.
                if (!toType.equals(WSConstants.XSD_ANY_TYPE) && !this.type.equals(toType)) {
                    throw new GraphException("Cannot connect ports with different types.");
                }

            } else {
                // Should not happen.
                throw new XBayaRuntimeException("edges.size(): " + edges.size());
View Full Code Here

     * @throws GraphException
     */
    protected void indexToPointer() throws GraphException {
        this.node = this.graph.getNode(this.nodeID);
        if (this.node == null) {
            throw new GraphException("Cannot find a node with the ID, " + this.nodeID + ".");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.graph.GraphException

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.