use of com.hazelcast.cluster.Address in project hazelcast by hazelcast.
the class DummyClientReplicatedMapTest method getClientConfig.
private ClientConfig getClientConfig(HazelcastInstance instance) {
Address address = instance.getCluster().getLocalMember().getAddress();
String addressString = address.getHost() + ":" + address.getPort();
ClientConfig dummyClientConfig = new ClientConfig();
ClientNetworkConfig networkConfig = new ClientNetworkConfig();
networkConfig.setSmartRouting(false);
networkConfig.addAddress(addressString);
dummyClientConfig.setNetworkConfig(networkConfig);
return dummyClientConfig;
}
use of com.hazelcast.cluster.Address in project hazelcast by hazelcast.
the class ClientTestSupport method blockMessagesFromInstance.
/**
* Blocks incoming messages to client from given instance
*/
protected void blockMessagesFromInstance(HazelcastInstance instance, HazelcastInstance client) {
HazelcastClientInstanceImpl clientImpl = getHazelcastClientInstanceImpl(client);
ClientConnectionManager connectionManager = clientImpl.getConnectionManager();
Address address = instance.getCluster().getLocalMember().getAddress();
((TestClientRegistry.MockTcpClientConnectionManager) connectionManager).blockFrom(address);
}
use of com.hazelcast.cluster.Address in project hazelcast by hazelcast.
the class ClientTestSupport method unblockMessagesToInstance.
/**
* Unblocks outgoing messages from client to given instance
*/
protected void unblockMessagesToInstance(HazelcastInstance instance, HazelcastInstance client) {
HazelcastClientInstanceImpl clientImpl = getHazelcastClientInstanceImpl(client);
ClientConnectionManager connectionManager = clientImpl.getConnectionManager();
Address address = instance.getCluster().getLocalMember().getAddress();
((TestClientRegistry.MockTcpClientConnectionManager) connectionManager).unblockTo(address);
}
use of com.hazelcast.cluster.Address in project hazelcast by hazelcast.
the class ClientTestSupport method unblockMessagesFromInstance.
/**
* Unblocks incoming messages to client from given instance
*/
protected void unblockMessagesFromInstance(HazelcastInstance instance, HazelcastInstance client) {
HazelcastClientInstanceImpl clientImpl = getHazelcastClientInstanceImpl(client);
ClientConnectionManager connectionManager = clientImpl.getConnectionManager();
Address address = instance.getCluster().getLocalMember().getAddress();
((TestClientRegistry.MockTcpClientConnectionManager) connectionManager).unblockFrom(address);
}
use of com.hazelcast.cluster.Address in project hazelcast by hazelcast.
the class SplitBrainProtectionTestUtil method getClientConfig.
public static ClientConfig getClientConfig(HazelcastInstance instance) {
ClientConfig clientConfig = new ClientConfig();
Address address = getNode(instance).address;
clientConfig.getNetworkConfig().addAddress(address.getHost() + ":" + address.getPort());
clientConfig.getNetworkConfig().setSmartRouting(false);
clientConfig.setClusterName(instance.getConfig().getClusterName());
return clientConfig;
}
Aggregations