Examples of RequestNode


Examples of com.google.code.apis.rest.client.Wadl.RequestNode

    if (method.getRequest() != null) {
      treatRequest(method.getRequest());
    }
    else {
      // adding an empty request node is safe
      method.addRequest(new RequestNode(method, application));
      treatRequest(method.getRequest());
    }   
  }
View Full Code Here

Examples of com.google.code.apis.rest.client.Wadl.RequestNode

    initWidget(containerPanel);
  }
 
  public static void listRequest(final MethodNode method, final TreeItem methodTreeItem) {
    Vector buttonTreeItems = WadlTreeRoot.removeChildrenXKeepButtons(methodTreeItem, WadlXml.requestNode);   
    RequestNode request = method.getRequest();
    if (request == null) {
      Button addRequestButton = new Button(GuiFactory.strings.addRequest());
      addRequestButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {             
          method.addRequest(new RequestNode(method, method.getApplication()));         
          listRequest(method, methodTreeItem);         
        }
      });
      TreeItem addRequestTreeItem = new TreeItem(addRequestButton);
      addRequestTreeItem.setUserObject(WadlXml.requestNode);
      methodTreeItem.addItem(addRequestTreeItem);
      return;
    }
    RequestItem requestItem = new RequestItem(method, methodTreeItem);
    TreeItem requestTreeItem = new TreeItem(requestItem);
    requestTreeItem.setUserObject(WadlXml.requestNode);   
    methodTreeItem.addItem(requestTreeItem);
    methodTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);   
   
    // check whether the request came from an analyzed uri...
    String requestString = "";
    if (request.getApplication() != null) {
      requestString = request.getApplication().getAnalyzer().getRequestString();
    }       
    ParamItem.listParams(
        request,
        requestTreeItem,
        requestString);
View Full Code Here

Examples of com.google.code.apis.rest.client.Wadl.RequestNode

          Vector allMethods = application.getAllMethods();
          Iterator allMethodsIterator = allMethods.iterator();
          while (allMethodsIterator.hasNext()) {
            MethodNode method = (MethodNode) allMethodsIterator.next();                   
            if (method.getRequest() != null) {             
              RequestNode request = method.getRequest();                       
              if (!request.getAllParams().isEmpty()) {               
                examineParams(request.getAllParams())
                return;
              }
            }
          }
        }
      }
    } 
    // do this every time
    Iterator allResourcesIterator = allResources.iterator();
    while(allResourcesIterator.hasNext()) {
      ResourceNode resource = (ResourceNode) allResourcesIterator.next();     
      if (!resource.getAllMethods().isEmpty()) {
        Vector allMethods = resource.getAllMethods();
        Iterator allMethodsIterator = allMethods.iterator();
        while(allMethodsIterator.hasNext()) {
          MethodNode method = (MethodNode) allMethodsIterator.next();         
          if (method.getRequest() != null) {
            RequestNode request = method.getRequest();                   
            if (!request.getAllParams().isEmpty()) {            
              examineParams(request.getAllParams());
              return;
            }
          }         
        }
      }   
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

                    throw new UnresolvedVariableException(connection.mPE);
                }
                value = variable.getValue(connection.mArrayIndices);
                if (value instanceof RequestNode)
                {
                    RequestNode node = (RequestNode)value;
                    mConnection = node.getOutput(connection.mName, connection.mIndex.intValue());
                }
                else
                {
                    throw new TypeMismatchException("ProcessingElement", value);
                }
            }
            break;
        }
        case INPUT:
        {
            ConnectionStrategy connection = (ConnectionStrategy)strategy;
            if (connection.mConnectionVar != null)
            {
                Connection c = (Connection) connection.mConnectionVar.getValue(connection.mArrayIndices);
                if (c == null ||
                        !(c.getSource() instanceof LiteralValuesNode &&
                                mConnection.getSource() instanceof LiteralValuesNode))
                {
                    connection.mConnectionVar.setValue(mConnection, connection.mArrayIndices);
                }
                else
                {
                    LiteralValuesNode literal = (LiteralValuesNode) c.getSource();
                    LiteralValuesNode current = (LiteralValuesNode) mConnection.getSource();
                    literal.add(current.getValues());
                }
            }
            else
            {
                Object value;
                Variable variable =
                    mExecutionState.getVariables().get(connection.mPE);
                if (variable == null)
                {
                    throw new UnresolvedVariableException(connection.mPE);
                }
                value = variable.getValue(connection.mArrayIndices);
                if (value instanceof RequestNode)
                {
                    RequestNode node = (RequestNode)value;
                    if (node.getAllInputs().containsKey(connection.mName))
                    {
                        Connection c = node.getAllInputs().get(connection.mName).get(connection.mIndex);
                        if (c != null && c.getSource() instanceof LiteralValuesNode
                                && mConnection.getSource() instanceof LiteralValuesNode)
                        {
                            LiteralValuesNode literal = (LiteralValuesNode) c.getSource();
                            LiteralValuesNode current = (LiteralValuesNode) mConnection.getSource();
                            literal.add(current.getValues());
                        }
                        else
                        {
                            node.connectInput(connection.mName, connection.mIndex.intValue(), mConnection);
                        }
                    }
                    else
                    {
                        node.connectInput(connection.mName, connection.mIndex.intValue(), mConnection);
                    }
                }
                else
                {
                    throw new TypeMismatchException("ProcessingElement", value);
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

            {
                value = variable.getValue(mArrayIndices);
            }
            if (value instanceof RequestNode)
            {
                RequestNode node = (RequestNode)value;
                if (mIsInput)
                {
                    return node.getInput(mName, mIndex.intValue());
                }
                else
                {
                    return node.getOutput(mName, mIndex.intValue());
                }
            }
            else
            {
                throw new TypeMismatchException("ProcessingElement", value);
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

        {
            value = variable.getValue(mPEVariableArrayIndices);
        }
        if (value instanceof RequestNode)
        {
            RequestNode node = (RequestNode)value;
            node.addAnnotation(mAnnotationKey, mAnnotationValue);
        }
        else
        {
            throw new TypeMismatchException("ProcessingElement", value);
        }
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

    public void submit(Expression expression) throws Exception
    {
        Object value = expression.evaluate(mExecutionState.getVariables());
        if (value instanceof RequestNode)
        {
            RequestNode node = (RequestNode)value;
            Graph graph = GraphUtilities.getConnectedComponent(node);
           
            // now replace all subgraphs with their composite processing elements
            for (Variable var : mExecutionState.getVariables().values())
            {
                if (var.getType() instanceof ProcessingElementType)
                {
                    if (var.getValue() instanceof CompositeProcessingElement)
                    {
                        CompositeProcessingElement composite =
                            (CompositeProcessingElement)var.getValue();
                        List<RequestNode> elements = composite.getElements();
                        if (graph.getNodes().removeAll(elements))
                        {
                            graph.add(composite);
                        }
                    }
                }
            }
            if (!mSubmittedGraphs.add(graph))
            {
                LOG.warn("Ignoring submit of graph containing processing element "
                        + node.getName()
                        + " because it has already been submitted.");
            }
        }
        else
        {
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

                    "|- [ 0 ] -| => d; |- [ 1 ] -| => d; " +
                    "A a = new A; |- 0 -| => a.in; |- 1 -| => a.in; ");
        assertNull(mError);
        Variable var = builder.getDispelExecutionState().getVariables().get("c");
        assertTrue(var.getValue() instanceof Connection);
        RequestNode source = ((Connection)var.getValue()).getSource();
        assertTrue(source instanceof LiteralValuesNode);
        List<Object> values = ((LiteralValuesNode)source).getValues();
        assertEquals(Arrays.asList(0l, 1l, 2l), values);
       
        var = builder.getDispelExecutionState().getVariables().get("d");
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

                    "     p.output => b.input[i]; " +
                    "}");
        assertNull(mError);
        Variable var = builder.getDispelExecutionState().getVariables().get("b");
        assertTrue(var.getValue() instanceof RequestNode);
        RequestNode node = (RequestNode)var.getValue();
        for (int i=0; i<4; i++)
        {
            RequestNode a = node.getInput("input", i).getSource();
            RequestNode source = a.getInput("input", 0).getSource();
            assertTrue(source instanceof LiteralValuesNode);
            assertEquals(
                    Arrays.asList(Long.valueOf(i)),
                    ((LiteralValuesNode)source).getValues());
        }
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

        Object value = var.getValue();
        assertTrue(value instanceof CompositeProcessingElement);
        CompositeProcessingElement comp = (CompositeProcessingElement)value;
        Connection input = comp.getInput("input", 0);
        assertEquals(2, input.getTargets().size());
        RequestNode node = input.getTargets().get(0).getRequestNode();
        assertEquals("a.A", node.getName());
        assertNotNull(node.getAllInputs().get("in1"));
        node = input.getTargets().get(1).getRequestNode();
        assertEquals("b.B", node.getName());
        assertNotNull(node.getAllInputs().get("input"));
        assertTrue(input.getSource() instanceof LiteralValuesNode);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.