use of org.wildfly.swarm.spi.api.config.ConfigKey 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.config.ConfigKey in project wildfly-swarm by wildfly-swarm.
the class NetworkConfigurer method applyConfiguration.
protected void applyConfiguration(ConfigKey root, OutboundSocketBinding binding) {
ConfigKey key = root.append(binding.name());
applyConfiguration(key.append("remote-host"), (host) -> {
binding.remoteHost(host.toString());
});
applyConfiguration(key.append("remote-port"), (port) -> {
binding.remotePort(port.toString());
});
}
use of org.wildfly.swarm.spi.api.config.ConfigKey in project wildfly-swarm by wildfly-swarm.
the class NetworkConfigurer method fixGroup.
protected void fixGroup(SocketBindingGroup group) {
ConfigKey key = ROOT.append(group.name());
int offset = this.configView.resolve(SWARM.append("port", "offset")).as(Integer.class).withDefault(0).getValue();
group.portOffset(offset);
applyConfiguration(key.append("port-offset"), (portOffset) -> {
group.portOffset(portOffset.toString());
});
applyConfiguration(key.append("default-interface"), (defaultInterface) -> {
group.defaultInterface(defaultInterface.toString());
});
}
use of org.wildfly.swarm.spi.api.config.ConfigKey in project wildfly-swarm by wildfly-swarm.
the class NetworkConfigurer method fixOutboundSocketBindings.
protected void fixOutboundSocketBindings(SocketBindingGroup group) {
ConfigKey key = ROOT.append(group.name()).append("outbound-socket-bindings");
List<SimpleKey> names = this.configView.simpleSubkeys(key);
names.stream().map(e -> e.name()).map(name -> group.outboundSocketBindings().stream().filter(e -> e.name().equals(name)).findFirst().orElseGet(() -> {
OutboundSocketBinding binding = new OutboundSocketBinding(name);
group.outboundSocketBinding(binding);
return binding;
})).forEach(e -> {
applyConfiguration(key, e);
});
}
use of org.wildfly.swarm.spi.api.config.ConfigKey in project wildfly-swarm by wildfly-swarm.
the class SocketBindingGroupExtension method applyConfiguration.
@Override
protected void applyConfiguration(SocketBindingGroup instance) {
ConfigKey key = ROOT.append(instance.name());
applyConfiguration(key.append("port-offset"), (offset) -> {
instance.portOffset(offset.toString());
});
applyConfiguration(key.append("default-interface"), (offset) -> {
instance.portOffset(offset.toString());
});
}
Aggregations