Search in sources :

Example 21 with ServerConnection

use of com.hazelcast.internal.server.ServerConnection in project hazelcast by hazelcast.

the class UnifiedProtocolEncoder method initChannelForCluster.

private void initChannelForCluster() {
    channel.options().setOption(SO_SNDBUF, props.getInteger(SOCKET_SEND_BUFFER_SIZE) * KILO_BYTE);
    ServerConnection connection = (TcpServerConnection) channel.attributeMap().get(ServerConnection.class);
    OutboundHandler[] handlers = serverContext.createOutboundHandlers(EndpointQualifier.MEMBER, connection);
    channel.outboundPipeline().replace(this, handlers);
}
Also used : OutboundHandler(com.hazelcast.internal.networking.OutboundHandler) ServerConnection(com.hazelcast.internal.server.ServerConnection)

Example 22 with ServerConnection

use of com.hazelcast.internal.server.ServerConnection in project hazelcast by hazelcast.

the class ClientBwListConfigHandlerTest method testApplyConfig_emptyWhitelist_doesNotDisconnectMCClient.

@Test
public void testApplyConfig_emptyWhitelist_doesNotDisconnectMCClient() {
    handler.applyConfig(createConfig(Mode.WHITELIST));
    ServerConnection mockConnection = mock(ServerConnection.class);
    when(mockConnection.getConnectionType()).thenReturn(ConnectionType.MC_JAVA_CLIENT);
    ClientEndpointImpl mcClient = new ClientEndpointImpl(clientEngine, getNodeEngineImpl(instance), mockConnection);
    assertTrue(clientEngine.isClientAllowed(mcClient));
}
Also used : ServerConnection(com.hazelcast.internal.server.ServerConnection) ClientEndpointImpl(com.hazelcast.client.impl.ClientEndpointImpl) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

ServerConnection (com.hazelcast.internal.server.ServerConnection)22 Address (com.hazelcast.cluster.Address)6 ClientMessageDecoder (com.hazelcast.client.impl.protocol.util.ClientMessageDecoder)2 InboundHandler (com.hazelcast.internal.networking.InboundHandler)2 OutboundHandler (com.hazelcast.internal.networking.OutboundHandler)2 ServerConnectionManager (com.hazelcast.internal.server.ServerConnectionManager)2 TcpServerConnection (com.hazelcast.internal.server.tcp.TcpServerConnection)2 Operation (com.hazelcast.spi.impl.operationservice.Operation)2 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)2 QuickTest (com.hazelcast.test.annotation.QuickTest)2 UUID (java.util.UUID)2 Test (org.junit.Test)2 ClientEndpointImpl (com.hazelcast.client.impl.ClientEndpointImpl)1 ClientMessageEncoder (com.hazelcast.client.impl.protocol.util.ClientMessageEncoder)1 ClusterState (com.hazelcast.cluster.ClusterState)1 MemberImpl (com.hazelcast.cluster.impl.MemberImpl)1 EndpointConfig (com.hazelcast.config.EndpointConfig)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 HazelcastInstanceNotActiveException (com.hazelcast.core.HazelcastInstanceNotActiveException)1 CPGroup (com.hazelcast.cp.CPGroup)1