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

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


        return hostDescription;
    }

    public static ServiceDescription createServiceDescription (ServiceDescriptor serviceDescriptor){
        ServiceDescription serviceDescription = new ServiceDescription();
        serviceDescription.getType().setName(serviceDescriptor.getServiceName());
        serviceDescription.getType().setDescription(serviceDescriptor.getDescription());
        List<ServiceParameters> inputParams = serviceDescriptor.getInputParams();
        InputParameterType[] inputParameterTypeArray = new InputParameterType[inputParams.size()];
        for (int i = 0; i < inputParams.size(); i++){
            InputParameterType parameter = InputParameterType.Factory.newInstance();
            parameter.setParameterName(inputParams.get(i).getName());
            parameter.setParameterValueArray(new String[]{inputParams.get(i).getName()});
            ParameterType parameterType = parameter.addNewParameterType();
            parameterType.setType(DataType.Enum.forString(inputParams.get(i).getType()));
            parameterType.setName(inputParams.get(i).getType());
            parameter.setParameterType(parameterType);
            inputParameterTypeArray[i] = parameter;
        }
        serviceDescription.getType().setInputParametersArray(inputParameterTypeArray);

        List<ServiceParameters> outputParams = serviceDescriptor.getOutputParams();
        OutputParameterType[] outputParameterTypeArray = new OutputParameterType[outputParams.size()];
        for (int i = 0; i < outputParams.size(); i++){
            OutputParameterType parameter = OutputParameterType.Factory.newInstance();
            parameter.setParameterName(outputParams.get(i).getName());
            ParameterType parameterType = parameter.addNewParameterType();
            parameterType.setType(DataType.Enum.forString(outputParams.get(i).getType()));
            parameterType.setName(outputParams.get(i).getType());
            parameter.setParameterType(parameterType);
            outputParameterTypeArray[i] = parameter;
        }
        serviceDescription.getType().setOutputParametersArray(outputParameterTypeArray);
        return serviceDescription;
    }
View Full Code Here


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

        /*
         * Load Service
         */
        ServiceDescription serviceDesc = null;
        try {
            serviceDesc = registryService.getApplicationManager().getServiceDescription(context.getServiceName());
        } catch (AiravataAPIInvocationException e2) {
            e2.printStackTrace();
        }
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:
          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();
                  getRegistry().getApplicationManager().deleteHostDescription(h.getType().getHostName());
                        loadDescriptors();
                break;
              case SERVICE:
                  ServiceDescription d = (ServiceDescription) getSelected();
                  getRegistry().getApplicationManager().deleteServiceDescription(d.getType().getName());
                        loadDescriptors();
                break;
              case APPLICATION:
                ApplicationDescription a = (ApplicationDescription) getSelected();
                String[] s = dlist.get(a).split("\\$");
View Full Code Here

            throw new RuntimeException("Failed : HTTP error code : "
                    + status);
        }

        ServiceDescriptor serviceDescriptor = response.getEntity(ServiceDescriptor.class);
        ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(serviceDescriptor);
        return serviceDescription;
    }
View Full Code Here

        ServiceDescriptionList serviceDescriptionList = response.getEntity(ServiceDescriptionList.class);
        ServiceDescriptor[] serviceDescriptors = serviceDescriptionList.getServiceDescriptions();

        for (ServiceDescriptor serviceDescriptor : serviceDescriptors) {
            ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(serviceDescriptor);
            serviceDescriptions.add(serviceDescription);
        }
        return serviceDescriptions;
    }
View Full Code Here

    }

    public void addApplicationDescriptor(String serviceName,
                                         String hostName,
                                         ApplicationDescription descriptor) throws DescriptorAlreadyExistsException {
        ServiceDescription serviceDescription = getServiceDescriptor(serviceName);
        ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor);
        applicationDescriptor.setHostdescName(hostName);
        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
        applicationDescriptor.setServiceDescriptor(serviceDescriptor);
View Full Code Here

    }

    public void updateApplicationDescriptor(String serviceName,
                                            String hostName,
                                            ApplicationDescription descriptor) {
        ServiceDescription serviceDescription = getServiceDescriptor(serviceName);
        ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor);
        applicationDescriptor.setHostdescName(hostName);
        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
        applicationDescriptor.setServiceDescriptor(serviceDescriptor);
View Full Code Here

        invocationContext.addSecurityContext("myproxy", gssContext);

        /*
    * Add workflow context
    */
        ServiceDescription serviceDescription = gfacConfig.getAiravataAPI().getApplicationManager().getServiceDescription(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

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

  private ServiceDescription createServiceDescription() {
    ServiceDescription serv = new ServiceDescription();
    serv.getType().setName("SimpleEcho");
    return serv;
  }
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.