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

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


    private void validateDialog() throws Exception {
        if (getServiceName() == null || getServiceName().trim().equals("")) {
            throw new Exception("Name of the application cannot be empty!!!");
        }
        ServiceDescription serviceDescription2 = null;
        serviceDescription2 = getRegistry().getApplicationManager().getServiceDescription(getServiceName());
        if (isNewDescription() && serviceDescription2 != null) {
            throw new Exception("Service descriptor with the given name already exists!!!");
        }
    }
View Full Code Here


        this.serviceCreated = serviceCreated;
    }

    public ServiceDescription getServiceDescription() {
        if (serviceDescription == null) {
            serviceDescription = new ServiceDescription();
        }
        return serviceDescription;
    }
View Full Code Here

    private void validateDialog() throws Exception {
        if (getServiceName() == null || getServiceName().trim().equals("")) {
            throw new Exception("Name of the service cannot be empty!!!");
        }

        ServiceDescription serviceDescription2 = null;
        try {
            serviceDescription2 = getRegistry().getApplicationManager().getServiceDescription(getServiceName());
        } catch (AiravataAPIInvocationException e) {
            if (e.getCause() instanceof PathNotFoundException) {
                // non-existant name. just want we want
View Full Code Here

          if (hostDescriptionDialog.isHostCreated()) {
          loadDescriptors();
        }
          break;
        case SERVICE:
          ServiceDescription d = (ServiceDescription) getSelected();
          DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(getAPI(),false,d, null);
            serviceDescriptionDialog.open();
//          ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),false,d);
//          serviceDescriptionDialog.open();
          if (serviceDescriptionDialog.isServiceCreated()) {
View Full Code Here

          title = "Host description";
          question = "Are you sure that you want to remove the service description \""
                      + h.getType().getHostName() + "\"?";
          break;
        case SERVICE:
            ServiceDescription d = (ServiceDescription) getSelected();
          title = "Service description";
          question = "Are you sure that you want to remove the applications associated with \""
                      + d.getType().getName() + "\"?";
          break;
        case APPLICATION:
          ApplicationDescription a = (ApplicationDescription) getSelected();
          title = "Service description";
          question = "Are you sure that you want to remove the service description \""
                      + a.getType().getApplicationName().getStringValue() + "\"?";
          break;
      }
     
       
    if (askQuestion(title, question)) {
              switch (descriptorType){
              case HOST:
                HostDescription h = (HostDescription) getSelected();
                  getAPI().getApplicationManager().deleteHostDescription(h.getType().getHostName());
                        loadDescriptors();
                break;
              case SERVICE:
                  ServiceDescription d = (ServiceDescription) getSelected();
                  getAPI().getApplicationManager().deleteServiceDescription(d.getType().getName());
                        loadDescriptors();
                break;
              case APPLICATION:
                ApplicationDescription a = (ApplicationDescription) getSelected();
                String[] s = dlist.get(a).split("\\$");
View Full Code Here

        descriptor.getType().setHostAddress("127.0.0.1");

        log.info("Saving host description ....");
        airavataAPI.getApplicationManager().saveHostDescription(descriptor);

        ServiceDescription serviceDescription = new ServiceDescription();
        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
        serviceDescription.getType().setName("Echo");
        serviceDescription.getType().setDescription("Echo service");
        // Creating input parameters
        InputParameterType parameter = InputParameterType.Factory.newInstance();
        parameter.setParameterName("echo_input");
        parameter.setParameterDescription("echo input");
        ParameterType parameterType = parameter.addNewParameterType();
        parameterType.setType(DataType.STRING);
        parameterType.setName("String");
        inputParameters.add(parameter);

        // Creating output parameters
        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
        outputParameter.setParameterName("echo_output");
        outputParameter.setParameterDescription("Echo output");
        ParameterType outputParaType = outputParameter.addNewParameterType();
        outputParaType.setType(DataType.STRING);
        outputParaType.setName("String");
        outputParameters.add(outputParameter);

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

        log.info("Saving service description ...");
        // Saving service descriptor
        airavataAPI.getApplicationManager().saveServiceDescription(serviceDescription);
View Full Code Here

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

        //app.setMinMemory();
        ProjectAccountType projectAccountType = ((HpcApplicationDeploymentType) 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 */
        airavataAPI.getApplicationManager().saveHostDescription(host);
        airavataAPI.getApplicationManager().saveApplicationDescription(serv.getType().getName(), host.getType().getHostName(), appDesc);
        airavataAPI.getApplicationManager().saveServiceDescription(serv);
//        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
    }
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
           */

        airavataAPI.getApplicationManager().getApplicationDescriptors(serv.getType().getName());

        if(airavataAPI.getApplicationManager().isHostDescriptorExists(host.getType().getHostName())) {
            airavataAPI.getApplicationManager().updateHostDescriptor(host);
        } else {
            airavataAPI.getApplicationManager().saveHostDescription(host);
        }

        if (airavataAPI.getApplicationManager().isApplicationDescriptorExists(serv.getType().getName(), host.getType().getHostName(), appDesc.getType().getApplicationName().getStringValue())){
            airavataAPI.getApplicationManager().updateApplicationDescriptor(serv.getType().getName(), host.getType().getHostName(), appDesc);
        } else {
            airavataAPI.getApplicationManager().saveApplicationDescription(serv.getType().getName(), host.getType().getHostName(), appDesc);
        }

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

        app.setMaxWallTime(9);
        ProjectAccountType projectAccountType = ((HpcApplicationDeploymentType) 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 */
        airavataAPI.getApplicationManager().saveHostDescription(host);
        airavataAPI.getApplicationManager().saveApplicationDescription(serv.getType().getName(), host.getType().getHostName(), appDesc);
        airavataAPI.getApplicationManager().saveServiceDescription(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.