Package eu.admire.registry.pe

Examples of eu.admire.registry.pe.ProcessingElementDescriptor


            usedTypes.add(type.getName());
        }
        else if (type instanceof ProcessingElementTypeType)
        {
            ProcessingElementTypeType proc = (ProcessingElementTypeType)type;
            ProcessingElementDescriptor desc = proc.getDescriptor();
            if (desc.getName() != null)
            {
                String simpleName = getSimpleName(desc.getName());
                usedTypes.add(simpleName);
                dispel.append("PE<");
                dispel.append(simpleName);
                dispel.append(">");
            }
            else if (!desc.getSuperType().isEmpty())
            {
                dispel.append("PE<");
                for (String superType : desc.getSuperType())
                {
                    String simpleName = getSimpleName(superType);
                    usedTypes.add(simpleName);
                    dispel.append(simpleName);
                    dispel.append(", ");
                }
                dispel.delete(dispel.length()-2, dispel.length());
                dispel.append(">");
            }
            else
            {
                dispel.append("PE(<");
                if (!desc.getInputs().isEmpty())
                {
                    for (ProcessingElementInputDescriptor input : desc.getInputs())
                    {
                        dispel.append("Connection ");
                        dispel.append(input.getName());
                        dispel.append("; ");
                    }
                    dispel.delete(dispel.length()-2, dispel.length());
                }
                dispel.append("> => <");
                if (!desc.getOutputs().isEmpty())
                {
                    for (ProcessingElementOutputDescriptor output : desc.getOutputs())
                    {
                        dispel.append("Connection ");
                        dispel.append(output.getName());
                        dispel.append("; ");
                    }
View Full Code Here


        for (RequestNode node : graph.getNodes())
        {
            if (node instanceof ProcessingElementNode)
            {
                ProcessingElementNode peNode = (ProcessingElementNode) node;
                ProcessingElementDescriptor descriptor =
                    peNode.getProcessingElementDescriptor();
               
                if (descriptor == null)
                {
                    throw new TransformationException(
                        "No processing element descriptor for PE : " +
                        peNode.getName());
                }
               
                for( ProcessingElementInputDescriptor inputDesc :
                     descriptor.getInputs())
                {
                    if (inputDesc.getIsDataSourceInput())
                    {
                        // We have an anchor (that keeps the soul)
                       
View Full Code Here

        ProcessingElementInputDescriptor inp = new ProcessingElementInputDescriptor("input");
        TupleSType t = new TupleSType();
        t.addElement("el1", new PrimitiveSType("String"));
        t.addElement("el2", new PrimitiveSType("Integer"));
        inp.setSType(t);
        ProcessingElementDescriptor desc =
            new SimpleProcessingElementDescriptor(
                    Arrays.asList(inp),
                    Collections.<ProcessingElementOutputDescriptor>emptyList(),
                    null);
        a.setDescriptor(desc);
View Full Code Here

        ProcessingElementNode b = new ProcessingElementNode("B");
        ProcessingElementInputDescriptor inp = new ProcessingElementInputDescriptor("input");
        TupleSType t = new TupleSType();
        t.addElement("a", new PrimitiveSType("String"));
        inp.setSType(t);
        ProcessingElementDescriptor desc =
            new SimpleProcessingElementDescriptor(
                    Arrays.asList(inp),
                    Collections.<ProcessingElementOutputDescriptor>emptyList(),
                    null);
        a.setDescriptor(desc);
View Full Code Here

//    peOutDescr2.setDType(dtypeOut2);

    outputs.add(peOutDescr1);
    outputs.add(peOutDescr2);

    ProcessingElementDescriptor descriptor = new SimpleProcessingElementDescriptor(
        peName, inputs, outputs);
    registry.registerProcessingElement(descriptor, "Function");
    // Assert.assertNotNull(registry.registerProcessingElement(descriptor,
    // ""));
  }
View Full Code Here

//    peOutDescr2.setDType(dtypeOut2);

    outputs.add(peOutDescr1);
//    outputs.add(peOutDescr2);

    ProcessingElementDescriptor descriptorLocal = new SimpleProcessingElementDescriptor(
        peName, inputs, outputs);
    registry.registerProcessingElement(descriptor, "PE");
    // Assert.assertNotNull(registry.registerProcessingElement(descriptor,
    // ""));
  }
View Full Code Here

    Assert.assertTrue(!peList.isEmpty());

    Iterator peIterator = peList.iterator();
    boolean exist = false;
    while (peIterator.hasNext()) {
      ProcessingElementDescriptor retrievedPE = (ProcessingElementDescriptor) peIterator
          .next();

      if (retrievedPE.getName().equals(descriptor.getName())) {
        List<String> retrievedInput = new ArrayList<String>();
        List<String> originalInput = new ArrayList<String>();

        List<String> retrievedOutput = new ArrayList<String>();
        List<String> originalOutput = new ArrayList<String>();

        // check inputs
        Assert
            .assertEquals(descriptor.getName(), retrievedPE
                .getName());
        for (ProcessingElementInputDescriptor input : retrievedPE
            .getInputs()) {
          retrievedInput.add(input.getName());
        }
        for (ProcessingElementInputDescriptor input : descriptor
            .getInputs()) {
          originalInput.add(input.getName());
        }
        Assert.assertTrue(originalInput.containsAll(retrievedInput));

        // check outputs
        for (ProcessingElementOutputDescriptor output : retrievedPE
            .getOutputs()) {
          retrievedOutput.add(output.getName());
        }
        for (ProcessingElementOutputDescriptor output : descriptor
            .getOutputs()) {
View Full Code Here

  @Override
  public List<ProcessingElementDescriptor> getProcessingElementMetadata(
      String processingElementName) {
    List<ProcessingElementDescriptor> listPE;
    listPE = new ArrayList<ProcessingElementDescriptor>();
    ProcessingElementDescriptor peDescriptor = new SimpleProcessingElementDescriptor(
        processingElementName, null, null, "");
    try {
      String SPARQLquery = "PREFIX dmi: <http://www.admire-project.eu/ontologies/CRISP-DMIOntology.owl#> "
          + "PREFIX platform: <http://www.admire-project.eu/ontologies/PlatformOntology.owl#> "
          + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
          + "PREFIX dcterms: <http://purl.org/dc/elements/1.1/> "
          + "SELECT ?p ?value "
          + "WHERE { ?pe dcterms:title \""
          + processingElementName
          + "\" . ?pe platform:hasStatus \"active\" . ?pe ?p ?value } ";

      RDFActivityApp mApp = new RDFActivityApp(mAddress);
      List<List<String>> results;
      results = new ArrayList<List<String>>();
      results = mApp.query(SPARQLquery);

      Map<String, String> metadataMap;
      metadataMap = new HashMap<String, String>();
      for (List<String> list : results) {
        // System.out.println(list);
        if (list.get(0).contains("hasRepositoryLocation")
            | list.get(0).contains("hasInput")
            | list.get(0).contains("hasOutput")
            | list.get(0).contains("hasStatus")
            | list.get(0).contains("22-rdf-syntax-ns#type")) {

        } else {
          metadataMap.put(list.get(0), list.get(1));
        }

      }
      peDescriptor.setMetadata(metadataMap);
      listPE.add(peDescriptor);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

          pesMetadata.put(keyList, metadataMap);
        }

      }
      for (List<String> keys : pesMetadata.keySet()) {
        ProcessingElementDescriptor peDescriptor = null;
        peDescriptor = new SimpleProcessingElementDescriptor(keys
            .get(1), null, null, keys.get(0));
        peDescriptor.setMetadata(metadataMap);
        listPE.add(peDescriptor);
      }

    } catch (Exception e) {
      // TODO Auto-generated catch block
View Full Code Here

      Parameter propertyValues = parameters.get(propertyName);
      inputElement.append(DELIMITER + "BEGIN_PROPERTY");
      inputElement.append(DELIMITER + "hasInput");
      inputElement.append(DELIMITER + "BEGIN_PROPERTY_VALUES");
      if (parameters.get(propertyName).getType() instanceof SimpleProcessingElementDescriptor) {
        ProcessingElementDescriptor peDescriptor = (SimpleProcessingElementDescriptor) parameters
            .get(propertyName).getType();
        List<ProcessingElementDescriptor> peList = registry
            .lookupProcessingElement(peDescriptor.getName());
        if (!peList.isEmpty()) {
          inputElement.append(DELIMITER + propertyName);
          inputElement.append(DELIMITER
              + peList.get(0).getProcessingElementId());
          inputElement.append(DELIMITER + propertyValues.getIndex());
View Full Code Here

TOP

Related Classes of eu.admire.registry.pe.ProcessingElementDescriptor

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.