Examples of WSComponent


Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

      new WorkflowInterpreter(this.configuration, this.topic, subWorkflow, this.username, this.password).scheduleDynamically();
    }
  }

  private void handleWSComponent(Node node) throws XBayaException {
    WSComponent wsComponent = ((WSComponent) node.getComponent());
    QName portTypeQName = wsComponent.getPortTypeQName();
    WorkflowInvoker invoker = this.invokerMap.get(node);
    if (invoker == null) {
      final WSNode wsNode = (WSNode) node;
      String wsdlLocation = this.getEPR(wsNode);
      final String gfacURLString = this.configuration.getGFacURL().toString();
      if (null == wsdlLocation) {
        if (gfacURLString.startsWith("https")) {
          GSSCredential proxy = null;
          if (this.mode == GUI_MODE) {
            this.myProxyChecker.loadIfNecessary();
            MyProxyClient myProxyClient = this.engine.getMyProxyClient();
            proxy = myProxyClient.getProxy();
          } else {
            proxy = SecurityUtil.getGSSCredential(this.username, this.password, this.configuration.getMyProxyServer());
          }

          LeadContextHeader leadCtxHeader = null;
          try {
            if (this.mode == GUI_MODE) {
              leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration, this.engine.getMyLead(), new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true, this.configuration.getMessageBoxURL()), wsNode.getID(), null);
            } else {
              leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration,
              // Set the userdn in the right proxy if necessary
                  new MyLead(new MyLeadConfiguration(), proxy), new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true, this.configuration.getMessageBoxURL()), wsNode.getID(), null);
            }
          } catch (URISyntaxException e) {
            throw new XBayaException(e);
          }

          leadCtxHeader.setServiceId(node.getID());
          try {
            leadCtxHeader.setWorkflowId(new URI(this.workflow.getName()));

            // We do this so that the wsdl resolver can is setup
            // wsdlresolver.getInstance is static so once this is
            // done
            // rest of the loading should work.

            XBayaSecurity.init();

          } catch (URISyntaxException e) {
            throw new XBayaRuntimeException(e);
          }
         
          /*
           * Resource Mapping Header
           */
          if(this.resourceMapping != null){
            leadCtxHeader.setResourceMapping(this.resourceMapping);
          }
         
          /*
           * If there is a instance control component connects to this component
           * send information in soap header
           */
          for (Node n : wsNode.getControlInPort().getFromNodes()) {
            if (n instanceof InstanceNode){
              //TODO make it as constant
              LeadResourceMapping x = new LeadResourceMapping("AMAZON");
             
              x.addAttribute("ACCESS_KEY", AmazonCredential.getInstance().getAwsAccessKeyId());
              x.addAttribute("SECRET_KEY", AmazonCredential.getInstance().getAwsSecretAccessKey());             
                           
              if(((InstanceNode) n).isStartNewInstance()){
                x.addAttribute("AMI_ID", ((InstanceNode) n).getIdAsValue());
                x.addAttribute("INS_TYPE", ((InstanceNode) n).getInstanceType());               
              }else{
                x.addAttribute("INS_ID", ((InstanceNode) n).getIdAsValue());
              }
             
              x.addAttribute("USERNAME", ((InstanceNode) n).getUsername());
             
              //set to leadHeader
              leadCtxHeader.setResourceMapping(x);
            }           
          }

          invoker = new WorkflowInvokerWrapperForGFacInvoker(portTypeQName, gfacURLString, this.configuration.getMessageBoxURL().toString(), leadCtxHeader, this.notifier.createServiceNotificationSender(node.getID()));
         
        } else {
          invoker = new GenericInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), node.getID(), this.configuration.getMessageBoxURL().toString(), gfacURLString, this.notifier, this.configuration, null);
        }

      } else {
        if (!wsdlLocation.endsWith("?wsdl")) {
          wsdlLocation += "?wsdl";
        }
        invoker = new GenericInvoker(portTypeQName, wsdlLocation, node.getID(), this.configuration.getMessageBoxURL().toString(), gfacURLString, this.notifier);
      }
      invoker.setup();
      this.invokerMap.put(node, invoker);
      invoker.setOperation(wsComponent.getOperationName());
    }

    // find inputs
    List<DataPort> inputPorts = node.getInputPorts();
    ODEClient odeClient = new ODEClient();
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

    node.getGUI().setBodyColor(NodeState.FINISHED.color);
  }

  private void runInThread(LinkedList<String> listOfValues, ForEachNode forEachNode, WSNode foreachWSNode, EndForEachNode endForEachNode, SystemComponentInvoker tempInvoker) throws XBayaException {
    WSComponent wsComponent = foreachWSNode.getComponent();
    QName portTypeQName = wsComponent.getPortTypeQName();

    WorkflowInvoker invoker = null;
    LinkedList<WorkflowInvoker> invokerList = new LinkedList<WorkflowInvoker>();
    for (Iterator<String> iterator = listOfValues.iterator(); iterator.hasNext();) {
      String input = iterator.next();
      String wsdlLocation = getEPR(foreachWSNode);
      final String gfacURLString = this.engine.getConfiguration().getGFacURL().toString();
      if (null == wsdlLocation) {
        if (gfacURLString.startsWith("https")) {
          GSSCredential proxy = null;
          if (this.mode == GUI_MODE) {
            this.myProxyChecker.loadIfNecessary();
            MyProxyClient myProxyClient = this.engine.getMyProxyClient();
            proxy = myProxyClient.getProxy();
          } else {
            proxy = SecurityUtil.getGSSCredential(this.username, this.password, this.configuration.getMyProxyServer());
          }
          GsiInvoker secureInvoker = new GsiInvoker(proxy, XBayaSecurity.getTrustedCertificates());
          LeadContextHeader leadCtxHeader = null;
          try {
            // leadCtxHeader = WSDLUtil.buildLeadContextHeader(
            // this.workflow, engine.getConfiguration(),
            // this.engine.getMyLead(), engine.getMonitor()
            // .getConfiguration(), foreachWSNode
            // .getID(), null);

            if (this.mode == GUI_MODE) {
              leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration, this.engine.getMyLead(), new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true, this.configuration.getMessageBoxURL()), foreachWSNode.getID(), null);
            } else {
              leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration,
              // //////////Set the userdn in
              // the right proxy if necessary
                  new MyLead(new MyLeadConfiguration(), proxy), new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true, this.configuration.getMessageBoxURL()), foreachWSNode.getID(), null);
            }

          } catch (URISyntaxException e) {
            raiseException(e);
          }
          // SecureGFacInvoker secureGFacInvoker = new
          // SecureGFacInvoker(portTypeQName,
          // WSDLUtil.wsdlDefinitions5ToWsdlDefintions3
          // (wsNode.getComponent().getWSDL()), node
          // .getID(), gfacURLString, notifier, secureInvoker,
          // leadCtxHeader, wsComponent.getOperationName());
          SecureGFacInvoker secureGFacInvoker = new SecureGFacInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(foreachWSNode.getComponent().getWSDL()), foreachWSNode.getID(), gfacURLString, this.notifier, secureInvoker, leadCtxHeader, wsComponent.getOperationName());
          invoker = secureGFacInvoker;
        } else {
          invoker = new GenericInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(foreachWSNode.getComponent().getWSDL()), foreachWSNode.getID(), this.configuration.getMessageBoxURL().toString(), gfacURLString, this.notifier);
        }

      } else {
        if (!wsdlLocation.endsWith("?wsdl")) {
          wsdlLocation += "?wsdl";
        }
        invoker = new GenericInvoker(portTypeQName, wsdlLocation, foreachWSNode.getID(), this.configuration.getMessageBoxURL().toString(), gfacURLString, this.notifier);
      }
      invoker.setup();
      invoker.setOperation(wsComponent.getOperationName());
      invokerList.add(invoker);
      // find inputs
      List<DataPort> inputPorts = foreachWSNode.getInputPorts();
      for (DataPort port : inputPorts) {       
        Object inputVal = findInputFromPort(port);
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

      arguments.add(notifConfig.getMessageBoxURL().toString());
    }

    try {
      for (WSNode node : GraphUtil.getWSNodes(this.workflow.getGraph())) {
        WSComponent component = node.getComponent();
        QName portTypeQName = component.getPortTypeQName();
        WsdlDefinitions wsdl = component.getWSDL();

        File file = File.createTempFile(
            ".xbaya-" + portTypeQName.getLocalPart(),
            XBayaConstants.WSDL_SUFFIX);
        this.tmpWSDLFiles.add(file);
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

        int index = this.treeModel.getIndexOfChild(parent, selectedNode);
        this.treeModel.removeNodeFromParent(selectedNode);
        this.treeModel.insertNodeInto(newNode, parent, index);

        for (Component component : components) {
            WSComponent wsComponent = (WSComponent) component;
            String operationName = wsComponent.getOperationName();
            ComponentOperationReference reference = new ComponentOperationReference(
                    operationName, wsComponent);
            ComponentTreeNode child = new ComponentTreeNode(reference);
            this.treeModel.addNodeInto(child, newNode);
        }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

          + node.getName() + "is invalid:"
          + node.getOutputPorts().size());
    }
    DataPort outputPort = node.getOutputPort(0);

    WSComponent component = node.getComponent();
    String inputPartName = component.getInputPartName();
    String inputTypeName = component.getInputTypeName();

    XmlElement complexType = extensions.addElement(scuflNS, "complextype");
    complexType.addAttribute("optional", "false");
    complexType.addAttribute("unbounded", "false");
    complexType.addAttribute("typename", inputTypeName);

    String spliterName = inputPartName;
    complexType.addAttribute("name", spliterName);
    complexType.addAttribute("qname", inputName.toString());
   
   
    XmlElement element = complexType.addElement(scuflNS, "elements");
    for (DataPort port : inputPorts) {
      if ("http://www.w3.org/2001/XMLSchema".equals(port.getType()
          .getNamespaceURI())) {
        XmlElement baseType = element.addElement(scuflNS, "basetype");
        baseType.addAttribute("optional", "false");
        baseType.addAttribute("unbounded", "false");
        baseType
            .addAttribute("typename", port.getType().getLocalPart());
        baseType.addAttribute("name", port.getName());
        baseType.addAttribute("qname", inputTypeName + "&gt;"
            + port.getName());

       
      }
      // all the sources are written here
      // the links from input nodes to the spiters are done here
      // links from the from node output splitter to the this service's
      // inputsplitter is done here

      if (port.getFromNode() instanceof InputNode) {
        XmlElement source = builder.newFragment(scuflNS, "source");
        source.addAttribute("name", port.getFromNode().getID());
        if (!sourceExist(port.getFromNode().getID())) {
          this.sources.put(port.getFromNode().getID(), source);
        }
        XmlElement link = builder.newFragment(scuflNS, "link");
        link.addAttribute("source", port.getFromNode().getID());
        link.addAttribute("sink", getValidName(node)
            + "InputMessagePartXML:" + port.getName());
        this.links.add(link);

      } else if (port.getFromNode() instanceof WSNode) {
        XmlElement link = builder.newFragment(scuflNS, "link");
        if (port.getFromNode().getOutputPorts().size() != 1) {
          throw new GraphException(
              "Number of out ports in from WS node "
                  + port.getFromNode().getName()
                  + "is invalid:"
                  + node.getOutputPorts().size());
        }
        link.addAttribute("source", getValidName((WSNode) port
            .getFromNode())
            + "OutputMessagePartXML:"
            + port.getFromNode().getOutputPort(0).getName());
        link.addAttribute("sink", getValidName(node)
            + "InputMessagePartXML:" + port.getName());
        this.links.add(link);
      } else {
        throw new GraphException("Unhandled from node type:"
            + port.getFromNode() + " for node" + node.getName());
      }
    }

    // link from the spliter to the service

    XmlElement link = builder.newFragment(scuflNS, "link");
    link.addAttribute("source", getValidName(node)
        + "InputMessagePartXML:output");
    link.addAttribute("sink", getValidName(node) + ":" + spliterName);
    this.links.add(link);

    // link from service out to the ouput spliter

    link = builder.newFragment(scuflNS, "link");
    link.addAttribute("source", getValidName(node) + ":"
        + node.getComponent().getOutputPartName());
    link.addAttribute("sink", getValidName(node)
        + "OutputMessagePartXML:input");
    this.links.add(link);

    // /outspiltor
    XmlElement outProcessor = scufl.addElement(scuflNS, "processor");
    outProcessor.addAttribute("name", getValidName(node)
        + "OutputMessagePartXML");
    XmlElement outLocal = outProcessor.addElement(scuflNS, "local");
    outLocal.addChild(0,
        "org.embl.ebi.escience.scuflworkers.java.XMLOutputSplitter");
    XmlElement outExtensions = outLocal.addElement(scuflNS, "extensions");
    XmlElement outComplextype = outExtensions.addElement(scuflNS,
        "complextype");
    outComplextype.addAttribute("optional", "false");
    outComplextype.addAttribute("unbounded", "false");
    outComplextype.addAttribute("typename", component.getOutputTypeName());
    outComplextype.addAttribute("name", component.getOutputPartName());
    QName outputName = getOutputElementName(node);
    if (null == outputName) {
      throw new GraphException("No Valid output type found for WS Node"
          + node.getName());
    }
    outComplextype.addAttribute("qname", outputName.toString());
    XmlElement elements = outComplextype.addElement(scuflNS, "elements");
    XmlElement outBaseType = elements.addElement(scuflNS, "basetype");
    outBaseType.addAttribute("optional", "false");
    outBaseType.addAttribute("unbounded", "false");

    outBaseType.addAttribute("typename", outputPort.getType()
        .getLocalPart());
    String Z = component.getOutputPort(0).getName();
    outBaseType.addAttribute("name", Z);
   
    outBaseType.addAttribute("qname", component.getOutputTypeName()
        + "&gt;" +Z);

   

    List<DataPort> outputPorts = node.getOutputPorts();
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

   * @param node
   * @return
   * @throws GraphException
   */
  private QName getInputElementName(WSNode node) throws GraphException {
    WSComponent component = node.getComponent();
    String portTypeName = component.getPortTypeQName().getLocalPart();
    WsdlPortType portType = component.getWSDL().getPortType(portTypeName);
    WsdlPortTypeOperation operation = portType.getOperation(component
        .getOperationName());
    QName message = operation.getInput().getMessage();
    WsdlMessage wsdlMessage = component.getWSDL().getMessage(
        message.getLocalPart());
    Iterator<WsdlMessagePart> iterator = wsdlMessage.parts().iterator();
    QName inputName = null;
    if (iterator.hasNext()) {
      inputName = iterator.next().getElement();
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

    }
    return inputName;
  }

  private QName getOutputElementName(WSNode node) throws GraphException {
    WSComponent component = node.getComponent();
    String portTypeName = component.getPortTypeQName().getLocalPart();
    WsdlPortType portType = component.getWSDL().getPortType(portTypeName);
    WsdlPortTypeOperation operation = portType.getOperation(component
        .getOperationName());
    QName message = operation.getOutput().getMessage();
    WsdlMessage wsdlMessage = component.getWSDL().getMessage(
        message.getLocalPart());
    Iterator<WsdlMessagePart> iterator = wsdlMessage.parts().iterator();
    QName inputName = null;
    if (iterator.hasNext()) {
      inputName = iterator.next().getElement();
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

    // create a new tab
    GraphCanvas canvas = this.engine.getGUI().newGraphCanvas(true);

    // we can call with null because WSDL is already accessed at this point
    WSComponent workflowComponent = new StreamReceiveComponent(oldWorkflow
        .getOdeInvokableWSDL(null, null));
    Node workflowNode = canvas.addNode(workflowComponent, new Point(600,
        100));
    //
    this.engine.getWorkflow().getWSDLs().put(
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

     */
    @Override
    public List<WSComponent> getComponents() throws ComponentRegistryException,
            ComponentException {
        if (this.components == null) {
            WSComponent component = this.registry.getComponent(this.result
                    .getId());
            this.components = Collections.singletonList(component);
        }
        return this.components;
    }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.component.ws.WSComponent

            if (originalFromNode instanceof InputNode) {
                // notification that includes the input of the workflow.
                output = getWorkflowInput(fromNodeID);
            } else if (originalFromNode instanceof WSNode) {
                // Retrieve input value from notification.
                WSComponent component = ((WSNode) originalFromNode)
                        .getComponent();
                String messageName = component.getOutputTypeName();
                String parameterName = originalFromPort.getComponentPort()
                        .getName();
                output = getOutput(fromNodeID, messageName, parameterName);
            } else {
                // This should not happen.
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.