@Override public HotRodServerConfiguration build() { return build(true); }
@Override public HotRodServerChildConfigurationBuilder proxyPort(int proxyPort) { return builder.proxyPort(proxyPort); }
@Override public HotRodServer createStartHotRodServer(EmbeddedCacheManager cacheManager) { SimpleServerAuthenticationProvider ssap = new SimpleServerAuthenticationProvider(); ssap.addUser("user", "realm", "password".toCharArray()); HotRodServerConfigurationBuilder builder = new HotRodServerConfigurationBuilder(); builder.authentication().enable().addAllowedMech("CRAM-MD5").serverAuthenticationProvider(ssap) .serverName("localhost").addMechProperty(Sasl.POLICY_NOANONYMOUS, "true"); return startHotRodServer(cacheManager, HotRodTestingUtil.serverPort(), 0, builder); }
public void testMutatePortAndHost() { HotRodServerConfigurationBuilder builder = new HotRodServerConfigurationBuilder(); builder.host("foo").port(1234); assertHostPort(builder.build(), "foo", 1234); builder.host("bar").port(4321); assertHostPort(builder.build(), "bar", 4321); }
public static HotRodServerConfigurationBuilder getDefaultHotRodConfiguration() { HotRodServerConfigurationBuilder builder = new HotRodServerConfigurationBuilder(); int port = serverPort(); builder.host(host()).port(port).proxyHost(host()).proxyPort(port); return builder; }
public static HotRodServer startHotRodServer(EmbeddedCacheManager manager, int port, int idleTimeout, String proxyHost, int proxyPort, long delay, String defaultCacheName) { HotRodServerConfigurationBuilder builder = new HotRodServerConfigurationBuilder(); builder.proxyHost(proxyHost).proxyPort(proxyPort).idleTimeout(idleTimeout).defaultCacheName(defaultCacheName); return startHotRodServer(manager, port, delay, builder); }
private void assertHostPort(HotRodServerConfiguration configuration, String host, int port) { assertEquals(configuration.host(), host); assertEquals(configuration.proxyHost(), null); assertEquals(configuration.publicHost(), host); assertEquals(configuration.port(), port); assertEquals(configuration.proxyPort(), -1); assertEquals(configuration.publicPort(), port); } }
@Override public Builder<?> read(AuthenticationConfiguration template) { this.enabled = template.enabled(); this.allowedMechs.clear(); this.allowedMechs.addAll(template.allowedMechs()); this.serverAuthenticationProvider = template.serverAuthenticationProvider(); this.mechProperties = template.mechProperties(); this.serverName = template.serverName(); return this; }
public Authentication(Channel channel, HotRodServer server) { this.channel = channel; this.server = server; serverConfig = server.getConfiguration(); authenticationConfig = serverConfig.authentication(); enabled = authenticationConfig.enabled(); requireAuthentication = !authenticationConfig.mechProperties().containsKey(Sasl.POLICY_NOANONYMOUS) || authenticationConfig.mechProperties().get(Sasl.POLICY_NOANONYMOUS).equals("true"); }
@Override public HotRodServerConfigurationBuilder read(HotRodServerConfiguration template) { super.read(template); this.authentication.read(template.authentication()); return this; }
@Override public HotRodServerConfiguration create() { return new HotRodServerConfiguration(attributes.protect(), ssl.create(), authentication.create()); }
@Override public HotRodServerChildConfigurationBuilder topologyLockTimeout(long topologyLockTimeout) { return builder.topologyLockTimeout(topologyLockTimeout); }
@Override public HotRodServerChildConfigurationBuilder topologyAwaitInitialTransfer(boolean topologyAwaitInitialTransfer) { return builder.topologyAwaitInitialTransfer(topologyAwaitInitialTransfer); }
@Override public AuthenticationConfigurationBuilder authentication() { return builder.authentication(); }
@Override public HotRodServerChildConfigurationBuilder proxyHost(String proxyHost) { return builder.proxyHost(proxyHost); }
@Override public HotRodServerChildConfigurationBuilder topologyReplTimeout(long topologyReplTimeout) { return builder.topologyReplTimeout(topologyReplTimeout); }
@Override public HotRodServerChildConfigurationBuilder topologyStateTransfer(boolean topologyStateTransfer) { return builder.topologyStateTransfer(topologyStateTransfer); }
public HotRodServerConfigurationBuilder() { super(11222, HotRodServerConfiguration.attributeDefinitionSet()); }
@Override public AuthenticationConfiguration create() { return new AuthenticationConfiguration(enabled, Collections.unmodifiableSet(allowedMechs), serverAuthenticationProvider, mechProperties, serverName, serverSubject); }