com.hazelcast.config

## Class AdvancedNetworkConfig

- java.lang.Object
- - com.hazelcast.config.AdvancedNetworkConfig

-     @Beta
      public class AdvancedNetworkConfig
      extends Object

  Similar to `NetworkConfig` with the additional ability to define multiple endpoints, each with its own separate protocol/security and/or socket properties. When `AdvancedNetworkConfig` is present and enabled then it always takes precedence over the NetworkingConfig.
  Since:
    3.12
  See Also:
    `addWanEndpointConfig(EndpointConfig)`, `setClientEndpointConfig(ServerSocketEndpointConfig)`, `setMemberEndpointConfig(ServerSocketEndpointConfig)`, `setMemcacheEndpointConfig(ServerSocketEndpointConfig)`, `setRestEndpointConfig(RestServerEndpointConfig)`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AdvancedNetworkConfig.MemberNetworkingView` Member endpoint decorated as a `NetworkConfig` Facade used during bootstrap to hide if-logic between the two networking configuration approaches

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdvancedNetworkConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AdvancedNetworkConfig` | `addWanEndpointConfig(EndpointConfig endpointConfig)` Adds the given WAN `EndpointConfig` to the endpoints configuration.
    `Map<EndpointQualifier,EndpointConfig>` | `getEndpointConfigs()`
    `IcmpFailureDetectorConfig` | `getIcmpFailureDetectorConfig()` Returns the current `IcmpFailureDetectorConfig`.
    `JoinConfig` | `getJoin()` Returns the `JoinConfig`.
    `MemberAddressProviderConfig` | `getMemberAddressProviderConfig()`
    `RestServerEndpointConfig` | `getRestEndpointConfig()`
    `boolean` | `isEnabled()`
    `AdvancedNetworkConfig` | `setClientEndpointConfig(ServerSocketEndpointConfig serverSocketEndpointConfig)` Sets the server socket endpoint config for `CLIENT` protocol.
    `AdvancedNetworkConfig` | `setEnabled(boolean enabled)`
    `AdvancedNetworkConfig` | `setEndpointConfigs(Map<EndpointQualifier,EndpointConfig> endpointConfigs)`
    `AdvancedNetworkConfig` | `setIcmpFailureDetectorConfig(IcmpFailureDetectorConfig icmpFailureDetectorConfig)` Sets the `IcmpFailureDetectorConfig`.
    `AdvancedNetworkConfig` | `setJoin(JoinConfig join)`
    `AdvancedNetworkConfig` | `setMemberAddressProviderConfig(MemberAddressProviderConfig memberAddressProviderConfig)`
    `AdvancedNetworkConfig` | `setMemberEndpointConfig(ServerSocketEndpointConfig serverSocketEndpointConfig)` Sets the server socket endpoint config for `MEMBER` protocol.
    `AdvancedNetworkConfig` | `setMemcacheEndpointConfig(ServerSocketEndpointConfig memcacheEndpointConfig)` Sets the server socket endpoint config for `memcache` protocol.
    `AdvancedNetworkConfig` | `setRestEndpointConfig(RestServerEndpointConfig restServerEndpointConfig)` Sets the server socket endpoint config for `REST` protocol.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AdvancedNetworkConfig

          public AdvancedNetworkConfig()

  - ### Method Detail

    - #### getMemberAddressProviderConfig

          public MemberAddressProviderConfig getMemberAddressProviderConfig()

    - #### setMemberAddressProviderConfig

          public AdvancedNetworkConfig setMemberAddressProviderConfig(MemberAddressProviderConfig memberAddressProviderConfig)

    - #### 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
             WanPublisherConfig publisherConfig = new WanPublisherConfig().setEndpoint("wan-tokyo");
             publisherConfig.getProperties().put("endpoints", "tokyo.hazelcast.com:8765");
             wanReplicationConfig.addWanPublisherConfig(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 Map<EndpointQualifier,EndpointConfig> getEndpointConfigs()

    - #### setEndpointConfigs

          public AdvancedNetworkConfig setEndpointConfigs(Map<EndpointQualifier,EndpointConfig> endpointConfigs)

    - #### isEnabled

          public boolean isEnabled()

    - #### setEnabled

          public AdvancedNetworkConfig setEnabled(boolean enabled)

    - #### getJoin

          public JoinConfig getJoin()

      Returns the `JoinConfig`.
      Returns:
        the join

    - #### setJoin

          public AdvancedNetworkConfig setJoin(JoinConfig join)

      Parameters:
        `join` - the join to set

    - #### setIcmpFailureDetectorConfig

          public AdvancedNetworkConfig setIcmpFailureDetectorConfig(IcmpFailureDetectorConfig icmpFailureDetectorConfig)

      Sets the `IcmpFailureDetectorConfig`. The value can be `null` if this detector isn't needed.
      Parameters:
        `icmpFailureDetectorConfig` - the IcmpFailureDetectorConfig to set
      Returns:
        the updated NetworkConfig
      See Also:
        `getIcmpFailureDetectorConfig()`

    - #### getIcmpFailureDetectorConfig

          public IcmpFailureDetectorConfig getIcmpFailureDetectorConfig()

      Returns the current `IcmpFailureDetectorConfig`. It is possible that null is returned if no IcmpFailureDetectorConfig has been set.
      Returns:
        the IcmpFailureDetectorConfig
      See Also:
        `setIcmpFailureDetectorConfig(IcmpFailureDetectorConfig)`

    - #### getRestEndpointConfig

          public RestServerEndpointConfig getRestEndpointConfig()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.