org.infinispan.server.configuration.ServerConfiguration Maven / Gradle / Ivy
package org.infinispan.server.configuration;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.infinispan.commons.configuration.BuiltBy;
import org.infinispan.configuration.parsing.ParserScope;
import org.infinispan.configuration.serializing.SerializedWith;
import org.infinispan.server.Server;
import org.infinispan.server.configuration.endpoint.EndpointsConfiguration;
import org.infinispan.server.configuration.security.SecurityConfiguration;
import org.infinispan.server.configuration.security.ServerTransportConfiguration;
/**
* @author Tristan Tarrant <[email protected]>
* @since 10.0
*/
@BuiltBy(ServerConfigurationBuilder.class)
@SerializedWith(value = ServerConfigurationSerializer.class, scope = ParserScope.GLOBAL)
public class ServerConfiguration {
final InterfacesConfiguration interfaces;
final SocketBindingsConfiguration socketBindings;
final SecurityConfiguration security;
final DataSourcesConfiguration dataSources;
final EndpointsConfiguration endpoints;
final ServerTransportConfiguration transport;
private Server server;
ServerConfiguration(
InterfacesConfiguration interfaces,
SocketBindingsConfiguration socketBindings,
SecurityConfiguration security,
DataSourcesConfiguration dataSources,
EndpointsConfiguration endpoints, ServerTransportConfiguration transport) {
this.interfaces = interfaces;
this.socketBindings = socketBindings;
this.security = security;
this.dataSources = dataSources;
this.endpoints = endpoints;
this.transport = transport;
}
public Map networkInterfaces() {
return interfaces.interfaces();
}
public Map socketBindings() {
return socketBindings.socketBindings();
}
public SecurityConfiguration security() {
return security;
}
public Map dataSources() {
return dataSources.dataSources().stream().collect(Collectors.toMap(DataSourceConfiguration::name, Function.identity()));
}
public EndpointsConfiguration endpoints() {
return endpoints;
}
public ServerTransportConfiguration transport() {
return transport;
}
public Server getServer() {
return server;
}
public void setServer(Server server) {
this.server = server;
}
}