Package org.jboss.as.console.client.domain.model

Examples of org.jboss.as.console.client.domain.model.ServerInstance


        });

        serverList.getSelectionModel().addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
            @Override
            public void onSelectionChange(SelectionChangeEvent event) {
                ServerInstance server = getSelectedServer();
                presenter.onServerSelected(getSelectedHost(), getSelectedServer());
                updateDisplay();
            }
        });


        HorizontalPanel millerHeader = new HorizontalPanel();
        Label host = new Label("Host");
        millerHeader.add(host);
        Label server = new Label("Server");

        millerHeader.add(server);
        millerHeader.getElement().setAttribute("style", "width:100%;border-bottom:1px solid #A7ABB4");

        host.getElement().getParentElement().setAttribute("width", "50%");
        server.getElement().getParentElement().setAttribute("width", "50%");


        layout.add(millerHeader);

        millerHeader.getElement().addClassName("cellTableHeader");
View Full Code Here


                                @Override
                                public void onFailure(Throwable caught) {
                                    numResponses++;

                                    ServerInstance instance = createInstanceModel(handle);
                                    instance.setRunning(false);
                                    instanceList.add(instance);

                                    checkComplete(instanceList, cb);
                                }

                                @Override
                                public void onSuccess(DMRResponse result) {

                                    numResponses++;

                                    ModelNode statusResponse = result.get();
                                    ModelNode payload = statusResponse.get(RESULT);

                                    ServerInstance instance = createInstanceModel(handle);
                                    instanceList.add(instance);

                                    if(statusResponse.isFailure())
                                    {
                                        instance.setRunning(false);
                                    }
                                    else
                                    {
                                        instance.setRunning(handle.isStarted());

                                        if(payload.hasDefined("server-state"))
                                        {
                                            String state = payload.get("server-state").asString();
                                            if(state.equals("reload-required"))
                                            {
                                                instance.setFlag(ServerFlag.RELOAD_REQUIRED);
                                            }
                                            else if (state.equals("restart-required"))
                                            {
                                                instance.setFlag(ServerFlag.RESTART_REQUIRED);
                                            }
                                        }

                                    }
View Full Code Here

                        Console.MESSAGES.modifyConfirm("Server Instance "+ form.getEditedEntity().getName()),
                        new Feedback.ConfirmationHandler() {
                            @Override
                            public void onConfirmation(boolean isConfirmed) {
                                if (isConfirmed) {
                                    ServerInstance instance = form.getEditedEntity();
                                    presenter.startServer(hostName, instance.getServer(), !instance.isRunning());
                                }
                            }
                        });
            }
        });
        startBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_start_serverInstancesView());
        tableTools.addToolButtonRight(startBtn);

        vpanel.add(tableTools.asWidget());
        vpanel.add(instanceTable);

        DefaultPager pager = new DefaultPager();
        pager.setDisplay(instanceTable);
        vpanel.add(pager);


        // scroll enabled
        ScrollPanel scroll = new ScrollPanel();
        scroll.add(vpanel);

        layout.add(scroll);

        layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 40, Style.Unit.PX);
        layout.setWidgetTopHeight(scroll, 40, Style.Unit.PX, 100, Style.Unit.PCT);


        // ----------------------------------------------------------------------

        VerticalPanel formPanel = new VerticalPanel();
        formPanel.setStyleName("fill-layout-width");

        form = new Form<ServerInstance>(ServerInstance.class);
        form.setNumColumns(2);

        form.addEditListener(
                new EditListener<ServerInstance>(

                ) {
                    @Override
                    public void editingBean(ServerInstance serverInstance) {
                        String label = serverInstance.isRunning() ? "Stop":"Start";
                        startBtn.setText(label);
                    }
                });

        // -----


        TextItem nameItem = new TextItem("name", Console.CONSTANTS.common_label_serverInstance());
        TextItem serverItem = new TextItem("server", Console.CONSTANTS.common_label_serverConfig());
        StatusItem enableItem = new StatusItem("running", "Running?");

        form.setFields(nameItem, serverItem, enableItem);
        form.bind(instanceTable);
        form.setEnabled(false);

        Widget formWidget = form.asWidget();
        formWidget.getElement().setAttribute("style", "margin-top:15px;");

        formPanel.add(formWidget);

        properties = new EnvironmentProperties();

        // ----------------------------------------------------------
        TabPanel bottomLayout = new TabPanel();
        bottomLayout.addStyleName("default-tabpanel");

        bottomLayout.add(formPanel, "Availability");
        bottomLayout.add(properties.asWidget(), "Environment Properties");
        bottomLayout.selectTab(0);

        vpanel.add(new ContentGroupLabel("Status"));

        vpanel.add(bottomLayout);

        // load system props
        final SingleSelectionModel<ServerInstance> selectionModel = (SingleSelectionModel<ServerInstance>) instanceTable.getSelectionModel();
        selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
            @Override
            public void onSelectionChange(SelectionChangeEvent event) {
                ServerInstance instance = selectionModel.getSelectedObject();
                if(instance.isRunning())
                    presenter.loadEnvironment(instance);
                else
                    properties.clearValues();
            }
        });
View Full Code Here

        dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {


            @Override
            public void onFailure(Throwable caught) {
                ServerInstance instance = createInstanceModel(handle);
                instance.setRunning(false);
                callback.onSuccess(instance);
            }

            @Override
            public void onSuccess(DMRResponse result) {

                ModelNode statusResponse = result.get();
                ModelNode payload = statusResponse.get(RESULT);

                ServerInstance instance = createInstanceModel(handle);

                if(statusResponse.isFailure())
                {
                    instance.setRunning(false);
                }
                else
                {
                    instance.setRunning(handle.isStarted());

                    if(payload.hasDefined("server-state"))
                    {
                        String state = payload.get("server-state").asString();
                        if(state.equals("reload-required"))
                        {
                            instance.setFlag(ServerFlag.RELOAD_REQUIRED);
                        }
                        else if (state.equals("restart-required"))
                        {
                            instance.setFlag(ServerFlag.RESTART_REQUIRED);
                        }
                    }

                }
View Full Code Here

            }
        });
    }

    private ServerInstance createInstanceModel(Server handle) {
        ServerInstance instance = factory.serverInstance().as();
        instance.setName(handle.getName());
        instance.setServer(handle.getName());
        instance.setGroup(handle.getGroup());
        return instance;
    }
View Full Code Here

                        if(!serverSelection.hasSetServer())
                        {
                            if(!server.isEmpty())
                            {
                                final ServerInstance serverInstance = server.get(0);
                                Console.info("Default server selection: " + serverInstance.getName());

                                Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                                    @Override
                                    public void execute() {
View Full Code Here

                                @Override
                                public void onFailure(Throwable caught) {
                                    numResponses++;

                                    ServerInstance instance = createInstanceModel(handle);
                                    instance.setRunning(false);
                                    instanceList.add(instance);

                                    checkComplete(instanceList, cb);
                                }

                                @Override
                                public void onSuccess(DMRResponse result) {

                                    numResponses++;

                                    ModelNode statusResponse = result.get();
                                    ModelNode payload = statusResponse.get(RESULT);

                                    ServerInstance instance = createInstanceModel(handle);
                                    instanceList.add(instance);

                                    if(statusResponse.isFailure())
                                    {
                                        instance.setRunning(false);
                                    }
                                    else
                                    {
                                        instance.setRunning(handle.isStarted());

                                        if(payload.hasDefined("server-state"))
                                        {
                                            String state = payload.get("server-state").asString();
                                            if(state.equals("reload-required"))
                                            {
                                                instance.setFlag(ServerFlag.RELOAD_REQUIRED);
                                            }
                                            else if (state.equals("restart-required"))
                                            {
                                                instance.setFlag(ServerFlag.RESTART_REQUIRED);
                                            }
                                        }

                                    }
View Full Code Here

        dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {


            @Override
            public void onFailure(Throwable caught) {
                ServerInstance instance = createInstanceModel(handle);
                instance.setRunning(false);
                callback.onSuccess(instance);
            }

            @Override
            public void onSuccess(DMRResponse result) {

                ModelNode statusResponse = result.get();
                ModelNode payload = statusResponse.get(RESULT);

                ServerInstance instance = createInstanceModel(handle);

                if(statusResponse.isFailure())
                {
                    instance.setRunning(false);
                }
                else
                {
                    instance.setRunning(handle.isStarted());

                    if(payload.hasDefined("server-state"))
                    {
                        String state = payload.get("server-state").asString();
                        if(state.equals("reload-required"))
                        {
                            instance.setFlag(ServerFlag.RELOAD_REQUIRED);
                        }
                        else if (state.equals("restart-required"))
                        {
                            instance.setFlag(ServerFlag.RESTART_REQUIRED);
                        }
                    }

                }
View Full Code Here

            }
        });
    }

    private ServerInstance createInstanceModel(Server handle) {
        ServerInstance instance = factory.serverInstance().as();
        instance.setName(handle.getName());
        instance.setServer(handle.getName());
        instance.setGroup(handle.getGroup());
        return instance;
    }
View Full Code Here

                        if(!serverSelection.hasSetServer())
                        {
                            if(!server.isEmpty())
                            {
                                final ServerInstance serverInstance = server.get(0);
                                Console.info("Default server selection: " + serverInstance.getName());

                                Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                                    @Override
                                    public void execute() {
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.domain.model.ServerInstance

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.