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

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


                List<ModelNode> payload = response.get("result").asList();

                List<Server> records = new ArrayList<Server>(payload.size());
                for(ModelNode item : payload)
                {
                    Server record = factory.server().as();

                    ModelNode server = item.asProperty().getValue();

                    record.setName(server.get("name").asString());
                    record.setGroup(server.get("group").asString());
                    record.setSocketBinding(server.get("socket-binding-group").asString());

                    try {
                        record.setPortOffset(server.get("socket-binding-port-offset").asInt());
                    } catch (IllegalArgumentException e) {
                        //
                    }

                    try {
                        record.setAutoStart(server.get("auto-start").asBoolean());
                    } catch (IllegalArgumentException e) {
                        // TODO: https://issues.jboss.org/browse/JBAS-9163

                    }

                    record.setStarted(server.get("status").asString().equals("STARTED"));

                    try {
                        if(server.get("jvm").isDefined())
                        {
                            ModelNode jvm = server.get("jvm").asObject();
                            record.setJvm(jvm.keys().iterator().next()); // TODO: does blow up easily
                        }
                    } catch (IllegalArgumentException e) {
                        // ignore
                    }
                    records.add(record);
View Full Code Here


                    List<Server> records = new LinkedList<Server>();
                    for(ModelNode item : serverConfigModel)
                    {
                        ModelNode model = item.asProperty().getValue();
                        Server server = serverAdapter.fromDMR(model);
                        server.setStarted(model.get("status").asString().equals("STARTED"));
                        server.setProfile(group2profile.get(server.getGroup()));
                        records.add(server);
                    }

                    // group profiles
View Full Code Here

            public void onSuccess(DMRResponse result) {

                ModelNode response = result.get();
                ModelNode model = response.get("result").asObject();

                Server server = serverAdapter.fromDMR(model);
                server.setStarted(model.get("status").asString().equals("STARTED"));

                callback.onSuccess(server);
            }

        });
View Full Code Here

        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
        deleteBtn.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent clickEvent) {

                final Server server = getSelectionModel().getSelectedObject();

                Feedback.confirm(
                        Console.MESSAGES.deleteServerConfig(),
                        Console.MESSAGES.deleteServerConfigConfirm(server.getName()),
                        new Feedback.ConfirmationHandler() {
                            @Override
                            public void onConfirmation(boolean isConfirmed) {
                                if(isConfirmed)
                                    presenter.tryDelete(server);
                            }
                        });
            }
        });

        deleteBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_delete_serverConfigView());
        toolStrip.addToolButtonRight(deleteBtn);


        ToolButton copyBtn = new ToolButton(Console.CONSTANTS.common_label_copy());
        copyBtn.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent clickEvent) {

                final Server server = getSelectionModel().getSelectedObject();
                presenter.onLaunchCopyWizard(server);
            }
        });

        toolStrip.addToolButtonRight(copyBtn);

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

        // Create columns
        Column<Server, String> nameColumn = new Column<Server, String>(new TextCell()) {
            @Override
            public String getValue(Server object) {
                return object.getName();
            }
        };


        Column<Server, String> groupColumn = new Column<Server, String>(new TextCell()) {
            @Override
            public String getValue(Server object) {
                return object.getGroup();
            }
        };


        serverConfigTable.addColumn(nameColumn, "Configuration Name");
        serverConfigTable.addColumn(groupColumn, Console.CONSTANTS.common_label_serverGroup());


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


        details = new ServerConfigDetails(presenter);

        // jvm editor
        jvmEditor = new JvmEditor(presenter, true, true);
        jvmEditor.setAddressCallback(new FormHelpPanel.AddressCallback() {
            @Override
            public ModelNode getAddress() {

                ModelNode address = new ModelNode();
                address.add("host", presenter.getSelectedHost());
                address.add("server-config", "*");
                address.add("jvm", "*");
                return address;
            }
        });

        propertyEditor = new PropertyEditor(presenter);

        portsView = new PortsView();


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


        MultipleToOneLayout layout = new MultipleToOneLayout()
                .setTitle(Console.CONSTANTS.common_label_serverGroupConfigurations())
                .setHeadline("Server Configurations")
                .setDescription(Console.CONSTANTS.common_serverConfig_desc())
                .setMaster(Console.MESSAGES.available(Console.CONSTANTS.common_label_serverConfigs()), serverConfigTable)
                .setMasterTools(toolStrip.asWidget())
                .addDetail("Attributes", details.asWidget())
                .addDetail(Console.CONSTANTS.common_label_virtualMachine(), jvmEditor.asWidget())
                .addDetail(Console.CONSTANTS.common_label_systemProperties(), propertyEditor.asWidget());


        details.bind(serverConfigTable);

        serverConfigTable.getSelectionModel().addSelectionChangeHandler(
                new SelectionChangeEvent.Handler() {
                    @Override
                    public void onSelectionChange(SelectionChangeEvent selectionChangeEvent) {
                        Server server = getSelectionModel().getSelectedObject();
                        presenter.loadJVMConfiguration(server);
                        presenter.loadProperties(server);
                        presenter.loadPorts(server);
                    }
                });
View Full Code Here

            @Override
            public void onSuccess(List<Server> serverConfigs) {

                if (serverConfigs.isEmpty()) {
                    // no server at all on this host
                    Server blank = factory.server().as();
                    blank.setName("not-set");
                    callback.onSuccess(new ServerConfigList(blank, Collections.EMPTY_LIST));
                } else {
                    Server s = getSelectedServerConfig(serverConfigs);
                    callback.onSuccess(new ServerConfigList(s, serverConfigs));
                }
            }
        });
    }
View Full Code Here

    }

    private Server getSelectedServerConfig(List<Server> serverConfigs) {
        assert !serverConfigs.isEmpty();

        Server matched = null;

        // match by preselection
        for(Server s : serverConfigs)
        {
            if(s.getName().equals(selectedServer))
            {
                matched = s;
                break;
            }
        }

        // fallback match
        if(null==matched)
            matched = serverConfigs.get(0);

        selectedServer = matched.getName();

        return matched;
    }
View Full Code Here

        // ---

        ClickHandler saveHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                final Server newServer = form.getUpdatedEntity();

                FormValidation validation = form.validate();
                if (validation.hasErrors())
                    return;

                // merge inherited values
                ServerGroupRecord selectedGroup =
                        getSelectedServerGroup(serverGroups, newServer.getGroup());
                newServer.setSocketBinding(selectedGroup.getSocketBinding());
                newServer.setJvm(null);//newServer.setJvm(selectedGroup.getJvm());
                newServer.setProperties(Collections.EMPTY_LIST);
                Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                    @Override
                    public void execute() {
                        presenter.createServerConfig(newServer);
                    }
View Full Code Here

        // ---

        ClickHandler saveHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                final Server newServer = form.getUpdatedEntity();

                FormValidation validation = form.validate();
                if (!validation.hasErrors())
                {
                    presenter.onSaveCopy(hostItem.getValue(), original, newServer);
View Full Code Here

        ToolButton delete = new ToolButton(Console.CONSTANTS.common_label_delete());
        delete.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent clickEvent) {

                final Server server = getSelectionModel().getSelectedObject();

                Feedback.confirm(
                        Console.MESSAGES.deleteServerConfig(),
                        Console.MESSAGES.deleteServerConfigConfirm(server.getName()),
                        new Feedback.ConfirmationHandler() {
                            @Override
                            public void onConfirmation(boolean isConfirmed) {
                                if(isConfirmed)
                                    presenter.tryDelete(server);
                            }
                        });
            }
        });

        toolStrip.addToolButtonRight(delete);

        layout.add(toolStrip);

        // ---

        VerticalPanel panel = new VerticalPanel();
        panel.setStyleName("rhs-content-panel");

        ScrollPanel scrollPanel = new ScrollPanel(panel);
        layout.add(scrollPanel);

        layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 40, Style.Unit.PX);
        layout.setWidgetTopHeight(toolStrip, 40, Style.Unit.PX, 30, Style.Unit.PX);
        layout.setWidgetTopHeight(scrollPanel, 70, Style.Unit.PX, 100, Style.Unit.PCT);


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

        // table

        panel.add(new ContentHeaderLabel("Available Server Configurations"));
        panel.add(new ContentDescription("A server configuration does specify the overall configuration of a server. A server configuration can be started and perform work. Server configurations belong to server groups."));

        // Create columns
        Column<Server, String> nameColumn = new Column<Server, String>(new TextCell()) {
            @Override
            public String getValue(Server object) {
                return object.getName();
            }
        };


        Column<Server, String> groupColumn = new Column<Server, String>(new TextCell()) {
            @Override
            public String getValue(Server object) {
                return object.getGroup();
            }
        };


        serverConfigTable.addColumn(nameColumn, "Configuration Name");
        serverConfigTable.addColumn(groupColumn, Console.CONSTANTS.common_label_serverGroup());

        panel.add(serverConfigTable);

        DefaultPager pager = new DefaultPager();
        pager.setDisplay(serverConfigTable);
        panel.add(pager);


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

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

        // details

        details = new ServerConfigDetails(presenter);
        bottomLayout.add(details.asWidget(), "Attributes");
        details.bind(serverConfigTable);

        // jvm editor
        jvmEditor = new JvmEditor(presenter);
        jvmEditor.setAddressCallback(new FormHelpPanel.AddressCallback() {
            @Override
            public ModelNode getAddress() {

                ModelNode address = new ModelNode();
                address.add("host", presenter.getSelectedHost());
                address.add("server-config", "*");
                address.add("jvm", "*");
                return address;
            }
        });
        bottomLayout.add(jvmEditor.asWidget(), Console.CONSTANTS.common_label_virtualMachine());

        propertyEditor = new PropertyEditor(presenter);
        propertyEditor.setHelpText("A system property to set on this server.");
        bottomLayout.add(propertyEditor.asWidget(), Console.CONSTANTS.common_label_systemProperties());
        propertyEditor.setAllowEditProps(false);

        portsView = new PortsView();
        //bottomLayout.add(portsView.asWidget(), "Ports");

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

        panel.add(new ContentGroupLabel("Server Configuration"));
        panel.add(bottomLayout);

        bottomLayout.selectTab(0);


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


        serverConfigTable.getSelectionModel().addSelectionChangeHandler(
                new SelectionChangeEvent.Handler() {
            @Override
            public void onSelectionChange(SelectionChangeEvent selectionChangeEvent) {
                Server server = getSelectionModel().getSelectedObject();
                presenter.loadJVMConfiguration(server);
                presenter.loadProperties(server);
                presenter.loadPorts(server);
            }
        });
View Full Code Here

                List<Server> records = new LinkedList<Server>();
                for(ModelNode item : payload)
                {
                    ModelNode model = item.asProperty().getValue();
                    Server server = serverAdapter.fromDMR(model);
                    server.setStarted(model.get("status").asString().equals("STARTED"));
                    records.add(server);
                }


                callback.onSuccess(records);
View Full Code Here

TOP

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

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.