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

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



        /*
        * Application deployment description
        */
        ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription(GramApplicationDeploymentType.type);
        GramApplicationDeploymentType app = (GramApplicationDeploymentType) appDesc.getType();
        app.setCpuCount(1);
        app.setNodeCount(1);
        ApplicationDeploymentDescriptionType.ApplicationName name = appDesc.getType().addNewApplicationName();
        name.setStringValue("FileBreed");
        app.setExecutableLocation("/bin/echo");
        app.setScratchWorkingDirectory(properties.getProperty("scratch.working.directory"));
        app.setCpuCount(1);
        ProjectAccountType projectAccountType = ((GramApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
        projectAccountType.setProjectAccountNumber(properties.getProperty("allocation.charge.number"));
        QueueType queueType = app.addNewQueue();
        queueType.setQueueName(properties.getProperty("defualt.queue"));
       
        /*
 
View Full Code Here



        /*
        * App
        */
        ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription(GramApplicationDeploymentType.type);
        GramApplicationDeploymentType app = (GramApplicationDeploymentType) appDesc.getType();
        app.setCpuCount(1);
        app.setNodeCount(1);
        ApplicationDeploymentDescriptionType.ApplicationName name = appDesc.getType().addNewApplicationName();
        name.setStringValue("EchoLocal");
        app.setExecutableLocation("/bin/echo");
        app.setScratchWorkingDirectory(properties.getProperty("scratch.working.directory"));
        app.setCpuCount(1);
        ProjectAccountType projectAccountType = ((GramApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
        projectAccountType.setProjectAccountNumber(properties.getProperty("allocation.charge.number"));
        QueueType queueType = app.addNewQueue();
        queueType.setQueueName(properties.getProperty("defualt.queue"));
        app.setMaxMemory(100);
       
View Full Code Here

    }

    public ApplicationDeploymentDescription getDeploymentDescription(String serviceId, String hostId)
            throws RegistryException {
        Session session = null;
        ApplicationDeploymentDescription result = null;
        try {
            session = getSession();
            Node deploymentNode = getDeploymentNode(session);
            Node serviceNode = deploymentNode.getNode(serviceId);
            Node hostNode = serviceNode.getNode(hostId);
View Full Code Here

            }
            Node hostNode = serviceNode.getNode(hostName);
            List<Node> childNodes = getChildNodes(hostNode);
            for (Node app:childNodes) {
                Property prop = app.getProperty(XML_PROPERTY_NAME);
                ApplicationDeploymentDescription appDesc = ApplicationDeploymentDescription.fromXML(prop.getString());
                if (appDesc.getType().getApplicationName().getStringValue().matches(applicationName)) {
                    result.add(appDesc);
                }
            }
        } catch (PathNotFoundException e) {
            return result;
View Full Code Here

    }

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

          if (serviceDescriptionDialog.isServiceCreated()) {
          loadDescriptors();
        }
          break;
        case APPLICATION:
          ApplicationDeploymentDescription a = (ApplicationDeploymentDescription) 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:
          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)) {
            try {
              switch (descriptorType){
              case HOST:
                HostDescription h = (HostDescription) getSelected();
                  getRegistry().deleteHostDescription(h.getType().getHostName());
                break;
              case SERVICE:
                  ServiceDescription d = (ServiceDescription) getSelected();
                  getRegistry().deleteServiceDescription(d.getType().getName());
                break;
              case APPLICATION:
                ApplicationDeploymentDescription a = (ApplicationDeploymentDescription) getSelected();
                String[] s = dlist.get(a).split("\\$");
                  getRegistry().deleteDeploymentDescription(s[0], s[1], a.getType().getApplicationName().getStringValue());
                break;
              }
        loadDescriptors();
      } catch (RegistryException e) {
        this.engine.getGUI().getErrorWindow().error(e);
View Full Code Here

    }

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

             */
            jcrRegistry.saveHostDescription(host);
            jcrRegistry.saveServiceDescription(serv);
           
           
            ApplicationDeploymentDescription app = new ApplicationDeploymentDescription();
            app.getType().addNewApplicationName().setStringValue("ECHOLOCAL");
            app.getType().setExecutableLocation("/bin/echo");
            app.getType().setScratchWorkingDirectory("/tmp");
           
            jcrRegistry.deployServiceOnHost(serviceId, hostId);
            jcrRegistry.saveDeploymentDescription(serviceId, hostId, app);           
                       
            /*
             * Load
             */
            ApplicationDeploymentDescription appR = jcrRegistry.getDeploymentDescription(serviceId, hostId);
           
            if(appR == null){
                fail("Deployment is null");
            }
           
            if(appR.getType().getApplicationName() == null || !appR.getType().getApplicationName().getStringValue().equals("ECHOLOCAL")){
                fail("Wrong deployment name");
            }
           
            if(!appR.getType().getExecutableLocation().equals("/bin/echo") || !appR.getType().getScratchWorkingDirectory().equals("/tmp")){
                fail("Setting and Loading value fail");
            }                       
           
            jcrRegistry.closeConnection();
            IOUtil.deleteDirectory(new File((new File(".")).getAbsolutePath() + File.separator + "target" + File.separator + "jackrabbit5"));
View Full Code Here

            try {
                String name = service.getType().getName();
                String hostName = appBean.getHostName();
                Thread.sleep(1000);
                ApplicationDeploymentDescription appDepDesc =
                        jcrRegistry.getDeploymentDescription(name, hostName);
                if(appDepDesc == null) {
                    if(log.isDebugEnabled()) {
                        log.debug("name    : " + name);
                        log.debug("hostName: " + hostName);
View Full Code Here

TOP

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

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.