Package xsul.lead

Examples of xsul.lead.LeadContextHeader


            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()));
         
View Full Code Here


            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
View Full Code Here

    MonitorConfiguration monitorConfiguration = new MonitorConfiguration(
        XBayaConstants.DEFAULT_BROKER_URL, topic, true,
        XBayaConstants.DEFAULT_MESSAGE_BOX_URL);
    leadContextHelper.setMonitorConfiguration(monitorConfiguration);

    LeadContextHeader leadContext = leadContextHelper
        .getLeadContextHeader();

    leadContext.setNodeId(workflow.getName());

    leadContext.setTimeStep("1");
    try {
      leadContext.setXRegistryUrl(new URI(
          XBayaConstants.DEFAULT_XREGISTRY_URL.toString() + "?wsdl"));
    } catch (URISyntaxException e) {
      throw new XBayaRuntimeException(e);
    }

    if (resourceMapping != null) {
      leadContext.setResourceMapping(resourceMapping);
    }
    if (scmsURL != null) {
      leadContext.setScmsUrl(scmsURL);
    }

    return leadContext;

  }
View Full Code Here

    OperationResponseDocument res = stub.createExperiments(experimentDoc);
    return res;
  }

  private AgentPortType createStub(String dn, String wsdlLoc) {
    LeadContextHeader leadContextHeader = new LeadContextHeader("NEI", dn);
    leadContextHeader.setUserDn(dn);
    StickySoapHeaderHandler soapHeaderHandler = new StickySoapHeaderHandler(
        "use-lead-header", leadContextHeader);

    WSIFClient wcl = XmlBeansWSIFRuntime.newClient(wsdlLoc);
    wcl.addHandler(soapHeaderHandler);
View Full Code Here

      WSIFAsyncResponsesCorrelator correlator;
      correlator = null;

      // pass some headers
      LeadContextHeader leadContext = getLeadContextHeader();
      // URI uri = new File("/u/cherath/Desktop/WEPSService.xml").toURI();
      // WSIFClient wclient = WSIFRuntime.newClient(uri.toString())
      // .addHandler(
      // new StickySoapHeaderHandler("use-lead-header",
      // leadContext)).useAsyncMessaging(correlator)
View Full Code Here

      WSIFAsyncResponsesCorrelator correlator;
      correlator = null;

      // pass some headers
      LeadContextHeader leadContext = getLeadContextHeader();

      WSIFClient wclient = WSIFRuntime.newClient(engineURL.toString())
          .addHandler(
              new StickySoapHeaderHandler("use-lead-header",
                  leadContext)).useAsyncMessaging(correlator)
View Full Code Here

  }

  private LeadContextHeader getLeadContextHeader() {
    LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
    helper.setXBayaConfiguration(new XBayaConfiguration());
    LeadContextHeader leadContext = helper.getLeadContextHeader();
    leadContext.setWorkflowId(URI
        .create("http://host/2005/11/09/workflowinstace"));
    leadContext.setNodeId("decoder1");
    leadContext.setTimeStep("5");
    leadContext.setServiceId("decoder-instance-10");
    return leadContext;
  }
View Full Code Here

            leadContextHelper.setMyLeadConfiguration(this.engine.getMyLead()
                    .getConfiguration());
            leadContextHelper.setWorkflow(workflow);
            leadContextHelper.setMonitorConfiguration(monitorConfiguration);

            LeadContextHeader leadContext = leadContextHelper
                    .getLeadContextHeader();

            URI messageBoxURL = null;
            if (monitorConfiguration.isPullMode()) {
                messageBoxURL = monitorConfiguration.getMessageBoxURL();
View Full Code Here

   * @throws URISyntaxException
   */
  public static LeadContextHeader getLeadContextHeader(String topic,
      Workflow workflow, GSSCredential proxy, GcInstance instance)
      throws GSSException, URISyntaxException {
    LeadContextHeader leadContextHeader = new LeadContextHeader(topic,
        proxy.getName().toString());

    leadContextHeader.setXRegistryUrl(new URI(
        XBayaConstants.DEFAULT_XREGISTRY_URL.toString()+"?wsdl"));
    leadContextHeader.setGfacUrl(new URI(XBayaConstants.DEFAULT_GFAC_URL.toString()+"?wsdl"));
    leadContextHeader.setDscUrl(new URI("https://tyr09.cs.indiana.edu:25443/"));
    // The followings might overwrite some variables.
    leadContextHeader.setWorkflowTemplateId(new URI(workflow
        .getGPELTemplateID().toString()));
    leadContextHeader.setWorkflowInstanceId(new URI(instance
        .getInstanceId().toString()));
    leadContextHeader.setUserDn(proxy.getName().toString());
    leadContextHeader
        .setMyleadAgentUrl(new URI(XBayaConstants.DEFAULT_MYLEAD_AGENT_URL.toString()+"?wsdl"));
    WsaEndpointReference eventSink = WseClientAPI
        .createEndpointReference(XBayaConstants.DEFAULT_BROKER_URL
            .toString(), topic);
    leadContextHeader.setEventSink(eventSink);
    return leadContextHeader;
  }
View Full Code Here

      myleadAgentUrl = context.getMyleadAgentUrl();
    } catch (Exception e) {
      log.error("Error fetching properties", e);
    }
   
        LeadContextHeader lh = new LeadContextHeader(workflow.getExperimentID(), workflow.getUserID());

        URI sinkLocation = URI.create(notifBrokerUrl + "topic/" + workflow.getNotificatonTopic());
        WsaEndpointReference eventSinkReference = new WsaEndpointReference(sinkLocation);
        lh.setEventSink(eventSinkReference);

        lh.setGfacUrl(URI.create(gfacFactoryUrl));
        lh.setMyleadAgentUrl(URI.create(myleadAgentUrl));

        if (xRegistryUrl != null) {
            lh.setXRegistryUrl(URI.create(xRegistryUrl));
        }

        lh.setUserDn(workflow.getUserID());
        lh.setExperimentId(workflow.getExperimentID());
        lh.setDscUrl(URI.create(dscUrl));

        //FIXME Create an instance id and add it.
//        if (workflow.getInstance() != null) {
//            lh.setWorkflowId(workflow.getInstance().getId());
//        }
View Full Code Here

TOP

Related Classes of xsul.lead.LeadContextHeader

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.