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

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


    host.getType().setHostAddress("localhost");
    return host;
  }

  private ServiceDescription createServiceDescription() {
    ServiceDescription serv = new ServiceDescription();
    serv.getType().setName("SimpleEcho");
    return serv;
  }
View Full Code Here


          if (hostDescriptionDialog.isHostCreated()) {
          loadDescriptors();
        }
          break;
        case SERVICE:
          ServiceDescription d = (ServiceDescription) getSelected();
          DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(getRegistry(),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:
          ApplicationDeploymentDescription a = (ApplicationDeploymentDescription) 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();
                  getRegistry().removeHostDescriptor(h.getType().getHostName());
                break;
              case SERVICE:
                  ServiceDescription d = (ServiceDescription) getSelected();
                  getRegistry().removeServiceDescriptor(d.getType().getName());
                break;
              case APPLICATION:
                ApplicationDeploymentDescription a = (ApplicationDeploymentDescription) getSelected();
                String[] s = dlist.get(a).split("\\$");
                  getRegistry().removeApplicationDescriptor(s[0], s[1], a.getType().getApplicationName().getStringValue());
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 application cannot be empty!!!");
        }
        ServiceDescription serviceDescription2 = null;
        serviceDescription2 = getRegistry().getServiceDescriptor(getServiceName());
        if (isNewDescription() && serviceDescription2 != null) {
            throw new Exception("Service descriptor with the given name already exists!!!");
        }
    }
View Full Code Here

    public String getService() {
        return service;
    }

    public ServiceDescription getServiceDescription() throws RegistryException{
        ServiceDescription desc = getRegistry().getServiceDescriptor(getService());
        if(desc!=null){
          return desc;
        }
        throw new RegistryException(new Exception("Service Description not found in registry."));
    }
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().getServiceDescriptor(getServiceName());
        } catch (RegistryException e) {
            if (e.getCause() instanceof PathNotFoundException) {
                // non-existant name. just want we want
View Full Code Here

        AiravataRegistry2 registryService = context.getExecutionContext().getRegistryService();

        /*
         * Load Service
         */
        ServiceDescription serviceDesc = null;
        try {
            serviceDesc = registryService.getServiceDescriptor(context.getServiceName());
        } catch (RegistryException e2) {
            e2.printStackTrace();
        }
View Full Code Here

*/
public class RegistryDataService extends DataServiceChain {

    public boolean execute(InvocationContext context) throws ExtensionException {

        ServiceDescription serviceDesc = context.getExecutionDescription().getService();
        HostDescription hostDesc = context.getExecutionDescription().getHost();
        ApplicationDeploymentDescriptionType appDesc = context.getExecutionDescription().getApp().getType();
        if (serviceDesc != null && hostDesc != null && appDesc != null) {
            /*
             * if there is no setting in deployment description, use from host
             */
            if (appDesc.getScratchWorkingDirectory() == null) {
                appDesc.setScratchWorkingDirectory("/tmp");
            }

            /*
             * Working dir
             */
            if (appDesc.getStaticWorkingDirectory() == null || "null".equals(appDesc.getStaticWorkingDirectory())) {
                String date = new Date().toString();
                date = date.replaceAll(" ", "_");
                date = date.replaceAll(":", "_");

                String tmpDir = appDesc.getScratchWorkingDirectory() + File.separator
                        + serviceDesc.getType().getName() + "_" + date + "_" + UUID.randomUUID();

                appDesc.setStaticWorkingDirectory(tmpDir);
            }

            /*
 
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.