You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2016/02/25 21:27:34 UTC
[46/50] [abbrv] incubator-geode git commit: Merge branch 'develop'
into feature/GEODE-17
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/5c01d5f4/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfigImpl.java
----------------------------------------------------------------------
diff --cc geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfigImpl.java
index 0000000,fc2fca7..71dc92a
mode 000000,100644..100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfigImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfigImpl.java
@@@ -1,0 -1,3533 +1,3564 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ package com.gemstone.gemfire.distributed.internal;
+
+ import com.gemstone.gemfire.GemFireConfigException;
+ import com.gemstone.gemfire.GemFireIOException;
+ import com.gemstone.gemfire.distributed.DistributedSystem;
+ import com.gemstone.gemfire.internal.ConfigSource;
+ import com.gemstone.gemfire.internal.SocketCreator;
+ import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+ import com.gemstone.gemfire.internal.process.ProcessLauncherContext;
+ import com.gemstone.gemfire.memcached.GemFireMemcachedServer;
+
+ import java.io.File;
+ import java.io.IOException;
+ import java.io.Serializable;
+ import java.net.InetAddress;
+ import java.net.URL;
+ import java.net.UnknownHostException;
+ import java.util.*;
+
+ /**
+ * Provides an implementation of <code>DistributionConfig</code> that
+ * knows how to read the configuration file.
+ *
+ * <P>
+ *
+ * Note that if you add a property to this interface, should should
+ * update the {@link
+ * #DistributionConfigImpl(DistributionConfig) copy constructor}.
+ *
+ * @see InternalDistributedSystem
+ *
+ * @author David Whitlock
+ * @author Darrel Schneider
+ * @author Bruce Schuchardt
+ *
+ * @since 2.1
+ */
+ public class DistributionConfigImpl
+ extends AbstractDistributionConfig
+ implements Serializable {
+
+ private static final long serialVersionUID = 4096393792893825167L;
+
+ /** The name of the distribution manager/shared memory connection */
+ private String name = DEFAULT_NAME;
+
+ /** The tcp/ip port used for distribution */
+ private int tcpPort = DEFAULT_TCP_PORT;
+
+ /** The multicast port used for distribution */
+ private int mcastPort = DEFAULT_MCAST_PORT;
+
+ /** The multicast ttl used for distribution */
+ private int mcastTtl = DEFAULT_MCAST_TTL;
+
+ private int socketLeaseTime = DEFAULT_SOCKET_LEASE_TIME;
+ private int socketBufferSize = DEFAULT_SOCKET_BUFFER_SIZE;
+ private boolean conserveSockets = DEFAULT_CONSERVE_SOCKETS;
+
+ /** Comma-delimited list of the application roles performed by this member. */
+ private String roles = DEFAULT_ROLES;
+
+ /** The multicast address used for distribution */
+ private InetAddress mcastAddress = DEFAULT_MCAST_ADDRESS;
+
+ /** The address server socket's should listen on */
+ private String bindAddress = DEFAULT_BIND_ADDRESS;
+
+ /** The address server socket's in a client-server topology should listen on */
+ private String serverBindAddress = DEFAULT_SERVER_BIND_ADDRESS;
+
+ /** The locations of the distribution locators */
+ private String locators = DEFAULT_LOCATORS;
+
+ /** The amount of time to wait for a locator to appear when starting up */
+ private int locatorWaitTime;
+
+ /** The name of the log file */
+ private File logFile = DEFAULT_LOG_FILE;
+
+ protected File deployWorkingDir = DEFAULT_DEPLOY_WORKING_DIR;
+
+ /** The level at which log messages are logged
+ *
+ * @see com.gemstone.gemfire.internal.logging.LogWriterImpl#levelNameToCode(String)
+ */
+ protected int logLevel = DEFAULT_LOG_LEVEL;
+
+ /** bind-address and host of locator to start */
+ private String startLocator = DEFAULT_START_LOCATOR;
+
+ /** port of locator to start. use bind-address as host name */
+ private int startLocatorPort;
+
+ /** Is statistic sampling enabled? */
+ protected boolean statisticSamplingEnabled = DEFAULT_STATISTIC_SAMPLING_ENABLED;
+
+ /** The rate (in milliseconds) at which statistics are sampled */
+ protected int statisticSampleRate = DEFAULT_STATISTIC_SAMPLE_RATE;
+
+ /** The name of the file to which statistics should be archived */
+ protected File statisticArchiveFile = DEFAULT_STATISTIC_ARCHIVE_FILE;
+
+ /** The amount of time to wait for a ACK message */
+ private int ackWaitThreshold = DEFAULT_ACK_WAIT_THRESHOLD;
+
+ /**
+ * The amount of time to wait for a ACK message after the ackWaitThreshold
+ * before shunning members that haven't responded. If zero, this feature
+ * is disabled.
+ */
+ private int ackForceDisconnectThreshold = DEFAULT_ACK_SEVERE_ALERT_THRESHOLD;
+
+ /** The name of an XML file used to initialize the cache */
+ private File cacheXmlFile = Boolean.getBoolean(InternalLocator.FORCE_LOCATOR_DM_TYPE) ? new File("") : DEFAULT_CACHE_XML_FILE;
+
+ protected int archiveDiskSpaceLimit = DEFAULT_ARCHIVE_DISK_SPACE_LIMIT;
+ protected int archiveFileSizeLimit = DEFAULT_ARCHIVE_FILE_SIZE_LIMIT;
+ protected int logDiskSpaceLimit = DEFAULT_LOG_DISK_SPACE_LIMIT;
+ protected int logFileSizeLimit = DEFAULT_LOG_FILE_SIZE_LIMIT;
+
+ protected boolean sslEnabled = DEFAULT_SSL_ENABLED;
+ protected String sslProtocols = DEFAULT_SSL_PROTOCOLS;
+ protected String sslCiphers = DEFAULT_SSL_CIPHERS;
+ protected boolean sslRequireAuthentication = DEFAULT_SSL_REQUIRE_AUTHENTICATION;
+
+ protected boolean clusterSSLEnabled = DEFAULT_CLUSTER_SSL_ENABLED;
+ protected String clusterSSLProtocols = DEFAULT_CLUSTER_SSL_PROTOCOLS;
+ protected String clusterSSLCiphers = DEFAULT_CLUSTER_SSL_CIPHERS;
+ protected boolean clusterSSLRequireAuthentication = DEFAULT_CLUSTER_SSL_REQUIRE_AUTHENTICATION;
+ protected String clusterSSLKeyStore = DEFAULT_CLUSTER_SSL_KEYSTORE;
+ protected String clusterSSLKeyStoreType = DEFAULT_CLUSTER_SSL_KEYSTORE_TYPE;
+ protected String clusterSSLKeyStorePassword = DEFAULT_CLUSTER_SSL_KEYSTORE_PASSWORD;
+ protected String clusterSSLTrustStore = DEFAULT_CLUSTER_SSL_TRUSTSTORE;
+ protected String clusterSSLTrustStorePassword = DEFAULT_CLUSTER_SSL_TRUSTSTORE_PASSWORD;
+
+ /** multicast send buffer size, in bytes */
+ protected int mcastSendBufferSize = DEFAULT_MCAST_SEND_BUFFER_SIZE;
+ /** multicast receive buffer size, in bytes */
+ protected int mcastRecvBufferSize = DEFAULT_MCAST_RECV_BUFFER_SIZE;
+ /** flow-of-control parameters for multicast messaging */
+ protected FlowControlParams mcastFlowControl = DEFAULT_MCAST_FLOW_CONTROL;
+
+ /** datagram socket send buffer size, in bytes */
+ protected int udpSendBufferSize = DEFAULT_UDP_SEND_BUFFER_SIZE;
+ /** datagram socket receive buffer size, in bytes */
+ protected int udpRecvBufferSize = DEFAULT_UDP_RECV_BUFFER_SIZE;
+ /** max datagram message size, in bytes. This should be < 64k */
+ protected int udpFragmentSize = DEFAULT_UDP_FRAGMENT_SIZE;
+
+ /** whether tcp/ip sockets should be disabled */
+ protected boolean disableTcp = DEFAULT_DISABLE_TCP;
+
+ /** whether time statistics should be enabled for the distributed system */
+ protected boolean enableTimeStatistics = DEFAULT_ENABLE_TIME_STATISTICS;
+
+ /** member contact timeout, in milliseconds, for failure detection */
+ protected int memberTimeout = DEFAULT_MEMBER_TIMEOUT;
+
+ /** the Jgroups port ranges allowed */
+ protected int[] membershipPortRange = DEFAULT_MEMBERSHIP_PORT_RANGE;
+
+ /**
+ * Max wait time for the member before reconnecting to the DS in case of
+ * required role loss.
+ * */
+ private int maxWaitTimeForReconnect = DEFAULT_MAX_WAIT_TIME_FOR_RECONNECT;
+ /**
+ * Max number of tries allowed for reconnect in case of required role loss.
+ * */
+ private int maxNumReconnectTries = DEFAULT_MAX_NUM_RECONNECT_TRIES;
+
+
+ protected int asyncDistributionTimeout = DEFAULT_ASYNC_DISTRIBUTION_TIMEOUT;
+ protected int asyncQueueTimeout = DEFAULT_ASYNC_QUEUE_TIMEOUT;
+ protected int asyncMaxQueueSize = DEFAULT_ASYNC_MAX_QUEUE_SIZE;
+
+ /** @since 5.7 */
+ private String clientConflation = CLIENT_CONFLATION_PROP_VALUE_DEFAULT;
+
+ /** The id of the durable client */
+ private String durableClientId = DEFAULT_DURABLE_CLIENT_ID;
+
+ /** The timeout of the durable client */
+ private int durableClientTimeout = DEFAULT_DURABLE_CLIENT_TIMEOUT;
+
+ /** The client authentication initialization method name*/
+ private String securityClientAuthInit = DEFAULT_SECURITY_CLIENT_AUTH_INIT;
+
+ /** The client authenticating method name*/
+ private String securityClientAuthenticator = DEFAULT_SECURITY_CLIENT_AUTHENTICATOR;
+
+ /** The client Diffie-Hellman method name*/
+ private String securityClientDHAlgo = DEFAULT_SECURITY_CLIENT_DHALGO;
+
+ /** The peer authentication initialization method name*/
+ private String securityPeerAuthInit = DEFAULT_SECURITY_PEER_AUTH_INIT;
+
+ /** The peer authenticating method name*/
+ private String securityPeerAuthenticator = DEFAULT_SECURITY_PEER_AUTHENTICATOR;
+
+ /** The client authorization method name*/
+ private String securityClientAccessor = DEFAULT_SECURITY_CLIENT_ACCESSOR;
+
+ /** The post-processing client authorization method name*/
+ private String securityClientAccessorPP = DEFAULT_SECURITY_CLIENT_ACCESSOR_PP;
+
++ /** The token service method name*/
++ private String securityRestTokenService = DEFAULT_SECURITY_REST_TOKEN_SERVICE;
++
+ /**
+ * The level at which security related log messages are logged
+ *
+ * @see com.gemstone.gemfire.internal.logging.LogWriterImpl#levelNameToCode(String)
+ */
+ protected int securityLogLevel = DEFAULT_LOG_LEVEL;
+
+ /** whether network partition detection algorithms are enabled */
+ private boolean enableNetworkPartitionDetection = DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION;
+
+ /** whether auto reconnect after network partition is disabled */
+ private boolean disableAutoReconnect = DEFAULT_DISABLE_AUTO_RECONNECT;
+
+ /** The security log file */
+ private File securityLogFile = DEFAULT_SECURITY_LOG_FILE;
+
+ /** The p2p membership check timeout */
+ private int securityPeerMembershipTimeout = DEFAULT_SECURITY_PEER_VERIFYMEMBER_TIMEOUT;
+
+ /** The member security credentials */
+ private Properties security = new Properties();
+
+ /** The User defined properties to be used for cache.xml replacements */
+ private Properties userDefinedProps = new Properties();
+ /**
+ * Prefix to use for properties that are put as JVM java properties for use
+ * with layers (e.g. jgroups membership) that do not have a
+ * <code>DistributionConfig</code> object.
+ */
+ public static final String SECURITY_SYSTEM_PREFIX = GEMFIRE_PREFIX + "sys.";
+
+ /** whether to remove unresponsive client or not */
+ private boolean removeUnresponsiveClient = DEFAULT_REMOVE_UNRESPONSIVE_CLIENT;
+
+ /** Is delta propagation enabled or not **/
+ private boolean deltaPropagation = DEFAULT_DELTA_PROPAGATION;
+
+ private Map props;
+
+ private int distributedSystemId = DistributionConfig.DEFAULT_DISTRIBUTED_SYSTEM_ID;
+
+ /** The locations of the remote distribution locators */
+ private String remoteLocators = DEFAULT_REMOTE_LOCATORS;
+
+ private boolean enforceUniqueHost = DistributionConfig.DEFAULT_ENFORCE_UNIQUE_HOST;
+
+ private String redundancyZone = DistributionConfig.DEFAULT_REDUNDANCY_ZONE;
+
+ /** holds the ssl properties specified in gfsecurity.properties */
+ private Properties sslProperties = new Properties();
+
+ /** holds the ssl properties specified in gfsecurity.properties */
+ private Properties clusterSSLProperties = new Properties();
+
+ private String groups = DEFAULT_GROUPS;
+
+ protected boolean enableSharedConfiguration = DistributionConfig.DEFAULT_ENABLE_CLUSTER_CONFIGURATION;
+ protected boolean useSharedConfiguration = DistributionConfig.DEFAULT_USE_CLUSTER_CONFIGURATION;
+ protected boolean loadSharedConfigurationFromDir = DistributionConfig.DEFAULT_LOAD_CLUSTER_CONFIG_FROM_DIR;
+ protected String clusterConfigDir = DistributionConfig.DEFAULT_CLUSTER_CONFIGURATION_DIR;
+
+
+ private int httpServicePort = DEFAULT_HTTP_SERVICE_PORT;
+
+ private String httpServiceBindAddress = DEFAULT_HTTP_SERVICE_BIND_ADDRESS;
+
+ private boolean startDevRestApi = DEFAULT_START_DEV_REST_API;
+ /**
+ * port on which {@link GemFireMemcachedServer} server is started
+ */
+ private int memcachedPort;
+
+ /**
+ * protocol for GemFireMemcachedServer
+ */
+ private String memcachedProtocol = DEFAULT_MEMCACHED_PROTOCOL;
+
+ /**
+ * Bind address for GemFireMemcachedServer
+ */
+ private String memcachedBindAddress = DEFAULT_MEMCACHED_BIND_ADDRESS;
+
+ /** Are distributed transactions enabled or not */
+ private boolean distributedTransactions = DEFAULT_DISTRIBUTED_TRANSACTIONS;
+
+
+ /**
+ * port on which {@link com.gemstone.gemfire.redis.GemFireRedisServer} is started
+ */
+ private int redisPort = DEFAULT_REDIS_PORT;
+
+ /**
+ * Bind address for GemFireRedisServer
+ */
+ private String redisBindAddress = DEFAULT_REDIS_BIND_ADDRESS;
+
+ private String redisPassword = DEFAULT_REDIS_PASSWORD;
+
+ private boolean jmxManager = Boolean.getBoolean(InternalLocator.FORCE_LOCATOR_DM_TYPE) ? true : DEFAULT_JMX_MANAGER;
+ private boolean jmxManagerStart = DEFAULT_JMX_MANAGER_START;
+
+ private int jmxManagerPort = DEFAULT_JMX_MANAGER_PORT;
+ private String jmxManagerBindAddress = DEFAULT_JMX_MANAGER_BIND_ADDRESS;
+ private String jmxManagerHostnameForClients = DEFAULT_JMX_MANAGER_HOSTNAME_FOR_CLIENTS;
+ private String jmxManagerPasswordFile = DEFAULT_JMX_MANAGER_PASSWORD_FILE;
+ private String jmxManagerAccessFile = DEFAULT_JMX_MANAGER_ACCESS_FILE;
+ private int jmxManagerHttpPort = DEFAULT_HTTP_SERVICE_PORT;
+ private int jmxManagerUpdateRate = DEFAULT_JMX_MANAGER_UPDATE_RATE;
+
+ private boolean jmxManagerSSL = DEFAULT_JMX_MANAGER_SSL;
+ private boolean jmxManagerSSLEnabled = DEFAULT_JMX_MANAGER_SSL_ENABLED;
+ private boolean jmxManagerSslRequireAuthentication = DEFAULT_JMX_MANAGER_SSL_REQUIRE_AUTHENTICATION;
+ private String jmxManagerSslProtocols = DEFAULT_JMX_MANAGER_SSL_PROTOCOLS;
+ private String jmxManagerSslCiphers = DEFAULT_JMX_MANAGER_SSL_CIPHERS;
+ private Properties jmxManagerSslProperties = new Properties();
+
+ protected String jmxManagerSSLKeyStore = DEFAULT_JMX_MANAGER_SSL_KEYSTORE;
+ protected String jmxManagerSSLKeyStoreType = DEFAULT_JMX_MANAGER_SSL_KEYSTORE_TYPE;
+ protected String jmxManagerSSLKeyStorePassword = DEFAULT_JMX_MANAGER_SSL_KEYSTORE_PASSWORD;
+ protected String jmxManagerSSLTrustStore = DEFAULT_JMX_MANAGER_SSL_TRUSTSTORE;
+ protected String jmxManagerSSLTrustStorePassword = DEFAULT_JMX_MANAGER_SSL_TRUSTSTORE_PASSWORD;
+
+ private boolean serverSSLEnabled = DEFAULT_SERVER_SSL_ENABLED;
+ private boolean serverSslRequireAuthentication = DEFAULT_SERVER_SSL_REQUIRE_AUTHENTICATION;
+ private String serverSslProtocols = DEFAULT_SERVER_SSL_PROTOCOLS;
+ private String serverSslCiphers = DEFAULT_SERVER_SSL_CIPHERS;
+ private Properties serverSslProperties = new Properties();
+
+ protected String serverSSLKeyStore = DEFAULT_SERVER_SSL_KEYSTORE;
+ protected String serverSSLKeyStoreType = DEFAULT_SERVER_SSL_KEYSTORE_TYPE;
+ protected String serverSSLKeyStorePassword = DEFAULT_SERVER_SSL_KEYSTORE_PASSWORD;
+ protected String serverSSLTrustStore = DEFAULT_SERVER_SSL_TRUSTSTORE;
+ protected String serverSSLTrustStorePassword = DEFAULT_SERVER_SSL_TRUSTSTORE_PASSWORD;
+
+ private boolean gatewaySSLEnabled = DEFAULT_GATEWAY_SSL_ENABLED;
+ private boolean gatewaySslRequireAuthentication = DEFAULT_GATEWAY_SSL_REQUIRE_AUTHENTICATION;
+ private String gatewaySslProtocols = DEFAULT_GATEWAY_SSL_PROTOCOLS;
+ private String gatewaySslCiphers = DEFAULT_GATEWAY_SSL_CIPHERS;
+ private Properties gatewaySslProperties = new Properties();
+
+ protected String gatewaySSLKeyStore = DEFAULT_GATEWAY_SSL_KEYSTORE;
+ protected String gatewaySSLKeyStoreType = DEFAULT_GATEWAY_SSL_KEYSTORE_TYPE;
+ protected String gatewaySSLKeyStorePassword = DEFAULT_GATEWAY_SSL_KEYSTORE_PASSWORD;
+ protected String gatewaySSLTrustStore = DEFAULT_GATEWAY_SSL_TRUSTSTORE;
+ protected String gatewaySSLTrustStorePassword = DEFAULT_GATEWAY_SSL_TRUSTSTORE_PASSWORD;
+
+
+ private boolean httpServiceSSLEnabled = DEFAULT_HTTP_SERVICE_SSL_ENABLED;
+ private boolean httpServiceSSLRequireAuthentication = DEFAULT_HTTP_SERVICE_SSL_REQUIRE_AUTHENTICATION;
+ private String httpServiceSSLProtocols = DEFAULT_HTTP_SERVICE_SSL_PROTOCOLS;
+ private String httpServiceSSLCiphers = DEFAULT_HTTP_SERVICE_SSL_CIPHERS;
+ private Properties httpServiceSSLProperties = new Properties();
+
+ protected String httpServiceSSLKeyStore = DEFAULT_HTTP_SERVICE_SSL_KEYSTORE;
+ protected String httpServiceSSLKeyStoreType = DEFAULT_HTTP_SERVICE_SSL_KEYSTORE_TYPE;
+ protected String httpServiceSSLKeyStorePassword = DEFAULT_HTTP_SERVICE_SSL_KEYSTORE_PASSWORD;
+ protected String httpServiceSSLTrustStore = DEFAULT_HTTP_SERVICE_SSL_TRUSTSTORE;
+ protected String httpServiceSSLTrustStorePassword = DEFAULT_HTTP_SERVICE_SSL_TRUSTSTORE_PASSWORD;
+
+ private Map<String, ConfigSource> sourceMap = Collections.synchronizedMap(new HashMap<String, ConfigSource>());
+
+ protected String userCommandPackages = DEFAULT_USER_COMMAND_PACKAGES;
+
+ /** "off-heap-memory-size" with value of "" or "<size>[g|m]" */
+ protected String offHeapMemorySize = DEFAULT_OFF_HEAP_MEMORY_SIZE;
+
+ /** Whether pages should be locked into memory or allowed to swap to disk */
+ private boolean lockMemory = DEFAULT_LOCK_MEMORY;
+
+ ////////////////////// Constructors //////////////////////
+
+ /**
+ * Create a new <code>DistributionConfigImpl</code> from the
+ * contents of another <code>DistributionConfig</code>.
+ */
+ public DistributionConfigImpl(DistributionConfig other) {
+ this.name = other.getName();
+ this.tcpPort = other.getTcpPort();
+ this.mcastPort = other.getMcastPort();
+ this.mcastTtl = other.getMcastTtl();
+ this.socketLeaseTime = other.getSocketLeaseTime();
+ this.socketBufferSize = other.getSocketBufferSize();
+ this.conserveSockets = other.getConserveSockets();
+ this.roles = other.getRoles();
+ this.mcastAddress = other.getMcastAddress();
+ this.bindAddress = other.getBindAddress();
+ this.serverBindAddress = other.getServerBindAddress();
+ this.locators = ((DistributionConfigImpl)other).locators;
+ this.locatorWaitTime = other.getLocatorWaitTime();
+ this.remoteLocators = other.getRemoteLocators();
+ this.startLocator = other.getStartLocator();
+ this.startLocatorPort = ((DistributionConfigImpl)other).startLocatorPort;
+ this.deployWorkingDir = other.getDeployWorkingDir();
+ this.logFile = other.getLogFile();
+ this.logLevel = other.getLogLevel();
+ this.statisticSamplingEnabled = other.getStatisticSamplingEnabled();
+ this.statisticSampleRate = other.getStatisticSampleRate();
+ this.statisticArchiveFile = other.getStatisticArchiveFile();
+ this.ackWaitThreshold = other.getAckWaitThreshold();
+ this.ackForceDisconnectThreshold = other.getAckSevereAlertThreshold();
+ this.cacheXmlFile = other.getCacheXmlFile();
+ this.archiveDiskSpaceLimit = other.getArchiveDiskSpaceLimit();
+ this.archiveFileSizeLimit = other.getArchiveFileSizeLimit();
+ this.logDiskSpaceLimit = other.getLogDiskSpaceLimit();
+ this.logFileSizeLimit = other.getLogFileSizeLimit();
+ this.sslEnabled = other.getSSLEnabled();
+ this.sslProtocols = other.getSSLProtocols();
+ this.sslCiphers = other.getSSLCiphers();
+ this.sslRequireAuthentication = other.getSSLRequireAuthentication();
+ this.clusterSSLEnabled = other.getClusterSSLEnabled();
+ this.clusterSSLProtocols = other.getClusterSSLProtocols();
+ this.clusterSSLCiphers = other.getClusterSSLCiphers();
+ this.clusterSSLRequireAuthentication = other.getClusterSSLRequireAuthentication();
+ this.clusterSSLKeyStore = other.getClusterSSLKeyStore();
+ this.clusterSSLKeyStoreType= other.getClusterSSLKeyStoreType();
+ this.clusterSSLKeyStorePassword= other.getClusterSSLKeyStorePassword();
+ this.clusterSSLTrustStore= other.getClusterSSLTrustStore();
+ this.clusterSSLTrustStorePassword= other.getClusterSSLTrustStorePassword();
+ this.asyncDistributionTimeout = other.getAsyncDistributionTimeout();
+ this.asyncQueueTimeout = other.getAsyncQueueTimeout();
+ this.asyncMaxQueueSize = other.getAsyncMaxQueueSize();
+ this.modifiable = true;
+ // the following were added after version 4.1.2
+ this.mcastSendBufferSize = other.getMcastSendBufferSize();
+ this.mcastRecvBufferSize = other.getMcastRecvBufferSize();
+ this.mcastFlowControl = other.getMcastFlowControl();
+ this.udpSendBufferSize = other.getUdpSendBufferSize();
+ this.udpRecvBufferSize = other.getUdpRecvBufferSize();
+ this.udpFragmentSize = other.getUdpFragmentSize();
+ this.disableTcp = other.getDisableTcp();
+ this.enableTimeStatistics = other.getEnableTimeStatistics();
+ this.memberTimeout = other.getMemberTimeout();
+ this.membershipPortRange = other.getMembershipPortRange();
+ this.maxWaitTimeForReconnect = other.getMaxWaitTimeForReconnect();
+ this.maxNumReconnectTries = other.getMaxNumReconnectTries();
+ this.clientConflation = other.getClientConflation();
+ this.durableClientId = other.getDurableClientId();
+ this.durableClientTimeout = other.getDurableClientTimeout();
+
+ this.enableNetworkPartitionDetection = other.getEnableNetworkPartitionDetection();
+ this.disableAutoReconnect = other.getDisableAutoReconnect();
+
+ this.securityClientAuthInit = other.getSecurityClientAuthInit();
+ this.securityClientAuthenticator = other.getSecurityClientAuthenticator();
+ this.securityClientDHAlgo = other.getSecurityClientDHAlgo();
+ this.securityPeerAuthInit = other.getSecurityPeerAuthInit();
+ this.securityPeerAuthenticator = other.getSecurityPeerAuthenticator();
+ this.securityClientAccessor = other.getSecurityClientAccessor();
+ this.securityClientAccessorPP = other.getSecurityClientAccessorPP();
+ this.securityPeerMembershipTimeout = other.getSecurityPeerMembershipTimeout();
+ this.securityLogLevel = other.getSecurityLogLevel();
+ this.securityLogFile = other.getSecurityLogFile();
+ this.security.putAll(other.getSecurityProps());
+ this.removeUnresponsiveClient = other.getRemoveUnresponsiveClient();
+ this.deltaPropagation = other.getDeltaPropagation();
+ this.distributedSystemId = other.getDistributedSystemId();
+ this.redundancyZone = other.getRedundancyZone();
+ this.enforceUniqueHost = other.getEnforceUniqueHost();
+ this.sslProperties = other.getSSLProperties();
+ this.clusterSSLProperties = other.getClusterSSLProperties();
+ this.jmxManagerSslProperties = other.getJmxSSLProperties();
+ //Similar to this.security, assigning userDefinedProps
+ this.userDefinedProps.putAll(other.getUserDefinedProps());
+
+ // following added for 7.0
+ this.groups = other.getGroups();
+ this.jmxManager = other.getJmxManager();
+ this.jmxManagerStart = other.getJmxManagerStart();
+ this.jmxManagerSSL = other.getJmxManagerSSL();
+ this.jmxManagerSSLEnabled = other.getJmxManagerSSLEnabled();
+ this.jmxManagerSslRequireAuthentication = other.getJmxManagerSSLRequireAuthentication();
+ this.jmxManagerSslProtocols = other.getJmxManagerSSLProtocols();
+ this.jmxManagerSslCiphers = other.getJmxManagerSSLCiphers();
+ this.jmxManagerSSLKeyStore = other.getJmxManagerSSLKeyStore();
+ this.jmxManagerSSLKeyStoreType= other.getJmxManagerSSLKeyStoreType();
+ this.jmxManagerSSLKeyStorePassword= other.getJmxManagerSSLKeyStorePassword();
+ this.jmxManagerSSLTrustStore= other.getJmxManagerSSLTrustStore();
+ this.jmxManagerSSLTrustStorePassword= other.getJmxManagerSSLTrustStorePassword();
+ this.jmxManagerSslProperties = other.getJmxSSLProperties();
+ this.jmxManagerPort = other.getJmxManagerPort();
+ this.jmxManagerBindAddress = other.getJmxManagerBindAddress();
+ this.jmxManagerHostnameForClients = other.getJmxManagerHostnameForClients();
+ this.jmxManagerPasswordFile = other.getJmxManagerPasswordFile();
+ this.jmxManagerAccessFile = other.getJmxManagerAccessFile();
+ this.jmxManagerHttpPort = other.getJmxManagerHttpPort();
+ this.jmxManagerUpdateRate = other.getJmxManagerUpdateRate();
+ this.memcachedPort = other.getMemcachedPort();
+ this.memcachedProtocol = other.getMemcachedProtocol();
+ this.memcachedBindAddress = other.getMemcachedBindAddress();
+ this.redisPort = other.getRedisPort();
+ this.redisBindAddress = other.getRedisBindAddress();
+ this.redisPassword = other.getRedisPassword();
+ this.userCommandPackages = other.getUserCommandPackages();
+
+ // following added for 8.0
+ this.enableSharedConfiguration = other.getEnableClusterConfiguration();
+ this.loadSharedConfigurationFromDir = other.getLoadClusterConfigFromDir();
+ this.clusterConfigDir = other.getClusterConfigDir();
+ this.useSharedConfiguration = other.getUseSharedConfiguration();
+ this.serverSSLEnabled = other.getServerSSLEnabled();
+ this.serverSslRequireAuthentication = other.getServerSSLRequireAuthentication();
+ this.serverSslProtocols = other.getServerSSLProtocols();
+ this.serverSslCiphers = other.getServerSSLCiphers();
+ this.serverSSLKeyStore = other.getServerSSLKeyStore();
+ this.serverSSLKeyStoreType= other.getServerSSLKeyStoreType();
+ this.serverSSLKeyStorePassword= other.getServerSSLKeyStorePassword();
+ this.serverSSLTrustStore= other.getServerSSLTrustStore();
+ this.serverSSLTrustStorePassword= other.getServerSSLTrustStorePassword();
+ this.serverSslProperties = other.getServerSSLProperties();
+
+ this.gatewaySSLEnabled = other.getGatewaySSLEnabled();
+ this.gatewaySslRequireAuthentication = other.getGatewaySSLRequireAuthentication();
+ this.gatewaySslProtocols = other.getGatewaySSLProtocols();
+ this.gatewaySslCiphers = other.getGatewaySSLCiphers();
+ this.gatewaySSLKeyStore = other.getGatewaySSLKeyStore();
+ this.gatewaySSLKeyStoreType= other.getGatewaySSLKeyStoreType();
+ this.gatewaySSLKeyStorePassword= other.getGatewaySSLKeyStorePassword();
+ this.gatewaySSLTrustStore= other.getGatewaySSLTrustStore();
+ this.gatewaySSLTrustStorePassword= other.getGatewaySSLTrustStorePassword();
+ this.gatewaySslProperties = other.getGatewaySSLProperties();
+
+ this.httpServicePort = other.getHttpServicePort();
+ this.httpServiceBindAddress = other.getHttpServiceBindAddress();
+
+ this.httpServiceSSLEnabled = other.getHttpServiceSSLEnabled();
+ this.httpServiceSSLCiphers = other.getHttpServiceSSLCiphers();
+ this.httpServiceSSLProtocols = other.getHttpServiceSSLProtocols();
+ this.httpServiceSSLRequireAuthentication = other.getHttpServiceSSLRequireAuthentication();
+ this.httpServiceSSLKeyStore = other.getHttpServiceSSLKeyStore();
+ this.httpServiceSSLKeyStorePassword = other.getHttpServiceSSLKeyStorePassword();
+ this.httpServiceSSLKeyStoreType = other.getHttpServiceSSLKeyStoreType();
+ this.httpServiceSSLTrustStore = other.getHttpServiceSSLTrustStore();
+ this.httpServiceSSLTrustStorePassword = other.getHttpServiceSSLTrustStorePassword();
+ this.httpServiceSSLProperties = other.getHttpServiceSSLProperties();
+
+ this.startDevRestApi = other.getStartDevRestApi();
+
++ // Following added for 8.2
++ this.securityRestTokenService = other.getSecurityRestTokenService();
++
+ // following added for 9.0
+ this.offHeapMemorySize = other.getOffHeapMemorySize();
+
+ Map<String, ConfigSource> otherSources = ((DistributionConfigImpl)other).sourceMap;
+ if (otherSources != null) {
+ this.sourceMap = new HashMap<String, ConfigSource>(otherSources);
+ }
+
+ this.lockMemory = other.getLockMemory();
+ this.distributedTransactions = other.getDistributedTransactions();
+ }
+
+ /**
+ * Set to true to make attributes writable.
+ * Set to false to make attributes read only.
+ * By default they are read only.
+ */
+ protected boolean modifiable = false;
+
+ @Override
+ protected boolean _modifiableDefault() {
+ return modifiable;
+ }
+
+ /**
+ * Creates a default application config. Does not read any
+ * properties. Currently only used by DistributionConfigImpl.main.
+ */
+ private DistributionConfigImpl() {
+ // do nothing. We just want a default config
+ }
+
+ /**
+ * Creates a new <code>DistributionConfigImpl</code> with the given
+ * non-default configuration properties. See {@link
+ * com.gemstone.gemfire.distributed.DistributedSystem#connect} for a
+ * list of exceptions that may be thrown.
+ *
+ * @param nonDefault
+ * The configuration properties specified by the caller
+ */
+ public DistributionConfigImpl(Properties nonDefault) {
+ this(nonDefault, false, false);
+ }
+
+ /**
+ * Creates a new <code>DistributionConfigImpl</code> with the given
+ * non-default configuration properties. See
+ * {@link com.gemstone.gemfire.distributed.DistributedSystem#connect} for a
+ * list of exceptions that may be thrown.
+ *
+ * @param nonDefault
+ * The configuration properties specified by the caller
+ * @param ignoreGemFirePropsFile
+ * whether to skip loading distributed system properties from
+ * gemfire.properties file
+ *
+ * @since 6.5
+ */
+
+ public DistributionConfigImpl(Properties nonDefault,
+ boolean ignoreGemFirePropsFile) {
+ this(nonDefault, ignoreGemFirePropsFile, false);
+ }
+
+ /**
+ * Creates a new <code>DistributionConfigImpl</code> with the given
+ * non-default configuration properties. See
+ * {@link com.gemstone.gemfire.distributed.DistributedSystem#connect} for a
+ * list of exceptions that may be thrown.
+ *
+ * @param nonDefault
+ * The configuration properties specified by the caller
+ * @param ignoreGemFirePropsFile
+ * whether to skip loading distributed system properties from
+ * gemfire.properties file
+ * @param isConnected
+ * whether to skip Validation for SSL properties and copy of ssl
+ * properties to other ssl properties. This parameter will be used
+ * till we provide support for ssl-* properties.
+ *
+ * @since 8.0
+ */
+ public DistributionConfigImpl(Properties nonDefault,
+ boolean ignoreGemFirePropsFile, boolean isConnected) {
+ HashMap props = new HashMap();
+ if (!ignoreGemFirePropsFile) {//For admin bug #40434
+ props.putAll(loadPropertiesFromURL(DistributedSystem.getPropertyFileURL(), false));
+ }
+ props.putAll(loadPropertiesFromURL(DistributedSystem.getSecurityPropertiesFileURL(), true));
+
+ // Now override values picked up from the file with values passed
+ // in from the caller's code
+ if (nonDefault != null) {
+ props.putAll(nonDefault);
+ setSource(nonDefault, ConfigSource.api());
+ }
+ //Now remove all user defined properties from props.
+ for (Object entry : props.entrySet()) {
+ Map.Entry<String, String> ent = (Map.Entry<String, String>)entry;
+ if (((String)ent.getKey()).startsWith(USERDEFINED_PREFIX_NAME)){
+ userDefinedProps.put(ent.getKey(), ent.getValue());
+ }
+ }
+ // Now override values picked up from the file or code with values
+ // from the system properties.
+ String[] attNames = getAttributeNames();
+
+ // For gemfire.security-* properties, we will need to look at
+ // all the system properties instead of looping through attNames
+ Set attNameSet = new HashSet();
+ for (int index = 0; index < attNames.length; ++index) {
+ attNameSet.add(GEMFIRE_PREFIX + attNames[index]);
+ }
+
+ /* clone() is a synchronized method for Properties (actually in Hashtable) */
+ Properties sysProps = (Properties) System.getProperties().clone();
+ Iterator<?> sysPropsIter = sysProps.entrySet().iterator();
+ while (sysPropsIter.hasNext()) {
+ Map.Entry sysEntry = (Map.Entry)sysPropsIter.next();
+ String sysName = (String)sysEntry.getKey();
+ if (attNameSet.contains(sysName)
+ || sysName.startsWith(GEMFIRE_PREFIX + SECURITY_PREFIX_NAME)
+ || sysName.startsWith(GEMFIRE_PREFIX + SSL_SYSTEM_PROPS_NAME)) {
+ String sysValue = (String)sysEntry.getValue();
+ if (sysValue != null) {
+ String attName = sysName.substring(GEMFIRE_PREFIX.length());
+ props.put(attName, sysValue);
+ this.sourceMap.put(attName, ConfigSource.sysprop());
+ }
+ }
+ }
+ sysProps.clear(); //clearing cloned SysProps
+
+ final Properties overriddenDefaults = ProcessLauncherContext.getOverriddenDefaults();
+ if (!overriddenDefaults.isEmpty()) {
+ for (String key : overriddenDefaults.stringPropertyNames()) {
+ // only apply the overridden default if it's not already specified in props
+ final String property = key.substring(ProcessLauncherContext.OVERRIDDEN_DEFAULTS_PREFIX.length());
+ if (!props.containsKey((property))) {
+ props.put(property, overriddenDefaults.getProperty(key));
+ this.sourceMap.put(property, ConfigSource.launcher());
+ }
+ }
+ }
+
+ // this is case of locator and DS is started through
+ // Locator.startLocatorAndDS, In this case I don't need to validate SSL
+ // properties. This fix is till the time we support SSL properties. Once SSl
+ // properties is depprecated, boolean isConnected will be removed
+ if (!isConnected) {
+ validateOldSSLVsNewSSLProperties(props);
+ }
+ initialize(props);
+
+ if (securityPeerAuthInit != null && securityPeerAuthInit.length() > 0) {
+ System.setProperty(SECURITY_SYSTEM_PREFIX + SECURITY_PEER_AUTH_INIT_NAME,
+ securityPeerAuthInit);
+ }
+ if (securityPeerAuthenticator != null
+ && securityPeerAuthenticator.length() > 0) {
+ System.setProperty(SECURITY_SYSTEM_PREFIX
+ + SECURITY_PEER_AUTHENTICATOR_NAME, securityPeerAuthenticator);
+ }
+
+ Iterator iter = security.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry entry = (Map.Entry)iter.next();
+ System.setProperty(SECURITY_SYSTEM_PREFIX + (String)entry.getKey(),
+ (String)entry.getValue());
+ }
+ computeMcastPortDefault();
+ if (!isConnected) {
+ copySSLPropsToClusterSSLProps();
+ copySSLPropsToServerSSLProps();
+ copySSLPropsToJMXSSLProps();
+ copyClusterSSLPropsToGatewaySSLProps();
+ copySSLPropsToHTTPSSLProps();
+ }
+ }
+
+ private void validateOldSSLVsNewSSLProperties(Map props) {
+ String sslEnabledString = (String)props.get(SSL_ENABLED_NAME);
+ String clusterSSLEnabledString =(String)props.get(CLUSTER_SSL_ENABLED_NAME);
+ if(sslEnabledString != null && clusterSSLEnabledString != null){
+ boolean sslEnabled = new Boolean(sslEnabledString).booleanValue();
+ boolean clusterSSLEnabled =new Boolean(clusterSSLEnabledString).booleanValue();
+ if (sslEnabled != DEFAULT_SSL_ENABLED
+ && clusterSSLEnabled != DEFAULT_CLUSTER_SSL_ENABLED) {
+ throw new IllegalArgumentException(
+ "Gemfire property \'ssl-enabled\' and \'cluster-ssl-enabled\' can not be used at the same time. Prefer way is to use all \'cluster-ssl*\' properties instead of \'ssl-*\'.");
+ }
+ }
+
+ String sslCipher = (String)props.get(SSL_CIPHERS_NAME);
+ String clusterSSLCipher = (String)props.get(CLUSTER_SSL_CIPHERS_NAME);
+ if (sslCipher != null && sslCipher != DEFAULT_SSL_CIPHERS
+ && clusterSSLCipher != null && clusterSSLCipher != DEFAULT_CLUSTER_SSL_CIPHERS) {
+ throw new IllegalArgumentException(
+ "Gemfire property \'ssl-cipher\' and \'cluster-ssl-cipher\' can not be used at the same time. Prefer way is to use all \'cluster-ssl*\' properties instead of \'ssl-*\'.");
+ }
+
+ String sslProtocol = (String)props.get(SSL_PROTOCOLS_NAME);
+ String clusterSSLProtocol = (String)props.get(CLUSTER_SSL_PROTOCOLS_NAME);
+ if (sslProtocol != null && sslProtocol != DEFAULT_SSL_PROTOCOLS
+ && clusterSSLProtocol != null && clusterSSLProtocol != DEFAULT_CLUSTER_SSL_PROTOCOLS ) {
+ throw new IllegalArgumentException(
+ "Gemfire property \'ssl-protocols\' and \'cluster-ssl-protocols\' can not be used at the same time. Prefer way is to use all \'cluster-ssl*\' properties instead of \'ssl-*\'.");
+ }
+
+ String sslReqAuthString = (String)props.get(SSL_REQUIRE_AUTHENTICATION_NAME);
+ String clusterReqAuthString =(String)props.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME);
+ if(sslReqAuthString != null && clusterReqAuthString != null){
+ boolean sslReqAuth = new Boolean(sslReqAuthString).booleanValue();
+ boolean clusterSSLReqAuth =new Boolean(clusterReqAuthString).booleanValue();
+ if (sslReqAuth != DEFAULT_SSL_REQUIRE_AUTHENTICATION
+ && clusterSSLReqAuth != DEFAULT_CLUSTER_SSL_REQUIRE_AUTHENTICATION) {
+ throw new IllegalArgumentException(
+ "Gemfire property \'ssl-require-authentication\' and \'cluster-ssl-require-authentication\' can not be used at the same time. Prefer way is to use all \'cluster-ssl*\' properties instead of \'ssl-*\'.");
+ }
+ }
+
+ String jmxSSLString = (String)props.get(JMX_MANAGER_SSL_NAME);
+ String jmxSSLEnabledString =(String)props.get(JMX_MANAGER_SSL_ENABLED_NAME);
+ if(jmxSSLString != null && jmxSSLEnabledString != null){
+ boolean jmxSSL = new Boolean(jmxSSLString).booleanValue();
+ boolean jmxSSLEnabled =new Boolean(jmxSSLEnabledString).booleanValue();
+ if (jmxSSL != DEFAULT_SSL_ENABLED
+ && jmxSSLEnabled != DEFAULT_CLUSTER_SSL_ENABLED) {
+ throw new IllegalArgumentException(
+ "Gemfire property \'jmx-manager-ssl\' and \'jmx-manager-ssl-enabled\' can not be used at the same time. Prefer way is to use \'jmx-manager-ssl-enabled\' instead of \'jmx-manager-ssl\'.");
+ }
+ }
+ }
+
+ /*
+ * ssl-* properties will be copied in cluster-ssl-* properties. Socket is using cluster-ssl-* properties
+ */
+ private void copySSLPropsToClusterSSLProps() {
+ boolean clusterSSLOverriden = this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME)!=null;
+ boolean p2pSSLOverRidden = this.sourceMap.get(SSL_ENABLED_NAME)!=null;
+
+ if(p2pSSLOverRidden && !clusterSSLOverriden) {
+ this.clusterSSLEnabled = this.sslEnabled;
+ this.sourceMap.put(CLUSTER_SSL_ENABLED_NAME,this.sourceMap.get(SSL_ENABLED_NAME));
+
+ if(this.sourceMap.get(SSL_CIPHERS_NAME)!=null) {
+ this.clusterSSLCiphers = this.sslCiphers;
+ this.sourceMap.put(CLUSTER_SSL_CIPHERS_NAME,this.sourceMap.get(SSL_CIPHERS_NAME));
+ }
+
+ if(this.sourceMap.get(SSL_PROTOCOLS_NAME)!=null) {
+ this.clusterSSLProtocols = this.sslProtocols;
+ this.sourceMap.put(CLUSTER_SSL_PROTOCOLS_NAME,this.sourceMap.get(SSL_PROTOCOLS_NAME));
+ }
+
+ if(this.sourceMap.get(SSL_REQUIRE_AUTHENTICATION_NAME)!=null) {
+ this.clusterSSLRequireAuthentication = this.sslRequireAuthentication;
+ this.sourceMap.put(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME,this.sourceMap.get(SSL_REQUIRE_AUTHENTICATION_NAME));
+ }
+ this.clusterSSLProperties.putAll(this.sslProperties);
+ }
+ }
+
+ /*
+ * if jmx-manager-ssl is true and jmx-manager-ssl-enabled is false then override jmx-manager-ssl-enabled with jmx-manager-ssl
+ * if jmx-manager-ssl-enabled is false, then use the properties from cluster-ssl-* properties
+ * if jmx-manager-ssl-*properties are given then use them, and copy the unspecified jmx-manager properties from cluster-properties
+ */
+ private void copySSLPropsToJMXSSLProps() {
+ boolean jmxSSLEnabledOverriden = this.sourceMap.get(JMX_MANAGER_SSL_ENABLED_NAME)!=null;
+ boolean jmxSSLOverriden = this.sourceMap.get(JMX_MANAGER_SSL_NAME)!=null;
+ boolean clusterSSLOverRidden = this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME)!=null;
+
+ if(jmxSSLOverriden && !jmxSSLEnabledOverriden) {
+ this.jmxManagerSSLEnabled = this.jmxManagerSSL;
+ this.sourceMap.put(JMX_MANAGER_SSL_ENABLED_NAME,this.sourceMap.get(JMX_MANAGER_SSL_NAME));
+ }
+
+ if(clusterSSLOverRidden && !jmxSSLOverriden && !jmxSSLEnabledOverriden) {
+ this.jmxManagerSSLEnabled = this.clusterSSLEnabled;
+ this.sourceMap.put(JMX_MANAGER_SSL_ENABLED_NAME,this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME));
+ if(this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME)!=null) {
+ this.jmxManagerSslCiphers = this.clusterSSLCiphers;
+ this.sourceMap.put(JMX_MANAGER_SSL_CIPHERS_NAME,this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME)!=null) {
+ this.jmxManagerSslProtocols = this.clusterSSLProtocols;
+ this.sourceMap.put(JMX_MANAGER_SSL_PROTOCOLS_NAME,this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME)!=null) {
+ this.jmxManagerSslRequireAuthentication = this.clusterSSLRequireAuthentication;
+ this.sourceMap.put(JMX_MANAGER_SSL_REQUIRE_AUTHENTICATION_NAME,this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME)!=null) {
+ this.jmxManagerSSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(JMX_MANAGER_SSL_KEYSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME)!=null) {
+ this.jmxManagerSSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(JMX_MANAGER_SSL_KEYSTORE_TYPE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME)!=null) {
+ this.jmxManagerSSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(JMX_MANAGER_SSL_KEYSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME)!=null) {
+ this.jmxManagerSSLTrustStore= this.clusterSSLTrustStore;
+ this.sourceMap.put(JMX_MANAGER_SSL_TRUSTSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME)!=null) {
+ this.jmxManagerSSLTrustStorePassword= this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(JMX_MANAGER_SSL_TRUSTSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ this.jmxManagerSslProperties.putAll(this.clusterSSLProperties);
+ }
+
+ if(jmxSSLOverriden || jmxSSLEnabledOverriden){
+ if(this.sourceMap.get(JMX_MANAGER_SSL_KEYSTORE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME) != null) {
+ this.jmxManagerSSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(JMX_MANAGER_SSL_KEYSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if(this.sourceMap.get(JMX_MANAGER_SSL_KEYSTORE_TYPE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME) != null) {
+ this.jmxManagerSSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(JMX_MANAGER_SSL_KEYSTORE_TYPE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if(this.sourceMap.get(JMX_MANAGER_SSL_KEYSTORE_PASSWORD_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME) != null) {
+ this.jmxManagerSSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(JMX_MANAGER_SSL_KEYSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if(this.sourceMap.get(JMX_MANAGER_SSL_TRUSTSTORE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME) != null) {
+ this.jmxManagerSSLTrustStore= this.clusterSSLTrustStore;
+ this.sourceMap.put(JMX_MANAGER_SSL_TRUSTSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if(this.sourceMap.get(JMX_MANAGER_SSL_TRUSTSTORE_PASSWORD_NAME)==null && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME) != null) {
+ this.jmxManagerSSLTrustStorePassword= this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(JMX_MANAGER_SSL_TRUSTSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ }
+
+ }
+
+ /*
+ * if http-service-ssl-enabled is false, then use the properties from cluster-ssl-* properties
+ * if http-service-ssl-*properties are given then use them, and copy the unspecified http-service properties from cluster-properties
+ */
+ private void copySSLPropsToHTTPSSLProps() {
+ boolean httpServiceSSLEnabledOverriden = this.sourceMap.get(HTTP_SERVICE_SSL_ENABLED_NAME) != null;
+
+ boolean clusterSSLOverRidden = this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME) != null;
+
+ if (clusterSSLOverRidden && !httpServiceSSLEnabledOverriden) {
+ this.httpServiceSSLEnabled = this.clusterSSLEnabled;
+ this.sourceMap.put(HTTP_SERVICE_SSL_ENABLED_NAME, this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME));
+
+ if (this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME) != null) {
+ this.httpServiceSSLCiphers = this.clusterSSLCiphers;
+ this.sourceMap.put(HTTP_SERVICE_SSL_CIPHERS_NAME, this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME));
+ }
+
+ if (this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME) != null) {
+ this.httpServiceSSLProtocols = this.clusterSSLProtocols;
+ this.sourceMap.put(HTTP_SERVICE_SSL_PROTOCOLS_NAME, this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME));
+ }
+
+ if (this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME) != null) {
+ this.httpServiceSSLRequireAuthentication = this.clusterSSLRequireAuthentication;
+ this.sourceMap.put(HTTP_SERVICE_SSL_REQUIRE_AUTHENTICATION_NAME,
+ this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME));
+ }
+
+ if (this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME) != null) {
+ this.httpServiceSSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(HTTP_SERVICE_SSL_KEYSTORE_NAME, this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if (this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME) != null) {
+ this.httpServiceSSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(HTTP_SERVICE_SSL_KEYSTORE_TYPE_NAME, this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if (this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME) != null) {
+ this.httpServiceSSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(HTTP_SERVICE_SSL_KEYSTORE_PASSWORD_NAME,
+ this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if (this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME) != null) {
+ this.httpServiceSSLTrustStore = this.clusterSSLTrustStore;
+ this.sourceMap.put(HTTP_SERVICE_SSL_TRUSTSTORE_NAME, this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if (this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME) != null) {
+ this.httpServiceSSLTrustStorePassword = this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(HTTP_SERVICE_SSL_TRUSTSTORE_PASSWORD_NAME,
+ this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ this.httpServiceSSLProperties.putAll(this.clusterSSLProperties);
+ }
+
+ if (httpServiceSSLEnabledOverriden) {
+ if (this.sourceMap.get(HTTP_SERVICE_SSL_KEYSTORE_NAME) == null
+ && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME) != null) {
+ this.httpServiceSSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(HTTP_SERVICE_SSL_KEYSTORE_NAME, this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if (this.sourceMap.get(HTTP_SERVICE_SSL_KEYSTORE_TYPE_NAME) == null
+ && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME) != null) {
+ this.httpServiceSSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(HTTP_SERVICE_SSL_KEYSTORE_TYPE_NAME, this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if (this.sourceMap.get(HTTP_SERVICE_SSL_KEYSTORE_PASSWORD_NAME) == null
+ && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME) != null) {
+ this.httpServiceSSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(HTTP_SERVICE_SSL_KEYSTORE_PASSWORD_NAME,
+ this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if (this.sourceMap.get(HTTP_SERVICE_SSL_TRUSTSTORE_NAME) == null
+ && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME) != null) {
+ this.httpServiceSSLTrustStore = this.clusterSSLTrustStore;
+ this.sourceMap.put(HTTP_SERVICE_SSL_TRUSTSTORE_NAME, this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if (this.sourceMap.get(HTTP_SERVICE_SSL_TRUSTSTORE_PASSWORD_NAME) == null
+ && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME) != null) {
+ this.httpServiceSSLTrustStorePassword = this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(HTTP_SERVICE_SSL_TRUSTSTORE_PASSWORD_NAME,
+ this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ }
+
+ }
+
+ /*
+ * if server-ssl-enabled is false, then use the properties from cluster-ssl-* properties
+ * if server-ssl-*properties are given then use them, and copy the unspecified server properties from cluster-properties
+ */
+ private void copySSLPropsToServerSSLProps() {
+ boolean cacheServerSSLOverriden = this.sourceMap.get(SERVER_SSL_ENABLED_NAME)!=null;
+ boolean clusterSSLOverRidden = this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME)!=null;
+
+ if(clusterSSLOverRidden && !cacheServerSSLOverriden) {
+ this.serverSSLEnabled = this.clusterSSLEnabled;
+ this.sourceMap.put(SERVER_SSL_ENABLED_NAME,this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME));
+ if(this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME)!=null) {
+ this.serverSslCiphers = this.clusterSSLCiphers;
+ this.sourceMap.put(SERVER_SSL_CIPHERS_NAME,this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME)!=null) {
+ this.serverSslProtocols = this.clusterSSLProtocols;
+ this.sourceMap.put(SERVER_SSL_PROTOCOLS_NAME,this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME)!=null) {
+ this.serverSslRequireAuthentication = this.clusterSSLRequireAuthentication;
+ this.sourceMap.put(SERVER_SSL_REQUIRE_AUTHENTICATION_NAME,this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME)!=null) {
+ this.serverSSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(SERVER_SSL_KEYSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME)!=null) {
+ this.serverSSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(SERVER_SSL_KEYSTORE_TYPE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME)!=null) {
+ this.serverSSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(SERVER_SSL_KEYSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME)!=null) {
+ this.serverSSLTrustStore= this.clusterSSLTrustStore;
+ this.sourceMap.put(SERVER_SSL_TRUSTSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME)!=null) {
+ this.serverSSLTrustStorePassword= this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(SERVER_SSL_TRUSTSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ this.serverSslProperties.putAll(this.clusterSSLProperties);
+ }
+
+ if(cacheServerSSLOverriden){
+ if(this.sourceMap.get(SERVER_SSL_KEYSTORE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME) != null) {
+ this.serverSSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(SERVER_SSL_KEYSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if(this.sourceMap.get(SERVER_SSL_KEYSTORE_TYPE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME) != null) {
+ this.serverSSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(SERVER_SSL_KEYSTORE_TYPE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if(this.sourceMap.get(SERVER_SSL_KEYSTORE_PASSWORD_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME) != null) {
+ this.serverSSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(SERVER_SSL_KEYSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if(this.sourceMap.get(SERVER_SSL_TRUSTSTORE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME) != null) {
+ this.serverSSLTrustStore= this.clusterSSLTrustStore;
+ this.sourceMap.put(SERVER_SSL_TRUSTSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if(this.sourceMap.get(SERVER_SSL_TRUSTSTORE_PASSWORD_NAME)==null && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME) != null) {
+ this.serverSSLTrustStorePassword= this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(SERVER_SSL_TRUSTSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ }
+ }
+
+ /*
+ * if gateway-ssl-enabled is false, then use the properties from cluster-ssl-* properties
+ * if gateway-ssl-*properties are given then use them, and copy the unspecified gateway properties from cluster-properties
+ */
+ private void copyClusterSSLPropsToGatewaySSLProps() {
+ boolean gatewaySSLOverriden = this.sourceMap.get(GATEWAY_SSL_ENABLED_NAME)!=null;
+ boolean clusterSSLOverRidden = this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME)!=null;
+
+ if(clusterSSLOverRidden && !gatewaySSLOverriden) {
+ this.gatewaySSLEnabled = this.clusterSSLEnabled;
+ this.sourceMap.put(GATEWAY_SSL_ENABLED_NAME,this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME));
+ if(this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME)!=null) {
+ this.gatewaySslCiphers = this.clusterSSLCiphers;
+ this.sourceMap.put(GATEWAY_SSL_CIPHERS_NAME,this.sourceMap.get(CLUSTER_SSL_CIPHERS_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME)!=null) {
+ this.gatewaySslProtocols = this.clusterSSLProtocols;
+ this.sourceMap.put(GATEWAY_SSL_PROTOCOLS_NAME,this.sourceMap.get(CLUSTER_SSL_PROTOCOLS_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME)!=null) {
+ this.gatewaySslRequireAuthentication = this.clusterSSLRequireAuthentication;
+ this.sourceMap.put(GATEWAY_SSL_REQUIRE_AUTHENTICATION_NAME,this.sourceMap.get(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME));
+ }
+
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME)!=null) {
+ this.gatewaySSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(GATEWAY_SSL_KEYSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME)!=null) {
+ this.gatewaySSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(GATEWAY_SSL_KEYSTORE_TYPE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME)!=null) {
+ this.gatewaySSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(GATEWAY_SSL_KEYSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME)!=null) {
+ this.gatewaySSLTrustStore= this.clusterSSLTrustStore;
+ this.sourceMap.put(GATEWAY_SSL_TRUSTSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if(this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME)!=null) {
+ this.gatewaySSLTrustStorePassword= this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(GATEWAY_SSL_TRUSTSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ this.gatewaySslProperties.putAll(this.clusterSSLProperties);
+ }
+
+ if(gatewaySSLOverriden){
+ if(this.sourceMap.get(GATEWAY_SSL_KEYSTORE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME) != null) {
+ this.gatewaySSLKeyStore = this.clusterSSLKeyStore;
+ this.sourceMap.put(GATEWAY_SSL_KEYSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_NAME));
+ }
+ if(this.sourceMap.get(GATEWAY_SSL_KEYSTORE_TYPE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME) != null) {
+ this.gatewaySSLKeyStoreType = this.clusterSSLKeyStoreType;
+ this.sourceMap.put(GATEWAY_SSL_KEYSTORE_TYPE_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_TYPE_NAME));
+ }
+ if(this.sourceMap.get(GATEWAY_SSL_KEYSTORE_PASSWORD_NAME)==null && this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME) != null) {
+ this.gatewaySSLKeyStorePassword = this.clusterSSLKeyStorePassword;
+ this.sourceMap.put(GATEWAY_SSL_KEYSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME));
+ }
+ if(this.sourceMap.get(GATEWAY_SSL_TRUSTSTORE_NAME)==null && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME)!= null) {
+ this.gatewaySSLTrustStore= this.clusterSSLTrustStore;
+ this.sourceMap.put(GATEWAY_SSL_TRUSTSTORE_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_NAME));
+ }
+ if(this.sourceMap.get(GATEWAY_SSL_TRUSTSTORE_PASSWORD_NAME)==null && this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME) != null) {
+ this.gatewaySSLTrustStorePassword= this.clusterSSLTrustStorePassword;
+ this.sourceMap.put(GATEWAY_SSL_TRUSTSTORE_PASSWORD_NAME,this.sourceMap.get(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME));
+ }
+ }
+ }
+
+
+ private void computeMcastPortDefault() {
+ // a no-op since multicast discovery has been removed
+ // and the default mcast port is now zero
+
+ // ConfigSource cs = getAttSourceMap().get(MCAST_PORT_NAME);
+ // if (cs == null) {
+ // String locators = getLocators();
+ // if (locators != null && !locators.isEmpty()) {
+ // this.mcastPort = 0; // fixes 46308
+ // }
+ // }
+ }
+
+ /**
+ * Produce a DistributionConfigImpl for the given properties and return it.
+ */
+ public static DistributionConfigImpl produce(Properties props) {
+ if (props != null) {
+ Object o = props.get(DS_CONFIG_NAME);
+ if (o instanceof DistributionConfigImpl) {
+ return (DistributionConfigImpl) o;
+ }
+ }
+ return new DistributionConfigImpl(props, false, false);
+ }
+
+ /**
+ * Produce a DistributionConfigImpl for the given properties and return it.
+ */
+ public static DistributionConfigImpl produce(Properties props, boolean isConnected) {
+ if (props != null) {
+ Object o = props.get(DS_CONFIG_NAME);
+ if (o instanceof DistributionConfigImpl) {
+ return (DistributionConfigImpl) o;
+ }
+ }
+ return new DistributionConfigImpl(props, false, isConnected);
+ }
+
+ public void setApiProps(Properties apiProps) {
+ if (apiProps != null) {
+ setSource(apiProps, ConfigSource.api());
+ this.modifiable = true;
+ Iterator it = apiProps.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry me = (Map.Entry)it.next();
+ String propName = (String)me.getKey();
+ this.props.put(propName, me.getValue());
+ if (specialPropName(propName)) {
+ continue;
+ }
+ String propVal = (String)me.getValue();
+ if (propVal != null) {
+ this.setAttribute(propName, propVal.trim(), this.sourceMap.get(propName));
+ }
+ }
+ computeMcastPortDefault();
+ // Make attributes read only
+ this.modifiable = false;
+ }
+ }
+
+ public static boolean specialPropName(String propName) {
+ return propName.equalsIgnoreCase(SSL_ENABLED_NAME) ||
+ propName.equalsIgnoreCase(CLUSTER_SSL_ENABLED_NAME) ||
+ propName.equals(SECURITY_PEER_AUTH_INIT_NAME) ||
+ propName.equals(SECURITY_PEER_AUTHENTICATOR_NAME) ||
+ propName.equals(LOG_WRITER_NAME) ||
+ propName.equals(DS_CONFIG_NAME) ||
+ propName.equals(SECURITY_LOG_WRITER_NAME) ||
+ propName.equals(LOG_OUTPUTSTREAM_NAME) ||
+ propName.equals(SECURITY_LOG_OUTPUTSTREAM_NAME);
+ }
+
+ @Override
+ protected Map<String, ConfigSource> getAttSourceMap() {
+ return this.sourceMap;
+ }
+
+ public Properties getUserDefinedProps() {
+ return userDefinedProps;
+ }
+
+ /**
+ * Loads the properties from gemfire.properties & gfsecurity.properties files
+ * into given Properties object.
+ *
+ * @param p
+ * the Properties to fill in
+ * @throws GemFireIOException
+ * when error occurs while reading properties file
+ */
+ public static void loadGemFireProperties(Properties p) throws GemFireIOException {
+ loadGemFireProperties(p, false);
+ }
+
+ /**
+ * Loads the properties from gemfire.properties & gfsecurity.properties files
+ * into given Properties object. if <code>ignoreGemFirePropsFile</code> is
+ * <code>true</code>, properties are not read from gemfire.properties.
+ *
+ * @param p
+ * the Properties to fill in
+ * @param ignoreGemFirePropsFile
+ * whether to ignore properties from gemfire.properties
+ * @throws GemFireIOException
+ * when error occurs while reading properties file
+ */
+ // Fix for #44924
+ public static void loadGemFireProperties(Properties p,
+ boolean ignoreGemFirePropsFile) throws GemFireIOException {
+ if (!ignoreGemFirePropsFile) {
+ loadPropertiesFromURL(p, DistributedSystem.getPropertyFileURL());
+ }
+ // load the security properties file
+ loadPropertiesFromURL(p, DistributedSystem.getSecurityPropertiesFileURL());
+ }
+
+ /**
+ * For every key in p mark it as being from the given source.
+ */
+ private void setSource(Properties p, ConfigSource source) {
+ if (source == null) {
+ throw new IllegalArgumentException("Valid ConfigSource must be specified instead of null.");
+ }
+ for (Object k: p.keySet()) {
+ this.sourceMap.put((String)k, source);
+ }
+ }
+
+ private Properties loadPropertiesFromURL(URL url, boolean secure) {
+ Properties result = new Properties();
+ loadPropertiesFromURL(result, url);
+ if (!result.isEmpty()) {
+ setSource(result, ConfigSource.file(url.toString(), secure));
+ }
+ return result;
+ }
+
+ private static void loadPropertiesFromURL(Properties p, URL url) {
+ if (url != null) {
+ try {
+ p.load(url.openStream());
+ } catch (IOException io) {
+ throw new GemFireIOException(LocalizedStrings.DistributionConfigImpl_FAILED_READING_0.toLocalizedString(url), io);
+ }
+ }
+ }
+
+ private void initialize(Map props) {
+ // Allow attributes to be modified
+ this.modifiable = true;
+ this.props = props;
+ Iterator it = props.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry me = (Map.Entry)it.next();
+ String propName = (String)me.getKey();
+ // if ssl-enabled is set to true before the mcast port is set to 0, then it will error.
+ // security should not be enabled before the mcast port is set to 0.
+ if (specialPropName(propName)) {
+ continue;
+ }
+ Object propVal = me.getValue();
+ if (propVal != null && (propVal instanceof String)) { // weed out extraneous non-string properties
+ this.setAttribute(propName, ((String)propVal).trim(), this.sourceMap.get(propName));
+ }
+ }
+ // now set ssl-enabled if needed...
+ if ( props.containsKey(SSL_ENABLED_NAME) ) {
+ this.setAttribute(SSL_ENABLED_NAME, (String) props.get( SSL_ENABLED_NAME ), this.sourceMap.get(SSL_ENABLED_NAME) );
+ }
+ if ( props.containsKey(CLUSTER_SSL_ENABLED_NAME) ) {
+ this.setAttribute(CLUSTER_SSL_ENABLED_NAME, (String) props.get( CLUSTER_SSL_ENABLED_NAME ), this.sourceMap.get(CLUSTER_SSL_ENABLED_NAME) );
+ }
+ // now set the security authInit if needed
+ if (props.containsKey(SECURITY_PEER_AUTH_INIT_NAME)) {
+ this.setAttribute(SECURITY_PEER_AUTH_INIT_NAME, (String)props
+ .get(SECURITY_PEER_AUTH_INIT_NAME),
+ this.sourceMap.get(SECURITY_PEER_AUTH_INIT_NAME));
+ }
+ // and security authenticator if needed
+ if (props.containsKey(SECURITY_PEER_AUTHENTICATOR_NAME)) {
+ this.setAttribute(SECURITY_PEER_AUTHENTICATOR_NAME, (String)props
+ .get(SECURITY_PEER_AUTHENTICATOR_NAME),
+ this.sourceMap.get(SECURITY_PEER_AUTHENTICATOR_NAME));
+ }
+
+ // Make attributes read only
+ this.modifiable = false;
+ }
+
+ public void close() {
+ // Clear the extra stuff from System properties
+ Properties props = System.getProperties();
+ props.remove(SECURITY_SYSTEM_PREFIX + SECURITY_PEER_AUTH_INIT_NAME);
+ props.remove(SECURITY_SYSTEM_PREFIX + SECURITY_PEER_AUTHENTICATOR_NAME);
+
+ Iterator iter = security.keySet().iterator();
+ while (iter.hasNext()) {
+ props.remove(SECURITY_SYSTEM_PREFIX + (String)iter.next());
+ }
+ System.setProperties(props);
+ }
+
+ //////////////////// Configuration Methods ////////////////////
+
+ public String getName() {
+ return this.name;
+ }
+
+ public int getTcpPort() {
+ return this.tcpPort;
+ }
+
+ public int getMcastPort() {
+ return this.mcastPort;
+ }
+ public int getMcastTtl() {
+ return this.mcastTtl;
+ }
+ public int getSocketLeaseTime() {
+ return this.socketLeaseTime;
+ }
+ public int getSocketBufferSize() {
+ return this.socketBufferSize;
+ }
+ public boolean getConserveSockets() {
+ return this.conserveSockets;
+ }
+ public String getRoles() {
+ return this.roles;
+ }
+
+ public int getMaxWaitTimeForReconnect(){
+ return this.maxWaitTimeForReconnect;
+ }
+
+ public int getMaxNumReconnectTries(){
+ return this.maxNumReconnectTries;
+ }
+
+ public InetAddress getMcastAddress() {
+ try {
+ return this.mcastAddress;
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public String getBindAddress() {
+ return this.bindAddress;
+ }
+
+ public String getServerBindAddress() {
+ return this.serverBindAddress;
+ }
+
+ public String getLocators() {
+ if (this.startLocator != null && this.startLocator.length() > 0) {
+ String locs = this.locators;
+ String startL = getStartLocator();
+ int comma = startL.indexOf(',');
+ if (comma >= 0) {
+ startL = startL.substring(0, comma);
+ }
+ if (locs.length() > 0) {
+ if (locs.contains(startL)) {
+ return locs; // fix for bug 43929
+ }
+ return locs + "," + startL;
+ } else {
+ return startL;
+ }
+ }
+ return this.locators;
+ }
+
+ public String getStartLocator() {
+ if (this.startLocatorPort > 0) {
+ if (this.bindAddress != null) {
+ return this.bindAddress + "["+this.startLocatorPort+"]";
+ }
+ try {
+ return SocketCreator.getHostName(SocketCreator.getLocalHost()) + "["+this.startLocatorPort+"]";
+ }
+ catch (UnknownHostException e) {
+ // punt and use this.startLocator instead
+ }
+ }
+ return this.startLocator;
+ }
+
+ public File getDeployWorkingDir() {
+ return this.deployWorkingDir;
+ }
+
+ public File getLogFile() {
+ return this.logFile;
+ }
+
+ public int getLogLevel() {
+ return this.logLevel;
+ }
+
+ public boolean getStatisticSamplingEnabled() {
+ return this.statisticSamplingEnabled;
+ }
+
+ public int getStatisticSampleRate() {
+ return this.statisticSampleRate;
+ }
+
+ public File getStatisticArchiveFile() {
+ return this.statisticArchiveFile;
+ }
+
+ public int getAckWaitThreshold() {
+ return this.ackWaitThreshold;
+ }
+
+ public int getAckSevereAlertThreshold() {
+ return this.ackForceDisconnectThreshold;
+ }
+
+ public File getCacheXmlFile() {
+ return this.cacheXmlFile;
+ }
+
+ public boolean getSSLEnabled( ) {
+ return this.sslEnabled;
+ }
+
+ public String getSSLProtocols( ) {
+ return this.sslProtocols;
+ }
+
+ public String getSSLCiphers( ) {
+ return this.sslCiphers;
+ }
+
+ public boolean getSSLRequireAuthentication( ) {
+ return this.sslRequireAuthentication;
+ }
+
+ public boolean getClusterSSLEnabled( ) {
+ return this.clusterSSLEnabled;
+ }
+
+ public String getClusterSSLProtocols( ) {
+ return this.clusterSSLProtocols;
+ }
+
+ public String getClusterSSLCiphers( ) {
+ return this.clusterSSLCiphers;
+ }
+
+ public boolean getClusterSSLRequireAuthentication( ) {
+ return this.clusterSSLRequireAuthentication;
+ }
+
+ public String getClusterSSLKeyStore( ){
+ return this.clusterSSLKeyStore;
+ }
+ public String getClusterSSLKeyStoreType( ){
+ return this.clusterSSLKeyStoreType;
+ }
+
+ public String getClusterSSLKeyStorePassword( ){
+ return this.clusterSSLKeyStorePassword;
+ }
+
+ public String getClusterSSLTrustStore( ){
+ return this.clusterSSLTrustStore;
+ }
+
+ public String getClusterSSLTrustStorePassword( ){
+ return this.clusterSSLTrustStorePassword;
+ }
+
+ public int getAsyncDistributionTimeout() {
+ return this.asyncDistributionTimeout;
+ }
+ public int getAsyncQueueTimeout() {
+ return this.asyncQueueTimeout;
+ }
+ public int getAsyncMaxQueueSize() {
+ return this.asyncMaxQueueSize;
+ }
+
+ public String getUserCommandPackages() {
+ return this.userCommandPackages;
+ }
+
+ public int getHttpServicePort() {
+ return this.httpServicePort;
+ }
+
+ public void setHttpServicePort(int value) {
+ this.httpServicePort = (Integer)checkAttribute(HTTP_SERVICE_PORT_NAME, value);
+ }
+
+ public String getHttpServiceBindAddress() {
+ return this.httpServiceBindAddress;
+ }
+
+ public void setHttpServiceBindAddress(String value) {
+ this.httpServiceBindAddress = (String)checkAttribute(HTTP_SERVICE_BIND_ADDRESS_NAME, value);
+ }
+
+ public boolean getStartDevRestApi(){
+ return this.startDevRestApi;
+ }
+
+ public void setStartDevRestApi(boolean value){
+ this.startDevRestApi = value;
+ }
+
+ public void setUserCommandPackages(String value) {
+ this.userCommandPackages = (String)checkAttribute(USER_COMMAND_PACKAGES, value);
+ }
+
+ public boolean getDeltaPropagation() {
+ return this.deltaPropagation;
+ }
+
+ public void setDeltaPropagation(boolean value) {
+ this.deltaPropagation = (Boolean)checkAttribute(DELTA_PROPAGATION_PROP_NAME, value);
+ }
+
+ public void setName(String value) {
+ if (value == null) {
+ value = DEFAULT_NAME;
+ }
+ this.name = (String)checkAttribute(NAME_NAME, value);
+ }
+ public void setTcpPort(int value) {
+ this.tcpPort = (Integer)checkAttribute(TCP_PORT_NAME, value);
+ }
+ public void setMcastPort(int value) {
+ this.mcastPort = (Integer)checkAttribute(MCAST_PORT_NAME, value);
+ }
+ public void setMcastTtl(int value) {
+ this.mcastTtl = (Integer)checkAttribute(MCAST_TTL_NAME, value);
+ }
+ public void setSocketLeaseTime(int value) {
+ this.socketLeaseTime = (Integer)checkAttribute(SOCKET_LEASE_TIME_NAME, value);
+ }
+ public void setSocketBufferSize(int value) {
+ this.socketBufferSize = (Integer)checkAttribute(SOCKET_BUFFER_SIZE_NAME, value);
+ }
+ public void setConserveSockets(boolean value) {
+ this.conserveSockets = (Boolean)checkAttribute(CONSERVE_SOCKETS_NAME, value);
+ }
+ public void setRoles(String value) {
+ this.roles = (String)checkAttribute(ROLES_NAME, value);
+ }
+
+ public void setMaxWaitTimeForReconnect(int value){
+ this.maxWaitTimeForReconnect = value;
+ }
+
+ public void setMaxNumReconnectTries(int value){
+ this.maxNumReconnectTries = value;
+ }
+
+ public void setMcastAddress(InetAddress value) {
+ this.mcastAddress = (InetAddress)checkAttribute(MCAST_ADDRESS_NAME, value);
+ }
+ public void setBindAddress(String value) {
+ this.bindAddress = (String)checkAttribute(BIND_ADDRESS_NAME, value);
+ }
+ public void setServerBindAddress(String value) {
+ this.serverBindAddress = (String)checkAttribute(SERVER_BIND_ADDRESS_NAME, value);
+ }
+ public void setLocators(String value) {
+ if (value == null) {
+ value = DEFAULT_LOCATORS;
+ }
+ this.locators = (String)checkAttribute(LOCATORS_NAME, value);
+ }
+
+ public void setLocatorWaitTime(int value) {
+ this.locatorWaitTime = value;
+ }
+
+ public int getLocatorWaitTime() {
+ return this.locatorWaitTime;
+ }
+
+ public void setDeployWorkingDir(File value) {
+ this.deployWorkingDir = (File)checkAttribute(DEPLOY_WORKING_DIR, value);
+ }
+ public void setLogFile(File value) {
+ this.logFile = (File)checkAttribute(LOG_FILE_NAME, value);
+ }
+ public void setLogLevel(int value) {
+ this.logLevel = (Integer)checkAttribute(LOG_LEVEL_NAME, value);
+ }
+ /**
+ * the locator startup code must be able to modify the locator log file in order
+ * to establish a default log file if one hasn't been specified by the user.
+ * This method will change the log file, but only in the configuration settings -
+ * it won't affect a running distributed system's log file
+ */
+ public void unsafeSetLogFile(File value) {
+ this.logFile = value;
+ }
+ public void setStartLocator(String value) {
+ startLocatorPort = 0;
+ if (value == null) {
+ value = DEFAULT_START_LOCATOR;
+ }
+ else {
+ // bug 37938 - allow just a port
+ boolean alldigits = true;
+ for (int i=0; i<value.length(); i++) {
+ char c = value.charAt(i);
+ if (!Character.isDigit(c)) {
+ alldigits = false;
+ break;
+ }
+ }
+ if (value.length() > 0 && alldigits) {
+ try {
+ int port = Integer.parseInt(value);
+ if (port < 0 || port > 65535) {
+ throw new GemFireConfigException("Illegal port specified for start-locator");
+ }
+ startLocatorPort = port;
+ }
+ catch (NumberFormatException e) {
+ throw new GemFireConfigException("Illegal port specified for start-locator", e);
+ }
+ }
+ else {
+ value = (String)checkAttribute(START_LOCATOR_NAME, value);
+ }
+ }
+ this.startLocator = value;
+ }
+ public void setStatisticSamplingEnabled(boolean value) {
+ this.statisticSamplingEnabled = (Boolean)checkAttribute(STATISTIC_SAMPLING_ENABLED_NAME, value);
+ }
+ public void setStatisticSampleRate(int value) {
+ value = (Integer)checkAttribute(STATISTIC_SAMPLE_RATE_NAME, value);
+ if (value < DEFAULT_STATISTIC_SAMPLE_RATE) {
+ // fix 48228
+ InternalDistributedSystem ids = InternalDistributedSystem.getConnectedInstance();
+ if (ids != null) {
+ ids.getLogWriter().info("Setting statistic-sample-rate to " + DEFAULT_STATISTIC_SAMPLE_RATE + " instead of the requested " + value + " because VSD does not work with sub-second sampling.");
+ }
+ value = DEFAULT_STATISTIC_SAMPLE_RATE;
+ }
+ this.statisticSampleRate = value;
+ }
+ public void setStatisticArchiveFile(File value) {
+ if (value == null) {
+ value = new File("");
+ }
+ this.statisticArchiveFile = (File)checkAttribute(STATISTIC_ARCHIVE_FILE_NAME, value);
+ }
+ public void setCacheXmlFile(File value) {
+ this.cacheXmlFile = (File)checkAttribute(CACHE_XML_FILE_NAME, value);
+ }
+ public void setAckWaitThreshold(int value) {
+ this.ackWaitThreshold = (Integer)checkAttribute(ACK_WAIT_THRESHOLD_NAME, value);
+ }
+
+ public void setAckSevereAlertThreshold(int value) {
+ this.ackForceDisconnectThreshold = (Integer)checkAttribute(ACK_SEVERE_ALERT_THRESHOLD_NAME, value);
+ }
+
+ public int getArchiveDiskSpaceLimit() {
+ return this.archiveDiskSpaceLimit;
+ }
+ public void setArchiveDiskSpaceLimit(int value) {
+ this.archiveDiskSpaceLimit = (Integer)checkAttribute(ARCHIVE_DISK_SPACE_LIMIT_NAME, value);
+ }
+ public int getArchiveFileSizeLimit() {
+ return this.archiveFileSizeLimit;
+ }
+ public void setArchiveFileSizeLimit(int value) {
+ this.archiveFileSizeLimit = (Integer)checkAttribute(ARCHIVE_FILE_SIZE_LIMIT_NAME, value);
+ }
+ public int getLogDiskSpaceLimit() {
+ return this.logDiskSpaceLimit;
+ }
+ public void setLogDiskSpaceLimit(int value) {
+ this.logDiskSpaceLimit = (Integer)checkAttribute(LOG_DISK_SPACE_LIMIT_NAME, value);
+ }
+ public int getLogFileSizeLimit() {
+ return this.logFileSizeLimit;
+ }
+ public void setLogFileSizeLimit(int value) {
+ this.logFileSizeLimit = (Integer)checkAttribute(LOG_FILE_SIZE_LIMIT_NAME, value);
+ }
+ public void setSSLEnabled( boolean value ) {
+ this.sslEnabled = (Boolean)checkAttribute(SSL_ENABLED_NAME, value);
+ }
+ public void setSSLProtocols( String value ) {
+ this.sslProtocols = (String)checkAttribute(SSL_PROTOCOLS_NAME, value);
+ }
+ public void setSSLCiphers( String value ) {
+ this.sslCiphers = (String)checkAttribute(SSL_CIPHERS_NAME, value);
+ }
+ public void setSSLRequireAuthentication( boolean value ){
+ this.sslRequireAuthentication = (Boolean)checkAttribute(SSL_REQUIRE_AUTHENTICATION_NAME, value);
+ }
+
+ public void setClusterSSLEnabled( boolean value ) {
+ this.clusterSSLEnabled = (Boolean)checkAttribute(CLUSTER_SSL_ENABLED_NAME, value);
+ }
+ public void setClusterSSLProtocols( String value ) {
+ this.clusterSSLProtocols = (String)checkAttribute(CLUSTER_SSL_PROTOCOLS_NAME, value);
+ }
+ public void setClusterSSLCiphers( String value ) {
+ this.clusterSSLCiphers = (String)checkAttribute(CLUSTER_SSL_CIPHERS_NAME, value);
+ }
+ public void setClusterSSLRequireAuthentication( boolean value ){
+ this.clusterSSLRequireAuthentication = (Boolean)checkAttribute(CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME, value);
+ }
+
+ public void setClusterSSLKeyStore( String value ) {
+ value = (String)checkAttribute(CLUSTER_SSL_KEYSTORE_NAME, value);
+ this.getClusterSSLProperties().setProperty(SSL_SYSTEM_PROPS_NAME + KEY_STORE_NAME, value);
+ this.clusterSSLKeyStore = value;
+ }
+ public void setClusterSSLKeyStoreType( String value ) {
+ value = (String)checkAttribute(CLUSTER_SSL_KEYSTORE_TYPE_NAME, value);
+ this.getClusterSSLProperties().setProperty(SSL_SYSTEM_PROPS_NAME + KEY_STORE_TYPE_NAME, value);
+ this.clusterSSLKeyStoreType = value;
+ }
+ public void setClusterSSLKeyStorePassword( String value ) {
+ value = (String)checkAttribute(CLUSTER_SSL_KEYSTORE_PASSWORD_NAME, value);
+ this.getClusterSSLProperties().setProperty(SSL_SYSTEM_PROPS_NAME + KEY_STORE_PASSWORD_NAME, value);
+ this.clusterSSLKeyStorePassword =value;
+ }
+ public void setClusterSSLTrustStore( String value ) {
+ value = (String)checkAttribute(CLUSTER_SSL_TRUSTSTORE_NAME, value);
+ this.getClusterSSLProperties().setProperty(SSL_SYSTEM_PROPS_NAME + TRUST_STORE_NAME, value);
+ this.clusterSSLTrustStore = value;
+ }
+ public void setClusterSSLTrustStorePassword( String value ) {
+ value = (String)checkAttribute(CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME, value);
+ this.getClusterSSLProperties().setProperty(SSL_SYSTEM_PROPS_NAME + TRUST_STORE_PASSWORD_NAME, value);
+ this.clusterSSLTrustStorePassword = value;
+ }
+
+ public int getMcastSendBufferSize() {
+ return mcastSendBufferSize;
+ }
+
+ public void setMcastSendBufferSize(int value) {
+ mcastSendBufferSize = (Integer)checkAttribute(MCAST_SEND_BUFFER_SIZE_NAME, value);
+ }
+
+ public int getMcastRecvBufferSize() {
+ return mcastRecvBufferSize;
+ }
+
+ public void setMcastRecvBufferSize(int value) {
+ mcastRecvBufferSize = (Integer)checkAttribute(MCAST_RECV_BUFFER_SIZE_NAME, value);
+ }
+ public void setAsyncDistributionTimeout(int value) {
+ this.asyncDistributionTimeout = (Integer)checkAttribute(ASYNC_DISTRIBUTION_TIMEOUT_NAME, value);
+ }
+ public void setAsyncQueueTimeout(int value) {
+ this.asyncQueueTimeout = (Integer)checkAttribute(ASYNC_QUEUE_TIMEOUT_NAME, value);
+ }
+ public void setAsyncMaxQueueSize(int value) {
+ this.asyncMaxQueueSize = (Integer)checkAttribute(ASYNC_MAX_QUEUE_SIZE_NAME, value);
+ }
+
+ public FlowControlParams getMcastFlowControl() {
+ return mcastFlowControl;
+ }
+
+ public void setMcastFlowControl(FlowControlParams values) {
+ mcastFlowControl = (FlowControlParams)checkAttribute(MCAST_FLOW_CONTROL_NAME, values);
+ }
+
+ public int getUdpFragmentSize() {
+ return udpFragmentSize;
+ }
+
+ public void setUdpFragmentSize(int value) {
+ udpFragmentSize = (Integer)checkAttribute(UDP_FRAGMENT_SIZE_NAME, value);
+ }
+
+ public int getUdpSendBufferSize() {
+ return udpSendBufferSize;
+ }
+
+ public void setUdpSendBufferSize(int value) {
+ udpSendBufferSize = (Integer)checkAttribute(UDP_SEND_BUFFER_SIZE_NAME, value);
+ }
+
+ public int getUdpRecvBufferSize() {
+ return udpRecvBufferSize;
+ }
+
+ public void setUdpRecvBufferSize(int value) {
+ udpRecvBufferSize = (Integer)checkAttribute(UDP_RECV_BUFFER_SIZE_NAME, value);
+ }
+
+ public boolean getDisableTcp() {
+ return disableTcp;
+ }
+
+ public void setDisableTcp(boolean newValue) {
+ disableTcp = newValue;
+ }
+
+ public boolean getEnableTimeStatistics() {
+ return enableTimeStatistics;
+ }
+
+ public void setEnableTimeStatistics(boolean newValue) {
+ enableTimeStatistics = newValue;
+ }
+
+ public int getMemberTimeout() {
+ return memberTimeout;
+ }
+
+ public void setMemberTimeout(int value) {
+ memberTimeout = (Integer)checkAttribute(MEMBER_TIMEOUT_NAME, value);
+ }
+
+ /** @since 5.7 */
+ public String getClientConflation() {
+ return this.clientConflation;
+ }
+
+ /** @since 5.7 */
+ public void setClientConflation(String value) {
+ this.clientConflation = (String)checkAttribute(CLIENT_CONFLATION_PROP_NAME, value);
+ }
+
+ public String getDurableClientId() {
+ return durableClientId;
+ }
+
+ public void setDurableClientId(String value) {
+ durableClientId = (String)checkAttribute(DURABLE_CLIENT_ID_NAME, value);
+ }
+
+ public int getDurableClientTimeout() {
+ return durableClientTimeout;
+ }
+
+ public void setDurableClientTimeout(int value) {
+ durableClientTimeout = (Integer)checkAttribute(DURABLE_CLIENT_TIMEOUT_NAME, value);
+ }
+
+ public String getSecurityClientAuthInit() {
+ return securityClientAuthInit;
+ }
+
+ public void setSecurityClientAuthInit(String value) {
+ securityClientAuthInit = (String)checkAttribute(SECURITY_CLIENT_AUTH_INIT_NAME, value);
+ }
+
+ public String getSecurityClientAuthenticator() {
+ return securityClientAuthenticator;
+ }
+
++ public String getSecurityRestTokenService() {
++ return securityRestTokenService;
++ }
++
+ public boolean getEnableNetworkPartitionDetection() {
+ return this.enableNetworkPartitionDetection;
+ }
+ public void setEnableNetworkPartitionDetection(boolean value) {
+ this.enableNetworkPartitionDetection = value;
+ }
+
+ public boolean getDisableAutoReconnect() {
+ return this.disableAutoReconnect;
+ }
+ public void setDisableAutoReconnect(boolean value) {
+ this.disableAutoReconnect = value;
+ }
+
+ public void setSecurityClientAuthenticator(String value) {
+ securityClientAuthenticator = (String)checkAttribute(SECURITY_CLIENT_AUTHENTICATOR_NAME, value);
+ }
+
++ public void setSecurityRestTokenService(String value) {
++ checkSecurityRestTokenService(value);
++ securityRestTokenService = value;
++ }
++
+ public String getSecurityClientDHAlgo() {
+ return securityClientDHAlgo;
+ }
+
+ public void setSecurityClientDHAlgo(String value) {
+ securityClientDHAlgo = (String)checkAttribute(SECURITY_CLIENT_DHALGO_NAME, value);
+ }
+
+ public String getSecurityPeerAuthInit() {
+ return securityPeerAuthInit;
+ }
+
+ public void setSecurityPeerAuthInit(String value) {
+ securityPeerAuthInit = (String)checkAttribute(SECURITY_PEER_AUTH_INIT_NAME, value);
+ }
+
+ public String getSecurityPeerAuthenticator() {
+ return securityPeerAuthenticator;
+ }
+
+ public void setSecurityPeerAuthenticator(String value) {
+ securityPeerAuthenticator = (String)checkAttribute(SECURITY_PEER_AUTHENTICATOR_NAME, value);
+ }
+
+ public String getSecurityClientAccessor() {
+ return securityClientAccessor;
+ }
+
+ public void setSecurityClientAccessor(String value) {
+ securityClientAccessor = (String)checkAttribute(SECURITY_CLIENT_ACCESSOR_NAME, value);
+ }
+
+ public String getSecurityClientAccessorPP() {
+ return securityClientAccessorPP;
+ }
+
+ public void setSecurityClientAccessorPP(String value) {
+ securityClientAccessorPP = (String)checkAttribute(SECURITY_CLIENT_ACCESSOR_PP_NAME, value);
+ }
+
+ public int getSecurityLogLevel() {
+ return securityLogLevel;
+ }
+
+ public void setSecurityLogLevel(int value) {
+ securityLogLevel = (Integer)checkAttribute(SECURITY_LOG_LEVEL_NAME, value);
+ }
+
+ public File getSecurityLogFile() {
+ return securityLogFile;
+ }
+
+ public void setSecurityLogFile(File value) {
+ securityLogFile = (File)checkAttribute(SECURITY_LOG_FILE_NAME, value);
+ }
+
+ public int getSecurityPeerMembershipTimeout() {
+ return securityPeerMembershipTimeout;
+ }
+
+ public void setSecurityPeerMembershipTimeout(int value) {
+ securityPeerMembershipTimeout = (Integer)checkAttribute(SECURITY_PEER_VERIFYMEMBER_TIMEOUT_NAME, value);
+ }
+
+ public Properties getSecurityProps() {
+ return security;
+ }
+
+ public String getSecurity(String attName) {
+
+ Stri
<TRUNCATED>