Package org.jfx4ee.adm4ee.business.configuration.entity

Examples of org.jfx4ee.adm4ee.business.configuration.entity.Domain


            Level logLevel = config.getLogLevel();
            assertEquals(Level.INFO, logLevel);
            List<Domain> domains = config.getDomains();
            assertNotNull(domains);
            assertTrue(domains.size() > 0);
            Domain domain = domains.get(0);
            assertNotNull(domain);
            assertEquals("testdomain1", domain.getDomainName());
            assertNotNull(domain.getServerType());

            List<Application> applications = domain.getApplications();
            assertNotNull(applications);
            assertTrue(applications.size() > 0);

            Application app = applications.get(0);
            assertNotNull(app);
            assertEquals("WebTest", app.getName());

            List<Database> databases = domain.getDatabases();
            assertNotNull(databases);

            Database db = databases.get(0);
            assertEquals("Master", db.getName());
View Full Code Here


    @Test
    public void testGetDomainWithDomainName() {
        String serverRootPath = "/path/to/glassfish-3.1.2.2";
        String domainName = "testdomain1";
        Domain domain = config.getDomain(serverRootPath, domainName);
        assertNotNull(domain);
        assertTrue(domain.getDomainName().equals(domainName));
    }
View Full Code Here

        } else if (commandLine.hasOption("create")) {
            createDomain();
           
        } else if (commandLine.hasOption("start")) {
            Domain domain = getDomain(commandLine.getOptionValue("start"));
            ServerHandler serverHandler = ServerHandler.getInstance(domain);
            Server server = serverHandler.getServer();
            server.initLocalServer();
            CommandResult result = server.startDomain(domain.getDomainName());
            System.exit(result.getExitCode());

        } else if (commandLine.hasOption("stop")) {
            Domain domain = getDomain(commandLine.getOptionValue("stop"));
            ServerHandler serverHandler = ServerHandler.getInstance(domain);
            Server server = serverHandler.getServer();
            server.initLocalServer();
            server.initLocalDomain();
            CommandResult result = server.stopDomain();
View Full Code Here

            listApplications();
        }
    }

    protected void ping() {
        Domain domain = getDomain(commandLine.getOptionValue("ping"));
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
        server.initLocalDomain();
        CommandResult result = server.pingManagementResource();
View Full Code Here

        }
        System.exit(result.getExitCode());
    }

    protected void listApplications() {
        Domain domain = getDomain(commandLine.getOptionValue("applications"));
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
        server.initLocalDomain();
        try {
View Full Code Here

            System.exit(1);
        }
    }

    protected void watchdog() {
        Domain domain = getDomain(commandLine.getOptionValue("watchdog"));
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
        server.initLocalDomain();
        CommandResult result = server.pingManagementResource();
        if (!result.isOk()) {
            System.out.println("Domain is not accessable: " + result.getExitCode() + " " + result.getExitCodeInfo());
            try {
                server.stopDomain();
            } catch (Exception e) {
                // Ignore stop error here
            }
            try {
                // wait some time to be sure it is stopped
                Thread.sleep(5000);
            } catch (InterruptedException ex) {
                logger.log(Level.SEVERE, null, ex);
            }
            result = server.startDomain(domain.getDomainName());
            if (result.isOk()) {
                result = server.pingManagementResource();
            }
        }
        System.exit(result.getExitCode());
View Full Code Here

            System.err.println("No admin password specified!");
            System.exit(1);
        }
       
        // We need at least a server root path, the desired domain name, user and password here
        Domain domain = new Domain();
        domain.setServerType(ServerType.GLASSFISH);
        domain.setDomainName(commandLine.getOptionValue("create"));
        domain.setServerRootPath(commandLine.getOptionValue("serverpath"));
        domain.setDomainUser(commandLine.getOptionValue("user"));
        domain.setDomainPassword(commandLine.getOptionValue("password"));
       
        // Init the server
        ServerHandler serverHandler = ServerHandler.getInstance(domain);
        Server server = serverHandler.getServer();
        server.initLocalServer();
       
        // Check if there is a template
        File template = null;
        if (commandLine.hasOption("template")) {
            String templateName = commandLine.getOptionValue("template");
            if (templateName != null) {
                template = new File(templateName);
                if (!template.exists()) {
                    System.err.println("Domain template '" + template.getAbsolutePath() + "' does not exist!");
                    System.exit(1);
                }
            }
        }
       
        // Check if there is a port base
        int portBase = -1;
        if (commandLine.hasOption("portbase")) {
            String portbaseStr = commandLine.getOptionValue("portbase");
            if (portbaseStr != null) {
                portBase = Integer.parseInt(portbaseStr);
                if (portBase <= 0) {
                    System.err.println("Invalid portbase '" + portbaseStr + "'!");
                }
            }
        }
       
        boolean checkPorts = true;
        if (commandLine.hasOption("checkports")) {
            String checkPortsStr = commandLine.getOptionValue("checkports");
            if (checkPortsStr != null) {
                checkPorts = Boolean.parseBoolean(checkPortsStr);
            }
        }
       
        // Create the domain
        CommandResult result = server.createDomain(domain.getDomainName(), portBase, template, domain.getDomainUser(), domain.getDomainPassword(), checkPorts);
        if (!result.isOk()) {
            System.err.println(result.getResult());
        }
        System.exit(result.getExitCode());
    }
View Full Code Here

        System.exit(result.getExitCode());
    }

    protected Domain getDomain(String domainName) {
        ConfigurationManager config = ConfigurationManager.getInstance();
        Domain domain = config.getDomain(null, domainName);
        if (domain == null) {
            System.err.println("No domain configuration for '" + domainName + "' found!");
            System.exit(1);
        }
        return domain;
View Full Code Here

    public void init() throws Exception {
        config = ConfigurationManager.getInstance();
        config.setLogLevel(Level.FINER);
        List<Domain> domains = config.getDomains();
        domains.clear();
        domain = new Domain();
        domain.setServerType(ServerType.GLASSFISH);
        File templateFile = new File(getClass().getResource("/testTemplate").toURI());
        domain.setTemplate(templateFile.getCanonicalPath());
        if (OsHelper.isWindows()) {
            domain.setServerRootPath("C:\\glassfish-3.1.2.2");
View Full Code Here

    public void init() throws Exception {
        config = ConfigurationManager.getInstance();
        config.setLogLevel(Level.FINER);
        List<Domain> domains = config.getDomains();
        domains.clear();
        domain = new Domain();
        domain.setServerType(ServerType.WILDFLY_STANDALONE);
        File templateFile = new File(getClass().getResource("/testTemplate").toURI());
        domain.setTemplate(templateFile.getCanonicalPath());
        if (OsHelper.isWindows()) {
            domain.setServerRootPath("C:\\jboss-as-7.1.1.Final");
View Full Code Here

TOP

Related Classes of org.jfx4ee.adm4ee.business.configuration.entity.Domain

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.