Package org.apache.airavata.commons.gfac.type

Examples of org.apache.airavata.commons.gfac.type.ServiceDescription


  protected abstract ApplicationDescription getApplicationDesc(
      JobTypeType jobType);

  protected ServiceDescription getServiceDesc(String serviceName) {
    ServiceDescription serv = new ServiceDescription();
    serv.getType().setName(serviceName);
    return serv;
  }
View Full Code Here



        /*
        * Service
        */
        ServiceDescription serv = new ServiceDescription();
        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();

        serv.getType().setName(serviceName);
        serv.getType().setDescription(serviceName);

        //Creating input parameters
        InputParameterType parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("molecule_id");
        ParameterType parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.STRING);
        parameterType.setName("String");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("geom_mol2");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.URI);
        parameterType.setName("URI");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("toppar_main_tgz");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.URI);
        parameterType.setName("URI");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("toppar_usr_tgz");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.URI);
        parameterType.setName("URI");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("toppar_mol_str");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.URI);
        parameterType.setName("URI");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("molecule_dir_in_tgz");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.URI);
        parameterType.setName("URI");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("GC_UserName");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.STRING);
        parameterType.setName("String");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("GC_ProjectName");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.STRING);
        parameterType.setName("String");
        inputParameters.add(parameter);

        parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("GC_WorkflowName");
        parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.STRING);
        parameterType.setName("String");
        inputParameters.add(parameter);

        //Creating output parameters
        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
        outputParameter.setParameterName("opt_freq_input_gjf");
        ParameterType outputParaType = outputParameter.addNewParameterType();
        outputParaType.setType(DataType.URI);
        outputParaType.setName("URI");
        outputParameters.add(outputParameter);

        outputParameter = OutputParameterType.Factory.newInstance();
        outputParameter.setParameterName("charmm_miminized_crd");
        outputParaType = outputParameter.addNewParameterType();
        outputParaType.setType(DataType.URI);
        outputParaType.setName("URI");
        outputParameters.add(outputParameter);

        outputParameter = OutputParameterType.Factory.newInstance();
        outputParameter.setParameterName("step1_log");
        outputParaType = outputParameter.addNewParameterType();
        outputParaType.setType(DataType.URI);
        outputParaType.setName("URI");
        outputParameters.add(outputParameter);

        outputParameter = OutputParameterType.Factory.newInstance();
        outputParameter.setParameterName("molecule_dir_out_tgz");
        outputParaType = outputParameter.addNewParameterType();
        outputParaType.setType(DataType.URI);
        outputParaType.setName("URI");
        outputParameters.add(outputParameter);

        outputParameter = OutputParameterType.Factory.newInstance();
        outputParameter.setParameterName("gcvars");
        outputParaType = outputParameter.addNewParameterType();
        outputParaType.setType(DataType.URI);
        outputParaType.setName("URI");
        outputParameters.add(outputParameter);

        //Setting input and output parameters to serviceDescriptor
        serv.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
        serv.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));

        jobExecutionContext = new JobExecutionContext(gFacConfiguration,serv.getType().getName());
        jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
        ApplicationContext applicationContext = new ApplicationContext();
        applicationContext.setHostDescription(host);
        applicationContext.setApplicationDeploymentDescription(appDesc);
        jobExecutionContext.setApplicationContext(applicationContext);
View Full Code Here


        /*
           * Service
           */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("SimpleEcho");

        List<InputParameterType> inputList = new ArrayList<InputParameterType>();

        InputParameterType input = InputParameterType.Factory.newInstance();
        input.setParameterName("echo_input");
        input.setParameterType(StringParameterType.Factory.newInstance());
        inputList.add(input);

        InputParameterType input1 = InputParameterType.Factory.newInstance();
        input.setParameterName("myinput");
        URIParameterType uriType = URIParameterType.Factory.newInstance();
        uriType.setValue("gsiftp://gridftp1.ls4.tacc.utexas.edu:2811//home1/01437/ogce/gram_20130215.log");
        input.setParameterType(uriType);
        inputList.add(input1);


        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList

                                                                                       .size()]);
        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        OutputParameterType output = OutputParameterType.Factory.newInstance();
        output.setParameterName("echo_output");
        output.setParameterType(StringParameterType.Factory.newInstance());
        outputList.add(output);

        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);

        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        jobExecutionContext = new JobExecutionContext(gFacConfiguration,serv.getType().getName());
        // Adding security context
        jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, getSecurityContext());
        ApplicationContext applicationContext = new ApplicationContext();
        jobExecutionContext.setApplicationContext(applicationContext);
        applicationContext.setServiceDescription(serv);
View Full Code Here

        app.setMaxMemory(100);
       
        /*
           * Service
           */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("SimpleEcho");

        InputParameterType input = InputParameterType.Factory.newInstance();
        ParameterType parameterType = input.addNewParameterType();
        parameterType.setName("echo_input");
        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
        inputList.add(input);
        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
                .size()]);

        OutputParameterType output = OutputParameterType.Factory.newInstance();
        ParameterType parameterType1 = output.addNewParameterType();
        parameterType1.setName("echo_output");
        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        outputList.add(output);
        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);
        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        /*
           * Save to registry
           */

        jcrRegistry.getApplicationDescriptors(serv.getType().getName());

        if(jcrRegistry.isHostDescriptorExists(host.getType().getHostName())) {
            jcrRegistry.updateHostDescriptor(host);
        } else {
            jcrRegistry.addHostDescriptor(host);
        }

        if (jcrRegistry.isApplicationDescriptorExists(serv.getType().getName(),host.getType().getHostName(),appDesc.getType().getApplicationName().getStringValue())){
            jcrRegistry.updateApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(), appDesc);
        } else {
            jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(), appDesc);
        }

        if (jcrRegistry.isServiceDescriptorExists(serv.getType().getName())){
            jcrRegistry.updateServiceDescriptor(serv);
        } else {
            jcrRegistry.addServiceDescriptor(serv);
        }
//        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
View Full Code Here

        });
        this.engine=engine;
        iniGUI();
        if (originalService!=null){
        try {
          ServiceDescription disc = getRegistry().getServiceDescriptor(originalService);
          if(disc!=null){
            setServiceDescription(disc);
          }
          throw new RegistryException(new Exception("Service Description not found in registry."));
      } catch (RegistryException e) {
View Full Code Here

        //app.setMinMemory();
        ProjectAccountType projectAccountType = ((GramApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
        projectAccountType.setProjectAccountNumber(properties.getProperty("allocation.charge.number"));

        /* Service */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("SimpleMPIEcho");

        InputParameterType input = InputParameterType.Factory.newInstance();
        ParameterType parameterType = input.addNewParameterType();
        parameterType.setName("echo_mpi_input");
        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
        inputList.add(input);
        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
                .size()]);

        OutputParameterType output = OutputParameterType.Factory.newInstance();
        ParameterType parameterType1 = output.addNewParameterType();
        parameterType1.setName("echo_mpi_output");
        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        outputList.add(output);
        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);
        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        /* Save to Registry */
        jcrRegistry.addHostDescriptor(host);
        jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(), appDesc);
        jcrRegistry.addServiceDescriptor(serv);
//        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
    }
View Full Code Here

        invocationContext.addSecurityContext("myproxy", gssContext);

        /*
    * Add workflow context
    */
        ServiceDescription serviceDescription = gfacConfig.getRegistry().getServiceDescriptor(jobContext.getServiceName());
        if(serviceDescription==null){
          throw new RegistryException(new Exception("Service Description not found in registry."));
        }
        ServiceDescriptionType serviceDescriptionType = serviceDescription.getType();
        ParameterContextImpl inputParam = new ParameterContextImpl();
        WorkflowContextImpl workflowContext = new WorkflowContextImpl();
        workflowContext.setValue(WorkflowContextImpl.WORKFLOW_ID, URI.create(jobContext.getTopic()).toString());
        invocationContext.addMessageContext(WorkflowContextImpl.WORKFLOW_CONTEXT_NAME, workflowContext);
        for(Parameter parameter:jobContext.getParameters().keySet()){
View Full Code Here

 
  @Override
  public ServiceDescription getServiceDescription(String serviceId)
      throws AiravataAPIInvocationException {
    try {
      ServiceDescription desc = getClient().getRegistry().getServiceDescriptor(serviceId);
      if(desc!=null){
            return desc;
          }
      throw new AiravataAPIInvocationException(new Exception("Service Description not found in registry."));
    } catch (RegistryException e) {
View Full Code Here

        app.setMaxWallTime(9);
        ProjectAccountType projectAccountType = ((GramApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
        projectAccountType.setProjectAccountNumber(properties.getProperty("allocation.charge.number"));

        /* Service */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("MockPwscfMPIService");

        InputParameterType input = InputParameterType.Factory.newInstance();
        ParameterType parameterType = input.addNewParameterType();
        parameterType.setName("echo_mpi_input");
        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
        inputList.add(input);
        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
                .size()]);

        OutputParameterType output = OutputParameterType.Factory.newInstance();
        ParameterType parameterType1 = output.addNewParameterType();
        parameterType1.setName("echo_mpi_output");
        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        outputList.add(output);
        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);
        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        /* Save to Registry */
        jcrRegistry.addHostDescriptor(host);
        jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(), appDesc);
        jcrRegistry.addServiceDescriptor(serv);
//        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
    }
View Full Code Here

        queueType.setQueueName(properties.getProperty("defualt.queue"));
       
        /*
        * Application Service
        */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("FileBreedTest");
        InputParameterType inputParameter = InputParameterType.Factory.newInstance();
        inputParameter.setParameterName("Input_File");
        inputParameter.setParameterDescription("File to Replicate");
        ParameterType parameterType1 = inputParameter.addNewParameterType();
        parameterType1.setType(DataType.Enum.forString("URI"));
        inputParameter.setParameterType(URIParameterType.Factory.newInstance());

        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
        inputList.add(inputParameter);
        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
                .size()]);
       
        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
        ParameterType outputParameterType = outputParameter.addNewParameterType();
        outputParameterType.setName("replicated_file");
        outputParameterType.setType(DataType.URI);
        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        outputList.add(outputParameter);
        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);
        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        /*
        * Save deployment descriptions to registry
        */
        jcrRegistry.addHostDescriptor(host);
        jcrRegistry.addApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(), appDesc);
        jcrRegistry.addServiceDescriptor(serv);
//        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.commons.gfac.type.ServiceDescription

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.