Package org.apache.airavata.client.api

Examples of org.apache.airavata.client.api.AiravataAPI


        registryURL = "http://" + serverUrl + ":" + port + "/" + serverContextName + "/api";

        log("Configurations - Registry URL : " + registryURL);

        PasswordCallback passwordCallback = new PasswordCallbackImpl();
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                passwordCallback);

        checkServerStartup(airavataAPI);

        log("Server successfully started .............................");
View Full Code Here


        }
    }

    protected void runWorkFlow(Workflow workflow, List<String> inputValues) throws Exception {

        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        List<WorkflowInput> workflowInputs = setupInputs(workflow, inputValues);
        String workflowName = workflow.getName();
        ExperimentAdvanceOptions options = airavataAPI.getExecutionManager().createExperimentAdvanceOptions(
                workflowName, getUserName(), null);

        options.getCustomSecuritySettings().getCredentialStoreSecuritySettings().setTokenId("1234");

        String experimentId = airavataAPI.getExecutionManager().runExperiment(workflowName, workflowInputs, options);

        Assert.assertNotNull(experimentId);

        log.info("Run workflow completed ....");
        log.info("Starting monitoring ....");
View Full Code Here

        monitor(experimentId);
    }

    protected void runWorkFlowWithoutMonitor(Workflow workflow, List<String> inputValues) throws Exception {

        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        List<WorkflowInput> workflowInputs = setupInputs(workflow, inputValues);
        String workflowName = workflow.getName();
        ExperimentAdvanceOptions options = airavataAPI.getExecutionManager().createExperimentAdvanceOptions(
                workflowName, getUserName(), null);
        String experimentId = airavataAPI.getExecutionManager().runExperiment(workflowName, workflowInputs, options,
                new EventDataListenerAdapter() {
                    public void notify(EventDataRepository eventDataRepo, EventData eventData) {
                        // do nothing
                    }
                });

        Assert.assertNotNull(experimentId);
        airavataAPI.getExecutionManager().waitForExperimentTermination(experimentId);

        log.info("Run workflow completed ....");

        verifyOutput(experimentId, "echo_output=Airavata_Test");

        log.info("Verifying application jobs ....");
        List<ApplicationJob> applicationJobs = airavataAPI.getProvenanceManager().getApplicationJobs(experimentId, null, null);
        Assert.assertEquals(applicationJobs.size(), 1);
    }
View Full Code Here

        List<ApplicationJob> applicationJobs = airavataAPI.getProvenanceManager().getApplicationJobs(experimentId, null, null);
        Assert.assertEquals(applicationJobs.size(), 1);
    }

    protected void verifyOutput(String experimentId, String outputVerifyingString) throws Exception {
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        log.info("Experiment ID Returned : " + experimentId);

        ExperimentData experimentData = airavataAPI.getProvenanceManager().getExperimentData(experimentId);

        log.info("Verifying output ...");

        List<WorkflowExecutionDataImpl> workflowInstanceData = experimentData.getWorkflowExecutionDataList();
View Full Code Here

            }
        }
    }

    private List<WorkflowInput> setupInputs(Workflow workflow, List<String> inputValues) throws Exception {
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        List<WorkflowInput> workflowInputs = airavataAPI.getWorkflowManager().getWorkflowInputs(workflow.getName());

        Assert.assertEquals(workflowInputs.size(), inputValues.size());

        int i = 0;
        for (String valueString : inputValues) {
View Full Code Here

        log.debug("Workflow compose - " + buffer.toString());
        return buffer.toString();
    }

    public void monitor(final String experimentId) throws Exception {
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(new URI(getRegistryURL()), getGatewayName(), getUserName(),
                new PasswordCallbackImpl());
        final Monitor experimentMonitor = airavataAPI.getExecutionManager().getExperimentMonitor(experimentId,
                new EventDataListenerAdapter() {

                    public void notify(EventDataRepository eventDataRepo, EventData eventData) {
                        Assert.assertNotNull(eventDataRepo);
                        Assert.assertNotNull(eventData);
View Full Code Here

  public static WorkflowContextHeaderBuilder getBuilder() {
         return builder;
  }

   public static void main(String[] args) throws Exception {
    AiravataAPI api = AiravataClientUtils.getAPI(new URI("http://localhost:8080"), "admin", "admin");
    Workflow w = api.getWorkflowManager().getWorkflow("Workflow1");
    List<WorkflowInput> workflowInputs = w.getWorkflowInputs();
    for (WorkflowInput input : workflowInputs) {
      input.setValue("0");
    }
    System.out.println(api.getExecutionManager().runExperiment(w,workflowInputs));
//     ProvenanceManager pm = api.getProvenanceManager();
//     ExperimentData workflowExperimentData = pm.getWorkflowExperimentData("Workflow1_9341caee-b3fc-4474-9b15-b943756a5839");
    
//     pm.getExperimentIdList(owner)
//     workflowInstanceData = d.getWorkflowInstanceData().get(0).getNodeDataList();
View Full Code Here

                    runner = new PredicatedTaskRunner(provenanceWriterThreadPoolSize);
                    try {
                            List<HostDescription> hostList = getDefinedHostDescriptions();
                            for(HostDescription host:hostList){
                                // This will avoid the changes user is doing to one of the predefined Hosts during a restart of the system
                                AiravataAPI registry = getAiravataAPI();
                if(!registry.getApplicationManager().isHostDescriptorExists(host.getType().getHostName())){
                                    log.debug("Saving the predefined Host: " + host.getType().getHostName());
                                    registry.getApplicationManager().addHostDescription(host);
                                }
                            }
                    } catch (DescriptorAlreadyExistsException e) {
                            e.printStackTrace();
                        } catch (AiravataAPIInvocationException e) {
View Full Code Here

        } catch (URISyntaxException e1) {
            throw new WorkflowRuntimeException(e1);
        }
        WorkflowInterpretorEventListener listener = null;
        WorkflowInterpreter interpreter = null;
        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gatewayId, username);
    WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,topic,conf.getMessageBoxURL(), conf.getBrokerURL(), airavataAPI, conf, null, null);
        workflowInterpreterConfiguration.setGfacEmbeddedMode(gfacEmbeddedMode);
        workflowInterpreterConfiguration.setActOnProvenance(provenance);

        if (builder.getSecurityContext().getAmazonWebservices() != null) {
View Full Code Here

  }

    public void shutDown(ConfigurationContext configctx, AxisService service) {
        URI gfacURL = (URI) configctx.getProperty(SERVICE_URL);
        if (getAiravataAPI() != null && thread != null) {
            AiravataAPI registry = getAiravataAPI();
            try {
                registry.getAiravataManager().removeWorkflowInterpreterURI(gfacURL);
            } catch (AiravataAPIInvocationException e) {
                e.printStackTrace();
            }
            thread.interrupt();
            try {
View Full Code Here

TOP

Related Classes of org.apache.airavata.client.api.AiravataAPI

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.