Search in sources :

Example 1 with IpFilterConfiguration

use of org.infinispan.server.core.configuration.IpFilterConfiguration in project infinispan by infinispan.

the class SinglePortRouterBuilder method build.

/**
 * Builds {@link HotRodRouterConfiguration}.
 */
public SinglePortRouterConfiguration build() {
    if (this.enabled) {
        try {
            validate();
        } catch (Exception e) {
            throw RouterLogger.SERVER.configurationValidationError(e);
        }
        SslConfigurationBuilder sslConfigurationBuilder = new SslConfigurationBuilder(null);
        if (sslContext != null) {
            sslConfigurationBuilder.sslContext(sslContext).enable();
        }
        AttributeSet attributes = SinglePortRouterConfiguration.attributeDefinitionSet();
        attributes.attribute(ProtocolServerConfiguration.NAME).set(name);
        attributes.attribute(ProtocolServerConfiguration.HOST).set(ip.getHostName());
        attributes.attribute(ProtocolServerConfiguration.PORT).set(port);
        attributes.attribute(ProtocolServerConfiguration.IDLE_TIMEOUT).set(100);
        attributes.attribute(ProtocolServerConfiguration.RECV_BUF_SIZE).set(receiveBufferSize);
        attributes.attribute(ProtocolServerConfiguration.SEND_BUF_SIZE).set(sendBufferSize);
        return new SinglePortRouterConfiguration(attributes.protect(), sslConfigurationBuilder.create(), new IpFilterConfiguration(Collections.emptyList()));
    }
    return null;
}
Also used : SslConfigurationBuilder(org.infinispan.server.core.configuration.SslConfigurationBuilder) AttributeSet(org.infinispan.commons.configuration.attributes.AttributeSet) IpFilterConfiguration(org.infinispan.server.core.configuration.IpFilterConfiguration) SinglePortRouterConfiguration(org.infinispan.server.router.configuration.SinglePortRouterConfiguration)

Aggregations

AttributeSet (org.infinispan.commons.configuration.attributes.AttributeSet)1 IpFilterConfiguration (org.infinispan.server.core.configuration.IpFilterConfiguration)1 SslConfigurationBuilder (org.infinispan.server.core.configuration.SslConfigurationBuilder)1 SinglePortRouterConfiguration (org.infinispan.server.router.configuration.SinglePortRouterConfiguration)1