use of org.wildfly.swarm.spi.api.SocketBinding in project wildfly-swarm by wildfly-swarm.
the class UndertowSocketBindingsCustomizerTest method testDefaultPorts.
@Test
public void testDefaultPorts() {
UndertowSocketBindingsCustomizer customizer = new UndertowSocketBindingsCustomizer();
customizer.fraction = new UndertowFraction();
customizer.group = new SocketBindingGroup("standard-sockets", "public", "0");
customizer.customize();
assertThat(customizer.group.socketBindings()).hasSize(2);
SocketBinding http = customizer.group.socketBinding("http");
assertThat(http).isNotNull();
assertThat(http.portExpression()).isEqualTo("8080");
SocketBinding https = customizer.group.socketBinding("https");
assertThat(https).isNotNull();
assertThat(https.portExpression()).isEqualTo("8443");
}
use of org.wildfly.swarm.spi.api.SocketBinding in project wildfly-swarm by wildfly-swarm.
the class UndertowSocketBindingsCustomizerTest method testExplicitHttpsPort.
@Test
public void testExplicitHttpsPort() {
UndertowSocketBindingsCustomizer customizer = new UndertowSocketBindingsCustomizer();
customizer.fraction = new UndertowFraction();
customizer.fraction.httpsPort(8675);
customizer.group = new SocketBindingGroup("standard-sockets", "public", "0");
customizer.customize();
assertThat(customizer.group.socketBindings()).hasSize(2);
SocketBinding http = customizer.group.socketBinding("http");
assertThat(http).isNotNull();
assertThat(http.portExpression()).isEqualTo("8080");
SocketBinding https = customizer.group.socketBinding("https");
assertThat(https).isNotNull();
assertThat(https.portExpression()).isEqualTo("8675");
}
use of org.wildfly.swarm.spi.api.SocketBinding in project wildfly-swarm by wildfly-swarm.
the class ManagementSocketBindingsCustomizer method customize.
public void customize() {
this.group.socketBinding(new SocketBinding("management-http").iface(iface.get()).port(fraction.httpPort()));
this.group.socketBinding(new SocketBinding("management-https").port(fraction.httpsPort()));
if (fraction.isHttpDisable()) {
fraction.httpInterfaceManagementInterface((HTTPInterfaceManagementInterface<?>) null);
}
}
use of org.wildfly.swarm.spi.api.SocketBinding in project wildfly-swarm by wildfly-swarm.
the class NetworkConfigurer method fixSocketBindings.
protected void fixSocketBindings(SocketBindingGroup group) {
ConfigKey key = ROOT.append(group.name()).append("socket-bindings");
List<SimpleKey> names = this.configView.simpleSubkeys(key);
names.stream().map(e -> e.name()).map(name -> group.socketBindings().stream().filter(e -> e.name().equals(name)).findFirst().orElseGet(() -> {
SocketBinding binding = new SocketBinding(name);
group.socketBinding(binding);
return binding;
})).forEach(e -> {
applyConfiguration(key, e);
});
}
use of org.wildfly.swarm.spi.api.SocketBinding in project wildfly-swarm by wildfly-swarm.
the class SocketBindingGroupMarshaller method marshal.
public void marshal(List<ModelNode> list) {
for (SocketBindingGroup group : this.socketBindingGroups) {
PathAddress address = PathAddress.pathAddress("socket-binding-group", group.name());
ModelNode node = new ModelNode();
node.get(OP).set(ADD);
node.get(OP_ADDR).set(address.toModelNode());
node.get(DEFAULT_INTERFACE).set(group.defaultInterface());
node.get(PORT_OFFSET).set(new ValueExpression(group.portOffsetExpression()));
LinkedList<ModelNode> subList = new LinkedList<>();
subList.add(node);
for (SocketBinding binding : group.socketBindings()) {
configureSocketBinding(address, binding, subList);
}
for (OutboundSocketBinding binding : group.outboundSocketBindings()) {
configureSocketBinding(address, binding, subList);
}
if (!isAlreadyConfigured(subList, list)) {
list.addAll(subList);
}
}
}
Aggregations