Package org.apache.airavata.common.workflow.execution.context

Examples of org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder


            log.error(e.getMessage());
        } catch (AiravataAPIInvocationException e) {
            log.error(e.getMessage());
        }
      String submissionUser = workflowContext.getAttributeValue(new QName(workflowContext.getNamespace().getNamespaceURI(), "submissionUser"));
        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = new WorkflowContextHeaderBuilder(parse.getContextHeader());
        workflowContextHeaderBuilder.setSubmissionUser(submissionUser);
    return workflowContextHeaderBuilder;
    }
View Full Code Here


    }

    private void setup(WsdlDefinitions definitions) throws WorkflowException {

        // Set LEAD context header.
        WorkflowContextHeaderBuilder builder;
        if(contextHeader == null){
            builder = new WorkflowContextHeaderBuilder(this.notifier.getEventSink()
                .getAddress(), this.gfacURL, null, this.topic,
                "xbaya-experiment", this.messageBoxURL);
        }else{
             builder = new WorkflowContextHeaderBuilder(contextHeader);
        }
        if(builder.getWorkflowMonitoringContext() == null){
            builder.addWorkflowMonitoringContext(this.notifier.getEventSink().getAddress(),
                    this.topic,this.nodeID,this.messageBoxURL);
        } else {
            builder.getWorkflowMonitoringContext().setWorkflowInstanceId(this.notifier.getWorkflowID().toASCIIString());
        }
        builder.getWorkflowMonitoringContext().setWorkflowNodeId(this.nodeID);
        builder.getWorkflowMonitoringContext().setServiceInstanceId(this.nodeID);
        builder.getWorkflowMonitoringContext().setWorkflowTimeStep(1);
        builder.setUserIdentifier("xbaya-user");
        //todo write a UI component to collect this information and pass it through Header
//        builder.setGridMyProxyRepository("myproxy.nersc.gov","$user","$passwd",14000);
        StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-workflowcontext-header", builder.getXml());
        // Create Invoker
        this.invoker = InvokerFactory.createInvoker(this.portTypeQName, definitions, this.gfacURL, this.messageBoxURL,
                builder, true);
        this.invoker.setup();
View Full Code Here

  //------------------Deprecated Functions---------------------//
 
  public static WorkflowContextHeaderBuilder createWorkflowContextHeader()
      throws AiravataAPIInvocationException {
    try {
      return new WorkflowContextHeaderBuilder(null,
          null,null,null,null,null);
    } catch (Exception e) {
      throw new AiravataAPIInvocationException(e);
    }
  }
View Full Code Here

  //------------------End of Deprecated Functions---------------------//

  public static WorkflowContextHeaderBuilder createWorkflowContextHeaderBuilder(
      ExperimentAdvanceOptions options, String executionUser, String submissionUser)
      throws AiravataAPIInvocationException {
    WorkflowContextHeaderBuilder builder=createWorkflowContextHeader();
    builder.setUserIdentifier(executionUser);
    builder.setSubmissionUser(submissionUser);
    NodeSettings[] nodeSettingsList = options.getCustomWorkflowSchedulingSettings().getNodeSettingsList();
    for (NodeSettings nodeSettings : nodeSettingsList) {
      List<NameValuePairType> nameValuePairTypes = nodeSettings.getNameValuePair();
      for (NameValuePairType nameValuePairType : nameValuePairTypes) {
        builder.addApplicationSchedulingKeyPair(nodeSettings.getNodeId(),nameValuePairType.getName(), nameValuePairType.getValue(), nameValuePairType.getDescription());
      }
      builder.addApplicationSchedulingContext(nodeSettings.getNodeId(), nodeSettings.getServiceId(), nodeSettings.getHostSettings().getHostId(), nodeSettings.getHostSettings().isWSGRAMPreffered(), nodeSettings.getHostSettings().getGatekeeperEPR(), nodeSettings.getHPCSettings().getJobManager(), nodeSettings.getHPCSettings().getCPUCount(), nodeSettings.getHPCSettings().getNodeCount(), nodeSettings.getHPCSettings().getQueueName(), nodeSettings.getHPCSettings().getMaxWallTime());
   
    }
    OutputDataSettings[] outputDataSettingsList = options.getCustomWorkflowOutputDataSettings().getOutputDataSettingsList();
    for (OutputDataSettings outputDataSettings : outputDataSettingsList) {
      builder.addApplicationOutputDataHandling(outputDataSettings.getNodeId(),outputDataSettings.getOutputDataDirectory(), outputDataSettings.getDataRegistryUrl(), outputDataSettings.isDataPersistent());
    }

        if (options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId() != null) {
            builder.setAmazonWebServices(options.getCustomSecuritySettings().getAmazonWSSettings().getAccessKeyId(),
                    options.getCustomSecuritySettings().getAmazonWSSettings().getSecretAccessKey());
        }

        if (options.getCustomSecuritySettings().getCredentialStoreSecuritySettings() != null) {
            builder.setCredentialManagementService(options.getCustomSecuritySettings().
                    getCredentialStoreSecuritySettings().getTokenId(),
                    options.getCustomSecuritySettings().
                            getCredentialStoreSecuritySettings().getPortalUser(),
                    options.getCustomSecuritySettings().
                            getCredentialStoreSecuritySettings().getGatewayId());
View Full Code Here

          String submissionUser = getClient().getUserManager().getAiravataUser();
      String executionUser=options.getExperimentExecutionUser();
      if (executionUser==null){
        executionUser=submissionUser;
      }
      WorkflowContextHeaderBuilder builder = AiravataAPIUtils.createWorkflowContextHeaderBuilder(options, executionUser, submissionUser);
      runPreWorkflowExecutionTasks(experimentID, executionUser, options.getExperimentMetadata(), options.getExperimentName());
      NameValue[] inputVals = inputValues.toArray(new NameValue[] {});
      if (listener!=null){
        getExperimentMonitor(experimentID, listener).startMonitoring();
      }
View Full Code Here

  public static void main(String[] args) {
    ExecutionManagerImpl a = new ExecutionManagerImpl(null);
    try {
      ExperimentAdvanceOptions b = a.createExperimentAdvanceOptions();
      b.getCustomWorkflowOutputDataSettings().addNewOutputDataSettings("la", "di", "da", false);
      WorkflowContextHeaderBuilder c = AiravataAPIUtils.createWorkflowContextHeaderBuilder(b, "sheeeeeeeeeeee","meeee");
      System.out.println(XMLUtil.xmlElementToString(c.getXml()));
    } catch (AiravataAPIInvocationException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

     */

  public java.lang.String launchWorkflow(java.lang.String workflowAsString, java.lang.String topic, NameValue[] inputs) throws XMLStreamException {
        OMElement workflowContext = getWorkflowContextHeader();
        Map<String, String> configuration = new HashMap<String, String>();
        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = parseContextHeader(workflowContext, configuration);
        return setupAndLaunch(workflowAsString, topic,
                (String)configurationContext.getProperty(MYPROXY_USER),(String)configurationContext.getProperty(MYPROXY_PASS),inputs,configuration,runInThread,workflowContextHeaderBuilder);
  }
View Full Code Here

            configuration.put(GFAC, parse.getContextHeader().getSoaServiceEprs().getGfacUrl());
            configuration.put(MSGBOX, parse.getContextHeader().getWorkflowMonitoringContext().getMsgBoxEpr());
        } catch (XmlException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
        return new WorkflowContextHeaderBuilder(parse.getContextHeader());
    }
View Full Code Here

    }

    private void setup(WsdlDefinitions definitions) throws XBayaException {

        // Set LEAD context header.
        WorkflowContextHeaderBuilder builder;
        if(contextHeader == null){
            builder = new WorkflowContextHeaderBuilder(this.notifier.getEventSink()
                .getAddress(), this.gfacURL, null, this.topic,
                "xbaya-experiment", this.messageBoxURL);
        }else{
             builder = new WorkflowContextHeaderBuilder(contextHeader);
        }
        if(builder.getWorkflowMonitoringContext() == null){
            builder.addWorkflowMonitoringContext(this.notifier.getEventSink().getAddress(),
                    this.topic,this.nodeID,this.messageBoxURL);
        } else {
            builder.getWorkflowMonitoringContext().setWorkflowInstanceId(this.notifier.getWorkflowID().toASCIIString());
        }
        builder.getWorkflowMonitoringContext().setWorkflowNodeId(this.nodeID);
        builder.getWorkflowMonitoringContext().setServiceInstanceId(this.nodeID);
        builder.getWorkflowMonitoringContext().setWorkflowTimeStep(1);
        builder.setUserIdentifier("xbaya-user");
        //todo write a UI component to collect this information and pass it through Header
//        builder.setGridMyProxyRepository("myproxy.nersc.gov","fangliu","Jdas7wph",14000);
        StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-workflowcontext-header", builder.getXml());
        // Create Invoker
        this.invoker = InvokerFactory.createInvoker(this.portTypeQName, definitions, this.gfacURL, this.messageBoxURL,
                builder, true);
        this.invoker.setup();
View Full Code Here

                    }
                    XBayaConfiguration configuration = engine.getConfiguration();
                    String myProxyUsername = configuration.getRegistryUserName();
                    String myProxyPass = configuration.getRegistryPassphrase();
                    //todo we need to add the workflowContext header in the message
                    WorkflowContextHeaderBuilder builder = new WorkflowContextHeaderBuilder(configuration.getBrokerURL().toASCIIString(),
                            configuration.getGFacURL().toASCIIString(),configuration.getRegistryURL().toASCIIString(),configuration.getTopic()
                            ,null,configuration.getMessageBoxURL().toASCIIString());
                    stub._getServiceClient().addHeader(AXIOMUtil.stringToOM(XMLUtil.xmlElementToString(builder.getXml())));
                    stub.launchWorkflow(workflow.toXMLText(), topicString,inputNameVals);
                } catch (Exception e) {
                    WorkflowInterpreterLaunchWindow.this.engine.getErrorWindow().error(e);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder

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.