Search in sources :

Example 6 with AdvancedNetworkConfig

use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.

the class LocalAddressRegistryIntegrationTest method createConfigForServer.

private Config createConfigForServer() {
    Config config = smallInstanceConfig();
    AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
    JoinConfig advancedJoinConfig = advancedNetworkConfig.getJoin();
    advancedJoinConfig.getTcpIpConfig().setEnabled(true);
    ServerSocketEndpointConfig memberServerSocketConfig = new ServerSocketEndpointConfig().setPort(SERVER_MEMBER_ADDRESS.getPort());
    memberServerSocketConfig.getInterfaces().addInterface(SERVER_MEMBER_ADDRESS.getHost());
    ServerSocketEndpointConfig clientServerSocketConfig = new ServerSocketEndpointConfig().setPort(SERVER_CLIENT_ADDRESS.getPort());
    clientServerSocketConfig.getInterfaces().addInterface(SERVER_CLIENT_ADDRESS.getHost());
    ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setName("wan").setPort(SERVER_WAN_ADDRESS.getPort());
    wanServerSocketConfig.getInterfaces().addInterface(SERVER_WAN_ADDRESS.getHost());
    memberServerSocketConfig.getInterfaces().addInterface("127.0.0.1");
    advancedNetworkConfig.setEnabled(true).setMemberEndpointConfig(memberServerSocketConfig).setClientEndpointConfig(clientServerSocketConfig).addWanEndpointConfig(wanServerSocketConfig);
    return config;
}
Also used : AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig) Config(com.hazelcast.config.Config) ServerSocketEndpointConfig(com.hazelcast.config.ServerSocketEndpointConfig) AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig) ServerSocketEndpointConfig(com.hazelcast.config.ServerSocketEndpointConfig)

Example 7 with AdvancedNetworkConfig

use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.

the class LocalAddressRegistryIntegrationTest method createConfigForInitiator.

private Config createConfigForInitiator() {
    Config config = smallInstanceConfig();
    AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
    JoinConfig advancedJoinConfig = advancedNetworkConfig.getJoin();
    advancedJoinConfig.getTcpIpConfig().setEnabled(true).addMember(SERVER_MEMBER_ADDRESS.getHost() + ":" + SERVER_MEMBER_ADDRESS.getPort());
    ServerSocketEndpointConfig memberServerSocketConfig = new ServerSocketEndpointConfig().setPort(INITIATOR_MEMBER_ADDRESS.getPort());
    memberServerSocketConfig.getInterfaces().addInterface(INITIATOR_MEMBER_ADDRESS.getHost());
    ServerSocketEndpointConfig clientServerSocketConfig = new ServerSocketEndpointConfig().setPort(INITIATOR_CLIENT_ADDRESS.getPort());
    ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setName("wan").setPort(SERVER_WAN_ADDRESS.getPort());
    wanServerSocketConfig.getInterfaces().addInterface(INITIATOR_WAN_ADDRESS.getHost());
    memberServerSocketConfig.getInterfaces().addInterface("127.0.0.1");
    advancedNetworkConfig.setEnabled(true).setMemberEndpointConfig(memberServerSocketConfig).setClientEndpointConfig(clientServerSocketConfig).addWanEndpointConfig(wanServerSocketConfig);
    return config;
}
Also used : AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig) Config(com.hazelcast.config.Config) ServerSocketEndpointConfig(com.hazelcast.config.ServerSocketEndpointConfig) AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig) ServerSocketEndpointConfig(com.hazelcast.config.ServerSocketEndpointConfig)

Example 8 with AdvancedNetworkConfig

use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.

the class TcpServerContext method getOutboundPorts.

@Override
public Collection<Integer> getOutboundPorts(EndpointQualifier endpointQualifier) {
    final AdvancedNetworkConfig advancedNetworkConfig = node.getConfig().getAdvancedNetworkConfig();
    if (advancedNetworkConfig.isEnabled()) {
        EndpointConfig endpointConfig = advancedNetworkConfig.getEndpointConfigs().get(endpointQualifier);
        final Collection<Integer> outboundPorts = endpointConfig != null ? endpointConfig.getOutboundPorts() : Collections.<Integer>emptyList();
        final Collection<String> outboundPortDefinitions = endpointConfig != null ? endpointConfig.getOutboundPortDefinitions() : Collections.<String>emptyList();
        return AddressUtil.getOutboundPorts(outboundPorts, outboundPortDefinitions);
    }
    final NetworkConfig networkConfig = node.getConfig().getNetworkConfig();
    final Collection<Integer> outboundPorts = networkConfig.getOutboundPorts();
    final Collection<String> outboundPortDefinitions = networkConfig.getOutboundPortDefinitions();
    return AddressUtil.getOutboundPorts(outboundPorts, outboundPortDefinitions);
}
Also used : AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) NetworkConfig(com.hazelcast.config.NetworkConfig) AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) EndpointConfig(com.hazelcast.config.EndpointConfig) RestServerEndpointConfig(com.hazelcast.config.RestServerEndpointConfig)

Example 9 with AdvancedNetworkConfig

use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.

the class MemcachedMultiendpointTest method createConfig.

@Override
protected Config createConfig() {
    Config config = smallInstanceConfig();
    AdvancedNetworkConfig anc = config.getAdvancedNetworkConfig();
    anc.setEnabled(true).setMemcacheEndpointConfig(new ServerSocketEndpointConfig());
    // Join is disabled intentionally. will start standalone HazelcastInstances.
    JoinConfig join = anc.getJoin();
    join.getAutoDetectionConfig().setEnabled(false);
    join.getTcpIpConfig().setEnabled(false);
    return config;
}
Also used : AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) Config(com.hazelcast.config.Config) JoinConfig(com.hazelcast.config.JoinConfig) AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) ServerSocketEndpointConfig(com.hazelcast.config.ServerSocketEndpointConfig) JoinConfig(com.hazelcast.config.JoinConfig) ServerSocketEndpointConfig(com.hazelcast.config.ServerSocketEndpointConfig)

Example 10 with AdvancedNetworkConfig

use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.

the class RestClusterMultiendpointTest method createConfig.

@Override
protected Config createConfig() {
    Config c = new Config();
    AdvancedNetworkConfig anc = c.getAdvancedNetworkConfig();
    anc.setEnabled(true);
    return c;
}
Also used : AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig) Config(com.hazelcast.config.Config) RestServerEndpointConfig(com.hazelcast.config.RestServerEndpointConfig) AdvancedNetworkConfig(com.hazelcast.config.AdvancedNetworkConfig)

Aggregations

AdvancedNetworkConfig (com.hazelcast.config.AdvancedNetworkConfig)12 Config (com.hazelcast.config.Config)7 RestServerEndpointConfig (com.hazelcast.config.RestServerEndpointConfig)5 ServerSocketEndpointConfig (com.hazelcast.config.ServerSocketEndpointConfig)5 EndpointConfig (com.hazelcast.config.EndpointConfig)4 JoinConfig (com.hazelcast.config.JoinConfig)4 NetworkConfig (com.hazelcast.config.NetworkConfig)2 TcpIpConfig (com.hazelcast.config.TcpIpConfig)2 EndpointQualifier (com.hazelcast.instance.EndpointQualifier)2 AuditlogConfig (com.hazelcast.config.AuditlogConfig)1 EncryptionAtRestConfig (com.hazelcast.config.EncryptionAtRestConfig)1 MemberAddressProviderConfig (com.hazelcast.config.MemberAddressProviderConfig)1 MemcacheProtocolConfig (com.hazelcast.config.MemcacheProtocolConfig)1 PersistenceConfig (com.hazelcast.config.PersistenceConfig)1 RestApiConfig (com.hazelcast.config.RestApiConfig)1 SSLConfig (com.hazelcast.config.SSLConfig)1 SecurityConfig (com.hazelcast.config.SecurityConfig)1 WanBatchPublisherConfig (com.hazelcast.config.WanBatchPublisherConfig)1 WanReplicationConfig (com.hazelcast.config.WanReplicationConfig)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1