Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAL-1975: add pages for remoting profile children #1145

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ interface AddressTemplates {
String EJB_SUBSYSTEM_ADDRESS = "/{selected.profile}/subsystem=ejb3";
String THREAD_POOL_ADDRESS = EJB_SUBSYSTEM_ADDRESS + "/thread-pool=*";
String REMOTING_PROFILE_ADDRESS = EJB_SUBSYSTEM_ADDRESS + "/remoting-profile=*";
String REMOTING_EJB_RECEIVER_ADDRESS = REMOTING_PROFILE_ADDRESS + "/remoting-ejb-receiver=*";
String REMOTE_HTTP_CONNECTION_ADDRESS = REMOTING_PROFILE_ADDRESS + "/remote-http-connection=*";
String RER_CHANNEL_CREATION_OPTIONS_ADDRESS = REMOTING_EJB_RECEIVER_ADDRESS + "/channel-creation-options=*";

// bean pools
String BEAN_POOL_ADDRESS = EJB_SUBSYSTEM_ADDRESS + "/strict-max-bean-instance-pool=*";
Expand All @@ -45,6 +48,9 @@ interface AddressTemplates {
AddressTemplate EJB_SUBSYSTEM_TEMPLATE = AddressTemplate.of(EJB_SUBSYSTEM_ADDRESS);
AddressTemplate THREAD_POOL_TEMPLATE = AddressTemplate.of(THREAD_POOL_ADDRESS);
AddressTemplate REMOTING_PROFILE_TEMPLATE = AddressTemplate.of(REMOTING_PROFILE_ADDRESS);
AddressTemplate REMOTING_EJB_RECEIVER_TEMPLATE = AddressTemplate.of(REMOTING_EJB_RECEIVER_ADDRESS);
AddressTemplate REMOTE_HTTP_CONNECTION_TEMPLATE = AddressTemplate.of(REMOTE_HTTP_CONNECTION_ADDRESS);
AddressTemplate RER_CHANNEL_CREATION_OPTIONS_TEMPLATE = AddressTemplate.of(RER_CHANNEL_CREATION_OPTIONS_ADDRESS);

AddressTemplate BEAN_POOL_TEMPLATE = AddressTemplate.of(BEAN_POOL_ADDRESS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.jboss.hal.client.configuration.subsystem.ejb;

import java.util.List;

import javax.inject.Inject;

import org.jboss.hal.core.CrudOperations;
Expand All @@ -27,6 +29,7 @@
import org.jboss.hal.dmr.ModelDescriptionConstants;
import org.jboss.hal.dmr.ModelNode;
import org.jboss.hal.dmr.ResourceAddress;
import org.jboss.hal.meta.AddressTemplate;
import org.jboss.hal.meta.StatementContext;
import org.jboss.hal.meta.token.NameTokens;
import org.jboss.hal.spi.Requires;
Expand All @@ -38,6 +41,9 @@

import static org.jboss.hal.client.configuration.subsystem.ejb.AddressTemplates.EJB_SUBSYSTEM_ADDRESS;
import static org.jboss.hal.client.configuration.subsystem.ejb.AddressTemplates.EJB_SUBSYSTEM_TEMPLATE;
import static org.jboss.hal.client.configuration.subsystem.ejb.AddressTemplates.REMOTING_EJB_RECEIVER_TEMPLATE;
import static org.jboss.hal.client.configuration.subsystem.ejb.AddressTemplates.REMOTING_PROFILE_TEMPLATE;
import static org.jboss.hal.client.configuration.subsystem.ejb.AddressTemplates.RER_CHANNEL_CREATION_OPTIONS_TEMPLATE;

public class EjbPresenter
extends MbuiPresenter<EjbPresenter.MyView, EjbPresenter.MyProxy>
Expand Down Expand Up @@ -79,7 +85,41 @@ public FinderPath finderPath() {

@Override
protected void reload() {
crud.readRecursive(EJB_SUBSYSTEM_TEMPLATE, result -> getView().update(result));
crud.read(EJB_SUBSYSTEM_TEMPLATE, 1, result -> getView().update(result));
}

public void loadRemotingProfileChild(String remotingProfileName, String childType) {
crud.readRecursive(REMOTING_PROFILE_TEMPLATE.resolve(statementContext, remotingProfileName),
result -> getView().updateRemotingProfileChild(remotingProfileName, childType, result));
}

public void addRemotingProfileChild(String id, String label, String remotingProfileName, String childType,
AddressTemplate template) {
crud.add(id, label, template.replaceWildcards(remotingProfileName),
(name, address) -> loadRemotingProfileChild(remotingProfileName, childType));
}

public void removeRemotingProfileChild(String label, String name, String remotingProfileName, String childType,
AddressTemplate template) {
crud.remove(label, name, template.replaceWildcards(remotingProfileName),
() -> loadRemotingProfileChild(remotingProfileName, childType));
}

public void loadRerChannelCreationOptions(String remotingProfileName, String ejbReceiverName) {
crud.readRecursive(
REMOTING_EJB_RECEIVER_TEMPLATE.resolve(statementContext, remotingProfileName, ejbReceiverName),
result -> getView().updateRerChannelCreationOptions(ejbReceiverName, result));
}

public void addRerChannelCreationOptions(String id, String label, String remotingProfileName, String ejbReceiverName) {
crud.add(id, label, RER_CHANNEL_CREATION_OPTIONS_TEMPLATE.replaceWildcards(remotingProfileName, ejbReceiverName),
List.of(ModelDescriptionConstants.VALUE),
(name, address) -> loadRerChannelCreationOptions(remotingProfileName, ejbReceiverName));
}

public void removeRerChannelCreationOptions(String label, String name, String remotingProfileName, String ejbReceiverName) {
crud.remove(label, name, RER_CHANNEL_CREATION_OPTIONS_TEMPLATE.replaceWildcards(remotingProfileName, ejbReceiverName),
() -> loadRerChannelCreationOptions(remotingProfileName, ejbReceiverName));
}

// @formatter:off
Expand All @@ -91,6 +131,8 @@ public interface MyProxy extends ProxyPlace<EjbPresenter> {

public interface MyView extends MbuiView<EjbPresenter> {
void update(ModelNode payload);
void updateRemotingProfileChild(String remotingProfileName, String childType, ModelNode payload);
void updateRerChannelCreationOptions(String ejbReceiverName, ModelNode payload);
}
// @formatter:on
}
Loading