Class AdvancedNetworkConfig

    • Constructor Detail

      • AdvancedNetworkConfig

        public AdvancedNetworkConfig()
    • Method Detail

      • addWanEndpointConfig

        public AdvancedNetworkConfig addWanEndpointConfig​(EndpointConfig endpointConfig)
        Adds the given WAN EndpointConfig to the endpoints configuration. When the argument is an EndpointConfig, then it configures network settings for the client side of outgoing network connections opened from that member. When the provided endpointconfig is a ServerSocketEndpointConfig, then the HazelcastInstance will additionally listen on the configured port for incoming WAN connections.

        Example of how to configure Hazelcast instances for active-passive WAN replication:

        • On the passive side, configure the Hazelcast instance to listen on port 8765 with SSL enabled:
          
           Config config = new Config();
           ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setPort(8765);
           // setup SSL config etc
           wanServerSocketConfig.getSSLConfig()
                                    .setEnabled(true)
                                    .setFactoryImplementation(new OpenSSLEngineFactory());
           config.getAdvancedNetworkConfig()
                     .setEnabled(true)
                     .addWanEndpointConfig(wanServerSocketConfig);
          
           HazelcastInstance passive = Hazelcast.newHazelcastInstance(config);
           
           
        • On the active side, configure the client-side of outgoing connections with SSL:
          
           Config config = new Config();
           EndpointConfig wanEndpointConfig = new EndpointConfig().setName("wan-tokyo");
           wanEndpointConfig.getSSLConfig()
                                .setEnabled(true)
                                .setFactoryImplementation(new OpenSSLEngineFactory());
           config.getAdvancedNetworkConfig()
                 .setEnabled(true)
                 .addWanEndpointConfig(wanEndpointConfig);
           // setup WAN replication
           WanReplicationConfig wanReplicationConfig = new WanReplicationConfig();
           // WAN publisher config references endpoint config by name
           WanBatchReplicationPublisherConfig publisherConfig = new WanBatchReplicationPublisherConfig()
                           .setEndpoint("wan-tokyo")
                           .setTargetEndpoints("tokyo.hazelcast.com:8765");
           wanReplicationConfig.addWanBatchReplicationPublisherConfig(publisherConfig);
           config.addWanReplicationConfig(wanReplicationConfig);
          
           HazelcastInstance active = Hazelcast.newHazelcastInstance(config);
           
           
        Parameters:
        endpointConfig - the endpoint configuration to add
        Returns:
        this object for fluent chaining
      • setMemberEndpointConfig

        public AdvancedNetworkConfig setMemberEndpointConfig​(ServerSocketEndpointConfig serverSocketEndpointConfig)
        Sets the server socket endpoint config for MEMBER protocol. If another ServerSocketEndpointConfig was previously set, it will be replaced. When starting a Hazelcast instance with AdvancedNetworkConfig enabled, its configuration must include one ServerSocketEndpointConfig for protocol type MEMBER.
        Parameters:
        serverSocketEndpointConfig - the server socket endpoint configuration
        Returns:
        this object for fluent chaining
      • setClientEndpointConfig

        public AdvancedNetworkConfig setClientEndpointConfig​(ServerSocketEndpointConfig serverSocketEndpointConfig)
        Sets the server socket endpoint config for CLIENT protocol. If another ServerSocketEndpointConfig was previously set, it will be replaced. When starting a Hazelcast instance with AdvancedNetworkConfig enabled, its configuration may include at most one ServerSocketEndpointConfig for protocol type CLIENT.
        Parameters:
        serverSocketEndpointConfig - the server socket endpoint configuration
        Returns:
        this object for fluent chaining
      • setRestEndpointConfig

        public AdvancedNetworkConfig setRestEndpointConfig​(RestServerEndpointConfig restServerEndpointConfig)
        Sets the server socket endpoint config for REST protocol. If another ServerSocketEndpointConfig was previously set, it will be replaced. When starting a Hazelcast instance with AdvancedNetworkConfig enabled, its configuration may include at most one ServerSocketEndpointConfig for protocol type REST.
        Parameters:
        restServerEndpointConfig - the server socket endpoint configuration
        Returns:
        this object for fluent chaining
      • setMemcacheEndpointConfig

        public AdvancedNetworkConfig setMemcacheEndpointConfig​(ServerSocketEndpointConfig memcacheEndpointConfig)
        Sets the server socket endpoint config for memcache protocol. If another ServerSocketEndpointConfig was previously set, it will be replaced.
        Parameters:
        memcacheEndpointConfig - the server socket endpoint configuration
        Returns:
        this object for fluent chaining
      • getEndpointConfigs

        public java.util.Map<com.hazelcast.instance.EndpointQualifier,​EndpointConfig> getEndpointConfigs()
      • isEnabled

        public boolean isEnabled()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object