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

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


            for (String server : servers) {
                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);
            }

        }
View Full Code Here


            isStart = subModel.get(AUTO_START).asBoolean();
        } else {
            isStart = true;
        }

        ServerStatus status = hostController.getServerStatus(serverName);

        if (status == ServerStatus.STOPPED) {
            status = isStart ? status : ServerStatus.DISABLED;
        }

        if(status != null) {
            resultHandler.handleResultFragment(Util.NO_LOCATION, new ModelNode().set(status.toString()));
            resultHandler.handleResultComplete();
        } else {
            resultHandler.handleFailed(new ModelNode().set("Failed to get server status"));
        }
        return new BasicOperationResult();
View Full Code Here

                public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                    final String hostName = model.get(HOST).keys().iterator().next();
                    final ModelNode serverConfig = model.get(HOST, hostName).get(SERVER_CONFIG);
                    final Set<String> serversInGroup = getServersForGroup(model, group);
                    for (Property config : serverConfig.asPropertyList()) {
                        final ServerStatus status = serverInventory.determineServerStatus(config.getName());
                        if (status != ServerStatus.STARTING && status != ServerStatus.STARTED) {
                            if (group == null || serversInGroup.contains(config.getName())) {
                                if (status != ServerStatus.STOPPED) {
                                    serverInventory.stopServer(config.getName(), TIMEOUT);
                                }
View Full Code Here

            for (String server : servers) {
                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);
            }

        }
View Full Code Here

        // to go into how to do this to make it production ready.
        try {
            if (client != null) {
                try {
                    for (ServerIdentity id : servers.keySet()) {
                        final ServerStatus status = servers.get(id);
                        switch (status) {
                            case STARTED: {
                                client.stopServer(id.getHostName(), id.getServerName(), 10L, TimeUnit.SECONDS);
                                break;
                            }
View Full Code Here

            isRunning = false;
        } else {
            try {
                final Map<ServerIdentity, ServerStatus> statuses = client.getServerStatuses();
                for (ServerIdentity id : statuses.keySet()) {
                    final ServerStatus status = statuses.get(id);
                    switch (status) {
                        case DISABLED:
                        case STARTED: {
                            servers.put(id, status);
                            break;
View Full Code Here

        for (String serverGroup : serverGroups) {
            boolean notFound = true;
            // Check the servers
            for (ServerIdentity serverId : statuses.keySet()) {
                if (serverGroup.equals(serverId.getServerGroupName())) {
                    ServerStatus currentStatus = statuses.get(serverId);
                    if (currentStatus != ServerStatus.STARTED) {
                        throw new DeploymentFailureException("Status of server group '%s' is '%s', but is required to be '%s'.",
                                        serverGroup, currentStatus, ServerStatus.STARTED);
                    }
                    notFound = false;
View Full Code Here

            isStart = subModel.get(AUTO_START).asBoolean();
        } else {
            isStart = true;
        }

        ServerStatus status = serverInventory.determineServerStatus(serverName);

        if (status == ServerStatus.STOPPED) {
            status = isStart ? status : ServerStatus.DISABLED;
        }

        if(status != null) {
            context.getResult().set(status.toString());
            context.completeStep();
        } else {
            throw new OperationFailedException(new ModelNode().set("Failed to get server status"));
        }
    }
View Full Code Here

        final ModelNode model = Resource.Tools.readModel(context.getRootResource());
        context.addStep(new OperationStepHandler() {
            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final ServerStatus status = serverInventory.startServer(serverName, model);
                context.getResult().set(status.toString());
                context.completeStep();
            }
        }, OperationContext.Stage.RUNTIME);
        context.completeStep();
    }
View Full Code Here

        final ModelNode model = Resource.Tools.readModel(context.getRootResource());
        context.addStep(new OperationStepHandler() {
            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final ServerStatus status = serverInventory.restartServer(serverName, -1, model);
                context.getResult().set(status.toString());
                context.completeStep();
            }
        }, OperationContext.Stage.RUNTIME);
        context.completeStep();
    }
View Full Code Here

TOP

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

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.