Package org.jboss.as.controller.client.helpers.domain

Examples of org.jboss.as.controller.client.helpers.domain.ServerIdentity


            address = new ModelNode();
            address.add("host", configuration.getHostName());
            address.add("server", server);

            ControlledProcessState.State status = Enum.valueOf(ControlledProcessState.State.class, readAttribute("server-state", address).asString().toUpperCase());
            ServerIdentity id = new ServerIdentity(configuration.getHostName(), group, server);
            result.put(id, status);
        }

        return result;
    }
View Full Code Here


                ModelNode address = new ModelNode();
                address.add("host", host);
                address.add("server-config", server);
                String group = readAttribute("group", address).asString();
                ServerStatus status = Enum.valueOf(ServerStatus.class, readAttribute("status", address).asString());
                ServerIdentity id = new ServerIdentity(host, group, server);
                result.put(id, status);
            }

        }
        return result;
View Full Code Here

            address = new ModelNode();
            address.add("host", configuration.getHostName());
            address.add("server", server);

            ControlledProcessState.State status = Enum.valueOf(ControlledProcessState.State.class, readAttribute("server-state", address).asString().toUpperCase(Locale.ENGLISH));
            ServerIdentity id = new ServerIdentity(configuration.getHostName(), group, server);
            result.put(id, status);
        }

        return result;
    }
View Full Code Here

                ModelNode address = new ModelNode();
                address.add("host", host);
                address.add("server-config", server);
                String group = readAttribute("group", address).asString();
                ServerStatus status = Enum.valueOf(ServerStatus.class, readAttribute("status", address).asString());
                ServerIdentity id = new ServerIdentity(host, group, server);
                result.put(id, status);
            }

        }
        return result;
View Full Code Here

    }

    private boolean listServers() throws Exception {
        stdout.println("\nReading the list of configured servers:");
        for (Map.Entry<ServerIdentity, ServerStatus> server : client.getServerStatuses().entrySet()) {
            ServerIdentity id = server.getKey();
            stdout.println("\nServer:\n");
            stdout.println("server name:         " + id.getServerName());
            stdout.println("host controller name: " + id.getHostName());
            stdout.println("server group name:   " + id.getServerGroupName());
            stdout.println("status:              " + server.getValue());
        }
        return continuePrompt();
    }
View Full Code Here

        return continuePrompt();
    }

    private boolean dumpServer() throws Exception {

        ServerIdentity server = chooseServer(ServerStatus.STARTED);
        if (server != null) {
            stdout.println("\nReading runtime configuration for " + server.getServerName() + "\n");

            ModelNode op = new ModelNode();
            op.get("operation").set("read-config-as-xml");
            ModelNode address = op.get("address");
            address.add("host", server.getHostName());
            address.add("server", server.getServerName());
            stdout.println(executeForResult(new OperationBuilder(op).build()).asString());
        }
        return continuePrompt();
    }
View Full Code Here

        }
        return continuePrompt();
    }

    private boolean stopServer() throws Exception {
        ServerIdentity server = chooseServer(ServerStatus.STARTED);
        if (server != null) {
            System.out.println("\nStopping server " + server.getServerName() + "\n");
            ServerStatus status = client.stopServer(server.getHostName(), server.getServerName(), -1, TimeUnit.SECONDS);
            System.out.println("Stop executed. Server status is " + status);
        }
        return continuePrompt();
    }
View Full Code Here

        }
        return continuePrompt();
    }

    private boolean startServer() throws Exception {
        ServerIdentity server = chooseServer(ServerStatus.STOPPED, ServerStatus.DISABLED);
        if (server != null) {
            System.out.println("\nStarting server " + server.getServerName() + "\n");
            ServerStatus status = client.startServer(server.getHostName(), server.getServerName());
            System.out.println("Start executed. Server status is " + status);
        }
        return continuePrompt();
    }
View Full Code Here

        }
        return continuePrompt();
    }

    private boolean restartServer() throws Exception {
        ServerIdentity server = chooseServer(ServerStatus.STARTED);
        if (server != null) {
            System.out.println("\nRestarting server " + server.getServerName() + "\n");
            ServerStatus status = client.restartServer(server.getHostName(), server.getServerName(), -1, TimeUnit.SECONDS);
            System.out.println("Restart executed. Server status is " + status);
        }
        return continuePrompt();
    }
View Full Code Here

        return executeForResult(new OperationBuilder(op).build());
    }

    private boolean removeServer() throws Exception {

        ServerIdentity server = chooseServer(ServerStatus.STOPPED, ServerStatus.DISABLED);
        if (server != null) {
            stdout.println("Removing server " + server.getServerName());
            ModelNode op = new ModelNode();
            op.get("operation").set("remove");
            ModelNode address = op.get("address");
            address.add("host", server.getHostName());
            address.add("server-config", server.getServerName());
            boolean success = true;
            try {
                executeForResult(new OperationBuilder(op).build());
            } catch (Exception e) {
                success = false;
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.client.helpers.domain.ServerIdentity

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.