Examples of RequestNode


Examples of eu.admire.dispel.graph.RequestNode

        {
            for (Entry<Integer, Connection> input : inputs.getValue().entrySet())
            {
                for (RequestNodeInput inp : input.getValue().getTargets())
                {
                    RequestNode node = inp.getRequestNode();
                    nodes.addAll(GraphUtilities.getConnectedComponent(node).getNodes());
                }
            }
        }
        for (Entry<String, Map<Integer, Connection>> outputs : mOutputs.getOutputs().entrySet())
        {
            for (Entry<Integer, Connection> output : outputs.getValue().entrySet())
            {
                Connection connection = output.getValue();
                RequestNode node = connection.getSource();
                nodes.addAll(GraphUtilities.getConnectedComponent(node).getNodes());
            }
        }
        Graph graph = new Graph();
        graph.addAll(nodes);
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

                    // this is valid so we're just ignoring it
                        continue;
                }
                for (Entry<Integer, Connection> connection : input.entrySet())
                {
                    RequestNode source = connection.getValue().getSource();
                    String name = connection.getValue().getSourceOutputName();
                    ProcessingElementOutputDescriptor outputDescriptor =
                        getOutputDescriptor(source, name);
                    try
                    {
                        RequestNode converter =
                            mTypeChecker.checkCompatibility(
                                    outputDescriptor, inputDescriptor);
                        insertConverter(
                                newNodes,
                                requestNode,
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

        List<RequestNode> nodes = transformed.getNodes();
        TestCase.assertTrue(nodes.remove(a));
        TestCase.assertTrue(nodes.remove(c));
        TestCase.assertTrue(!nodes.contains(b));
        TestCase.assertEquals(1, nodes.size());
        RequestNode node = nodes.get(0);
        TestCase.assertTrue(node instanceof CompositeProcessingElement);
        CompositeProcessingElement composite = (CompositeProcessingElement)node;
        TestCase.assertEquals(2, composite.getElements().size());
    }
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

       
        DispelEngineResult result = engine.processDispel(dispel);
        Collection<Graph> graphs = result.getExecutionGraphs();
        assertEquals("Expect a single execution graph", 1, graphs.size());
        Graph graph = graphs.iterator().next();
        RequestNode echo = null;
        for (RequestNode node : graph.getNodes())
        {
            if (node.getName().equals("uk.org.ogsadai.Echo"))
            {
                echo = node;
            }
        }
        assertNotNull(echo);
       
        // test that the converter has been inserted correctly
        Connection echoInput = echo.getInput("input", 0);
        RequestNode converter = echoInput.getSource();
        assertNotNull(converter);
        assertEquals(SimpleTupleTypeConverter.TUPLE_CONVERT, converter.getName());
        RequestNode node = converter.getInput("expressions", 0).getSource();
        assertTrue(node instanceof LiteralValuesNode);
        List<Object> values = ((LiteralValuesNode)node).getValues();
        assertEquals(3, values.size());
        assertEquals(ListMarker.BEGIN, values.get(0));
        assertEquals("min+273.15", values.get(1));
        assertEquals(ListMarker.END, values.get(2));
        node = converter.getInput("columnNames", 0).getSource();
        assertTrue(node instanceof LiteralValuesNode);
        values = ((LiteralValuesNode)node).getValues();
        assertEquals(3, values.size());
        assertEquals(ListMarker.BEGIN, values.get(0));
        assertEquals("min", values.get(1));
        assertEquals(ListMarker.END, values.get(2));
        RequestNode sequence = converter.getInput("data", 0).getSource();
        assertTrue(sequence instanceof LiteralValuesNode);
        values = ((LiteralValuesNode)sequence).getValues();
        assertEquals(3, values.size());
        assertEquals(ListMarker.BEGIN, values.get(0));
        assertTrue(values.get(1) instanceof Map<?,?>);
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

            String gatewayName = (String)node.getAnnotation(AnnotationKeys.GATEWAY);
            for (Entry<String, Map<Integer, Connection>> inputs : node.getAllInputs().entrySet())
            {
                for (Entry<Integer, Connection> input : inputs.getValue().entrySet())
                {
                    RequestNode source = input.getValue().getSource();
                    if (source.isProcessingElement() &&
                            !gatewayName.equals(source.getAnnotation(AnnotationKeys.GATEWAY)))
                    {
                        insertDataTransfer(newNodes, input.getValue(), node, inputs.getKey(), input.getKey());
                    }
                }
            }
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

    private void insertDataTransfer(
            List<RequestNode> graph,
            Connection connection,
            RequestNode target, String name, int index)
    {
        RequestNode source = connection.getSource();
        Object sourceGateway = source.getAnnotation(AnnotationKeys.GATEWAY);
        Object targetGateway = target.getAnnotation(AnnotationKeys.GATEWAY);
        String transferName = mTransferPrefix + (mDTCounter++);
       
        // insert a new external output node with an auto-generated name
        ExternalOutputNode externalOutput =
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

        Map<String, Map<Integer, Connection>> allOutputs = node.getAllOutputs();
        Connection out = allOutputs.get(DATA_EXCHANGE_OUTPUT_NAME).get(0);
       
        graph.getNodes().remove(node);
       
        RequestNode sourceNode = in.getSource();
        sourceNode.replaceOutput(
            in.getSourceOutputName(),
            in.getSourceOutputIndex(),
            out);
    }
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

        if (nameInputs != null)
        {
            Connection input = nameInputs.get(0);
            if (input != null)
            {
                RequestNode source = input.getSource();
                remove.add(source);
                if (source instanceof LiteralValuesNode)
                {
                    name = (String)((LiteralValuesNode) source).getValues().get(0);
                }
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

  @Override
  public Graph transform(RequestContext context, Graph graph)
      throws TransformationException {

    RequestNode gathererNode = new ProcessingElementNode("eu.admire.Gatherer");
    List<RequestNode> list = new ArrayList<RequestNode>();

    int i = 0; // number of created Observers

    for (RequestNode node : graph.getNodes()) {

      Map<String, Map<Integer, Connection>> outputs = node
          .getAllOutputs();

      for (String keyName : outputs.keySet()) {
        for (Integer keyIndex : outputs.get(keyName).keySet()) {
          Connection conn = outputs.get(keyName).get(keyIndex);

              int targetCount = 0;
              for(RequestNodeInput target : conn.getTargets()) {
         
                       
                        RequestNode observerNode = new ProcessingElementNode("eu.admire.Observer");
                       
                        Connection output = observerNode.getOutput("out", 0);
                        target.getRequestNode().replaceInput(target.getName(), target.getIndex(), output);
                       
                        Connection input = observerNode.getInput("in", 0);
                       
                        if (targetCount == 0)
                        {
                            node.replaceOutput(keyName, keyIndex, input);
                        }
                        else
                        {
                            observerNode.connectInput("in", 0, node.getOutput(keyName, keyIndex));
                        }
                        targetCount++;

                        Connection gathConn = observerNode.getOutput("observed", 0);
                        gathererNode.connectInput("input", i++, gathConn);


                       
                        list.add(observerNode);
View Full Code Here

Examples of eu.admire.dispel.graph.RequestNode

        d.setRepresents(new SimpleSemanticType("", "tempInCelsius"));
        tupleOut.addElement("min", d);
        tupleOut.addElement("max", d);
        ProcessingElementOutputDescriptor output = new ProcessingElementOutputDescriptor("output");
        output.setDType(new CollectionDType(tupleOut, CollectionDType.LIST));
        RequestNode result = converter.checkCompatibility(output, input);

        TestCase.assertTrue(result instanceof CompositeProcessingElement);
        CompositeProcessingElement composite = (CompositeProcessingElement)result;
        List<RequestNodeInput> targets = composite.getInput("input", 0).getTargets();
        TestCase.assertEquals(1, targets.size());
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.