private static void buildWanReplicationSettingsForConfig(final BaseHazelcastProperties hz, final Config config) {
        val wan = hz.getCluster().getWanReplication();

        val wanReplicationConfig = new WanReplicationConfig();
        wanReplicationConfig.setName(wan.getReplicationName());

        wan.getTargets().forEach(target -> {
            val publisherConfig = new WanBatchPublisherConfig();
            publisherConfig.setClassName(target.getPublisherClassName());
            publisherConfig.setQueueFullBehavior(WanQueueFullBehavior.valueOf(target.getQueueFullBehavior()));
            publisherConfig.setQueueCapacity(target.getQueueCapacity());
            publisherConfig.setAcknowledgeType(WanAcknowledgeType.valueOf(target.getAcknowledgeType()));
            publisherConfig.setBatchSize(target.getBatchSize());
            publisherConfig.setBatchMaxDelayMillis(target.getBatchMaximumDelayMilliseconds());
            publisherConfig.setResponseTimeoutMillis(target.getResponseTimeoutMilliseconds());
            publisherConfig.setSnapshotEnabled(target.isSnapshotEnabled());
            publisherConfig.setTargetEndpoints(target.getEndpoints());
            publisherConfig.setClusterName(target.getClusterName());
            publisherConfig.setPublisherId(target.getPublisherId());
            publisherConfig.setMaxConcurrentInvocations(target.getExecutorThreadCount());
            publisherConfig.setInitialPublisherState(WanPublisherState.REPLICATING);
            publisherConfig.setProperties(target.getProperties());
            publisherConfig.setSyncConfig(new WanSyncConfig()
                .setConsistencyCheckStrategy(ConsistencyCheckStrategy.valueOf(target.getConsistencyCheckStrategy())));
            wanReplicationConfig.addBatchReplicationPublisherConfig(publisherConfig);
        });
        config.addWanReplicationConfig(wanReplicationConfig);
    }
Build config.

@param hz the hz
@return the config
support/cas-server-support-hazelcast-core/src/main/java/org/apereo/cas/hz/HazelcastConfigurationFactory.java