Package xsul.lead

Examples of xsul.lead.LeadContextHeader


        correlator = null;

        // pass some headers
        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");

        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc).addHandler(
                new StickySoapHeaderHandler("use-lead-header", leadContext))
                .useAsyncMessaging(correlator).setAsyncResponseTimeoutInMs(
                        33000L); // to simplify testing set to just few
View Full Code Here


        correlator = null;

        // pass some headers
        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");

        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc).addHandler(
                new StickySoapHeaderHandler("use-lead-header", leadContext))
                .useAsyncMessaging(correlator).setAsyncResponseTimeoutInMs(
                        33000L); // to simplify testing set to just few
View Full Code Here

    MonitorConfiguration monitorConfig = engine.getMonitor().getConfiguration();
    String TOPIC = "d25edf16-499c-4bb6-832f-b2b21d50fabe";
    monitorConfig.setTopic(TOPIC);
    leadContextHelper.setMonitorConfiguration(monitorConfig);

    LeadContextHeader leadContext = leadContextHelper
        .getLeadContextHeader();
   
    leadContext.setExperimentId(TOPIC);
   
    leadContext.setTimeStep("1");
    leadContext.setXRegistryUrl(new URI(XBayaConstants.DEFAULT_XREGISTRY_URL
        .toString()
        + "?wsdl"));
    MyProxyChecker myProxyChecker = new MyProxyChecker(engine);
    myProxyChecker.loadIfNecessary();
    GsiInvoker secureInvoker = null;
    if (engine.getWorkflowClient().isSecure()) {
      MyProxyClient myProxyClient = engine.getMyProxyClient();
      secureInvoker = new GsiInvoker(myProxyClient.getProxy(),
          XBayaSecurity.getTrustedCertificates());
     
      leadContext.setScmsUrl(URI.create("https://tyr12.cs.indiana.edu:60443/SCMS?wsdl"));

     
     
    }
    LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdlDefinitions, leadContext,null,
View Full Code Here

     * Constructs a LeadContextHeaderHelper.
     *
     */
    public LeadContextHeaderHelper() {
        // The default experiment and user will be will be overwritten.
        this.leadContextHeader = new LeadContextHeader(DEFAULT_EXPERIMENT, DEFAULT_USER);
    }
View Full Code Here

        LEADWorkflowInvoker invoker = null;
        try {

            WsdlDefinitions wsdl = workflow.getOdeInvokableWSDL(configuration.getDSCURL(), configuration.getODEURL());

            LeadContextHeader leadContext = XBayaUtil.buildLeadContextHeader(this.engine, monitorConfiguration,
                    StringUtil.convertToJavaIdentifier(engine.getGUI().getWorkflow().getName()), resourceMapping);
            // /////////////////////////////////////
            leadContext.setExperimentId(monitorConfiguration.getTopic());

            // ////////////////////////////////////////////////////////////

            URI messageBoxURL = null;
            if (monitorConfiguration.isPullMode()) {
                messageBoxURL = monitorConfiguration.getMessageBoxURL();
            }

            // create an invoker with LEAD Context
            GsiInvoker secureInvoker = null;
            if (this.engine.getWorkflowClient().isSecure()) {
                MyProxyClient myProxyClient = this.engine.getMyProxyClient();
                secureInvoker = new GsiInvoker(myProxyClient.getProxy(), XBayaSecurity.getTrustedCertificates());

                leadContext.setScmsUrl(URI.create("https://tyr12.cs.indiana.edu:60443/SCMS?wsdl"));

            }
            invoker = new LEADWorkflowInvoker(wsdl, leadContext, messageBoxURL, secureInvoker);
        } catch (ComponentException e) {
            if (this.canceled) {
View Full Code Here

            throws URISyntaxException {

        XBayaConfiguration configuration = engine.getConfiguration();
        Workflow workflow = engine.getGUI().getWorkflow();

        LeadContextHeader leadContext = buildLeadContextHeader(workflow, configuration, monitorConfiguration, nodeId,
                resourceMapping);

        return leadContext;

    }
View Full Code Here

        leadContextHelper.setWorkflowInstanceID(workflow.getGPELInstanceID());
        leadContextHelper.setWorkflowTemplateID(workflow.getUniqueWorkflowName());

        leadContextHelper.setMonitorConfiguration(monitorConfiguration);

        LeadContextHeader leadContext = leadContextHelper.getLeadContextHeader();

        leadContext.setNodeId(nodeId);

        leadContext.setTimeStep("1");
        // leadContext.setXRegistryUrl(new URI(configuration.getXRegistryURL().toString() + "?wsdl"));

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

    }
View Full Code Here

    final WSNode wsNode = (WSNode) node;
    String wsdlLocation = InterpreterUtil.getEPR(wsNode);
    final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
    if (null == wsdlLocation) {
      if (gfacURLString.startsWith("https")) {
        LeadContextHeader leadCtxHeader = null;
        // try {
        // leadCtxHeader =
        // (LeadContextHeader)getInputViaInteractor(WorkflowExecutionMessage.INPUT_LEAD_CONTEXT_HEADER,
        // wsNode);
        // } catch (Exception e1) {
        // throw new WorkflowException(e1);
        // }
        try {
          leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.getWorkflow(), this.getConfig().getConfiguration(), new MonitorConfiguration(this
              .getConfig().getConfiguration().getBrokerURL(), this.config.getTopic(), true, this.getConfig().getConfiguration()
              .getMessageBoxURL()), wsNode.getID(), null);
          // if (this.config.getMode() ==
          // WorkflowInterpreterConfiguration.GUI_MODE) {
          // leadCtxHeader = XBayaUtil.buildLeadContextHeader(
          // this.getWorkflow(),
          // this.getConfig().getConfiguration(),
          // new
          // MonitorConfiguration(this.getConfig().getConfiguration()
          // .getBrokerURL(), this.config.getTopic(), true,
          // this.getConfig().getConfiguration().getMessageBoxURL()),
          // wsNode.getID(), null);
          // } else {
          // leadCtxHeader = XBayaUtil.buildLeadContextHeader(
          // this.getWorkflow(),
          // this.getConfig().getConfiguration(),
          // new
          // MonitorConfiguration(this.getConfig().getConfiguration()
          // .getBrokerURL(), this.config.getTopic(), true,
          // this.getConfig().getConfiguration().getMessageBoxURL()),
          // wsNode.getID(), null);
          // }
        } catch (URISyntaxException e) {
          throw new WorkflowException(e);
        }

        leadCtxHeader.setServiceId(node.getID());
        try {
          leadCtxHeader.setWorkflowId(new URI(this.getWorkflow().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 WorkflowRuntimeException(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.config.getMonitor().getConfiguration().getMessageBoxURL()
            .toString(), leadCtxHeader, this.config.getNotifier().createServiceNotificationSender(node.getID()));
View Full Code Here

    Invoker invoker;
    String wsdlLocation = InterpreterUtil.getEPR((WSNode) foreachWSNode);
    QName portTypeQName = wsComponent.getPortTypeQName();
    if (null == wsdlLocation) {
      if (gfacURLString.startsWith("https")) {
        LeadContextHeader leadCtxHeader = null;
        try {
          leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.getWorkflow(), this.getConfig().getConfiguration(), new MonitorConfiguration(this
              .getConfig().getConfiguration().getBrokerURL(), this.config.getTopic(), true, this.getConfig().getConfiguration()
              .getMessageBoxURL()), foreachWSNode.getID(), null);
          // if (this.config.getMode() ==
View Full Code Here

     * Constructs a LeadContextHeaderHelper.
     *
     */
    public LeadContextHeaderHelper() {
        // The default experiment and user will be will be overwritten.
        this.leadContextHeader = new LeadContextHeader(DEFAULT_EXPERIMENT, DEFAULT_USER);
    }
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.