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

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


    private static final Logger log = LoggerFactory.getLogger(LocalDirectorySetupHandler.class);

    public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException {
        log.info("Invoking GramDirectorySetupHandler ...");
        HostDescriptionType type = jobExecutionContext.getApplicationContext().getHostDescription().getType();
        ApplicationDescription applicationDeploymentDescription = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription();
        ApplicationDeploymentDescriptionType app = applicationDeploymentDescription.getType();
        log.debug("working diectroy = " + app.getStaticWorkingDirectory());
        log.debug("temp directory = " + app.getScratchWorkingDirectory());

        makeFileSystemDir(app.getStaticWorkingDirectory(),jobExecutionContext);
        makeFileSystemDir(app.getScratchWorkingDirectory(),jobExecutionContext);
View Full Code Here


                    // and this handler is not able to find std* files?
                    try {
                     stdout = ftp.readRemoteFile(stdoutURI, gssCred, localStdOutFile);
                     stderr = ftp.readRemoteFile(stderrURI, gssCred, localStdErrFile);
                     //TODO: do we also need to set them as output parameters for another job
                     ApplicationDescription application = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription();
                     ApplicationDeploymentDescriptionType appDesc = application.getType();
                     appDesc.setStandardOutput(stdout);
                     appDesc.setStandardError(stderr);
                     jobExecutionContext.getApplicationContext().setApplicationDeploymentDescription(application);
                    }
                    catch(ToolsException e) {
View Full Code Here

                registeredHost = hostScheduler.schedule(registeredHosts);
            } else {
                // if user specify a host, no matter what we pick that host for all the nodes, todo: allow users to specify node specific host
                registeredHost = airavataAPI.getApplicationManager().getHostDescription(hostName);
            }
            ApplicationDescription applicationDescription =
                    airavataAPI.getApplicationManager().getApplicationDescription(serviceName, registeredHost.getType().getHostName());

            // When we run getInParameters we set the actualParameter object, this has to be fixed
            URL resource = EmbeddedGFacInvoker.class.getClassLoader().getResource("gfac-config.xml");
            OMElement inputMessage = getInParameters();
View Full Code Here

                if (isNewDescritor()) {
          String baseName = "Application";
          int i = 1;
          String defaultName = baseName + i;
          try {
            ApplicationDescription applicationDescription = getRegistry()
                .getApplicationManager().getApplicationDescription(getServiceName(),
                                        getHostName());
            while (true) {
              boolean notFound = true;
              if (applicationDescription.getType()
                  .getApplicationName().getStringValue()
                  .equals(defaultName)) {
                notFound = false;
                break;
              }
View Full Code Here

    }

    public ApplicationDescription getShellApplicationDescription() {
        if(shellApplicationDescription == null){
            if (isNewDescritor()) {
        shellApplicationDescription = new ApplicationDescription();
      }else{
        try {
          shellApplicationDescription= ApplicationDescription.fromXML(getOriginalDescription().toXML());
        } catch (XmlException e) {
          //shouldn't happen (hopefully)
View Full Code Here

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

        ApplicationDescription descriptions = null;
        try {
            descriptions = getRegistry().getApplicationManager().getApplicationDescriptor(getServiceName(), getHostName(),
                    getApplicationName());
        } catch (AiravataAPIInvocationException e) {
            throw e;
View Full Code Here

                registeredHost = hostScheduler.schedule(registeredHosts);
            } else {
                // if user specify a host, no matter what we pick that host for all the nodes, todo: allow users to specifi node specific host
                registeredHost = airavataAPI.getApplicationManager().getHostDescription(hostName);
            }
            ApplicationDescription applicationDescription =
                    airavataAPI.getApplicationManager().getApplicationDescription(serviceName, registeredHost.getType().getHostName());

            // When we run getInParameters we set the actualParameter object, this has to be fixed
            URL resource = EmbeddedGFacInvoker.class.getClassLoader().getResource("gfac-config.xml");
            OMElement inputMessage = getInParameters();
View Full Code Here

          if (serviceDescriptionDialog.isServiceCreated()) {
          loadDescriptors();
        }
          break;
        case APPLICATION:
                ApplicationDescription a = (ApplicationDescription) getSelected();
                String[] s = dlist.get(a).split("\\$");
                ApplicationDescriptionDialog aDescriptionDialog = new ApplicationDescriptionDialog(engine, false, a, s[1], s[0]);
                aDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
                aDescriptionDialog.open();
                if (aDescriptionDialog.isApplicationDescCreated()) {
View Full Code Here

          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("\\$");
                  getAPI().getApplicationManager().deleteApplicationDescription(s[0], s[1], a.getType().getApplicationName().getStringValue());
                loadDescriptors();
                        break;
              }
//        loadDescriptors();
        }
View Full Code Here

     * @return shell command to be executed
     * @throws GFacProviderException GFacProviderException
     */
    private String createShellCmd(JobExecutionContext jobExecutionContext) throws GFacProviderException {
        String command = "";
        ApplicationDescription appDesc = jobExecutionContext.getApplicationContext().
                getApplicationDeploymentDescription();

        if(appDesc.getType() instanceof Ec2ApplicationDeploymentType) {
            Ec2ApplicationDeploymentType type = (Ec2ApplicationDeploymentType) appDesc.getType();
            if(type.getExecutable() != null) {
                command = type.getExecutableType() + " " + type.getExecutable();
            } else {
                command = "sh" + " " + type.getExecutable();
            }
            command = setCmdParams(jobExecutionContext, command);

        } else {
            ApplicationDeploymentDescriptionType type = appDesc.getType();
            command = "sh" + " " + type.getExecutableLocation();
            command = setCmdParams(jobExecutionContext, command);
        }

        return command + '\n';
View Full Code Here

TOP

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

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.