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

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


             */
            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");
            }                       
           
           
        } catch (Exception e) {
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.directory"));
        app.setCpuCount(1);
        ProjectAccountType projectAccountType = ((GramApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
        projectAccountType.setProjectAccountNumber(properties.getProperty("project.name"));

        /*
           * Service
           */
 
View Full Code Here

        host1.getType().setHostAddress("121.121.12.121");

        /*
        * App
        */
        ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
        ApplicationDeploymentDescriptionType app = appDesc.getType();
        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
        name.setStringValue("EchoLocalSearch");
        app.setApplicationName(name);
        app.setExecutableLocation("/bin/echo");
        app.setScratchWorkingDirectory("/tmp");
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");
            }                       
           
           
        } catch (Exception e) {
View Full Code Here

                    + " does not found on resource Catalog " + registryService);

        /*
         * Load app
         */
        ApplicationDeploymentDescription app = null;
        try {
            app = registryService.getDeploymentDescription(context.getServiceName(), host.getType().getHostName());
        } catch (RegistryException e2) {
            e2.printStackTrace();
        }
View Full Code Here

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

    /*
     * App
     */
    ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
    ApplicationDeploymentDescriptionType app = appDesc.getType();
    ApplicationName name = ApplicationName.Factory.newInstance();
    name.setStringValue("EchoLocal");
    app.setApplicationName(name);
    app.setExecutableLocation("/bin/echo");
    app.setScratchWorkingDirectory("/tmp");
View Full Code Here


    /*
     * App
     */
    ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
    ApplicationDeploymentDescriptionType app = appDesc.getType();
    ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
    name.setStringValue("EchoLocal");
    app.setApplicationName(name);
    app.setExecutableLocation("/bin/echo");
    app.setScratchWorkingDirectory("/tmp");
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

            NodeIterator nodes = hostNode.getNodes();
            boolean found = false;
            for (; nodes.hasNext();) {
                Node app = nodes.nextNode();
                Property prop = app.getProperty(XML_PROPERTY_NAME);
                ApplicationDeploymentDescription appDesc = ApplicationDeploymentDescription.fromXML(prop.getString());
                if (appDesc.getType().getApplicationName().getStringValue().matches(applicationName)) {
                    app.remove();
                    found = true;
                }
            }
            if (found) {
View Full Code Here

            Node hostNode = serviceNode.getNode(hostName);
            NodeIterator nodes = hostNode.getNodes();
            for (; nodes.hasNext();) {
                Node app = nodes.nextNode();
                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

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.