You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2016/09/12 19:25:54 UTC
[2/2] incubator-geode git commit: GEODE-420: Renaming of
SecurableComponents to SecurableCommunicationChannel Renaming of HTTP_SERVICE
-> WEB
GEODE-420: Renaming of SecurableComponents to SecurableCommunicationChannel
Renaming of HTTP_SERVICE -> WEB
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/8ff5e7a4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/8ff5e7a4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/8ff5e7a4
Branch: refs/heads/feature/GEODE-420
Commit: 8ff5e7a4cb1069b40863f9408986c0a37de4659b
Parents: 3edfdf2
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Tue Sep 13 05:25:43 2016 +1000
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Tue Sep 13 05:25:43 2016 +1000
----------------------------------------------------------------------
.../client/internal/ConnectionFactoryImpl.java | 5 +-
.../internal/DistributionConfig.java | 7 +-
.../internal/DistributionConfigImpl.java | 29 ++--
.../membership/gms/fd/GMSHealthMonitor.java | 5 +-
.../internal/tcpserver/TcpClient.java | 5 +-
.../internal/tcpserver/TcpServer.java | 3 +-
.../gemfire/internal/admin/SSLConfig.java | 13 +-
.../cache/tier/sockets/AcceptorImpl.java | 5 +-
.../internal/net/SSLConfigurationFactory.java | 29 ++--
.../gemfire/internal/net/SocketCreator.java | 2 +-
.../internal/net/SocketCreatorFactory.java | 24 ++-
.../security/SecurableCommunicationChannel.java | 56 +++++++
.../gemfire/internal/tcp/TCPConduit.java | 3 +-
.../gemfire/management/GemFireProperties.java | 11 +-
.../management/internal/JettyHelper.java | 4 +-
.../management/internal/ManagementAgent.java | 6 +-
.../gemfire/management/internal/RestAgent.java | 4 +-
.../internal/beans/BeanUtilFuncs.java | 2 +-
.../SecurableCommunicationChannels.java | 62 ++++++++
.../LocatorLauncherLocalIntegrationTest.java | 6 +-
.../ServerLauncherLocalIntegrationTest.java | 6 +-
.../internal/net/JSSESocketJUnitTest.java | 14 +-
.../net/SSLConfigurationFactoryTest.java | 50 +++---
.../net/SocketCreatorFactoryJUnitTest.java | 158 +++++++++----------
.../internal/JettyHelperJUnitTest.java | 6 +-
.../tools/pulse/testbed/driver/PulseUITest.java | 4 +-
.../tools/pulse/tests/PulseAbstractTest.java | 4 +-
27 files changed, 325 insertions(+), 198 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
index 70ec538..a72b49e 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ConnectionFactoryImpl.java
@@ -33,6 +33,7 @@ import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
import com.gemstone.gemfire.security.GemFireSecurityException;
import org.apache.logging.log4j.Logger;
@@ -96,13 +97,13 @@ public class ConnectionFactoryImpl implements ConnectionFactory {
this.cancelCriterion = cancelCriterion;
this.pool = pool;
if (this.usedByGateway || (this.gatewaySender != null)) {
- this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.GATEWAY);
+ this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.GATEWAY);
if (sender!= null && !sender.getGatewayTransportFilters().isEmpty()) {
this.socketCreator.initializeTransportFilterClientSocketFactory(sender);
}
} else {
//If configured use SSL properties for cache-server
- this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.SERVER);
+ this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.SERVER);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
index 628231b..2a14bf7 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfig.java
@@ -36,6 +36,7 @@ import com.gemstone.gemfire.internal.Config;
import com.gemstone.gemfire.internal.ConfigSource;
import com.gemstone.gemfire.internal.logging.InternalLogWriter;
import com.gemstone.gemfire.internal.logging.LogConfig;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
import com.gemstone.gemfire.internal.tcp.Connection;
import com.gemstone.gemfire.memcached.GemFireMemcachedServer;
@@ -4367,7 +4368,7 @@ public interface DistributionConfig extends Config, LogConfig {
* @since Geode 1.0
*/
@ConfigAttributeGetter(name = SSL_ENABLED_COMPONENTS)
- SecurableComponent[] getSSLEnabledComponents();
+ SecurableCommunicationChannel[] getSecurableCommunicationChannels();
/**
* Sets the value of the {@link ConfigurationProperties#SSL_ENABLED_COMPONENTS}
@@ -4375,7 +4376,7 @@ public interface DistributionConfig extends Config, LogConfig {
* @since Geode 1.0
*/
@ConfigAttributeSetter(name = SSL_ENABLED_COMPONENTS)
- void setSSLEnabledComponents(SecurableComponent[] sslEnabledComponents);
+ void setSecurableCommunicationChannels(SecurableCommunicationChannel[] sslEnabledComponents);
/**
* The name of the {@link ConfigurationProperties#SSL_ENABLED_COMPONENTS} property
@@ -4388,7 +4389,7 @@ public interface DistributionConfig extends Config, LogConfig {
* The default ssl enabled components
* @since Geode 1.0
*/
- SecurableComponent[] DEFAULT_SSL_ENABLED_COMPONENTS = new SecurableComponent[] {};
+ SecurableCommunicationChannel[] DEFAULT_SSL_ENABLED_COMPONENTS = new SecurableCommunicationChannel[] {};
/**
* Returns the value of the {@link ConfigurationProperties#SSL_PROTOCOLS}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionConfigImpl.java
----------------------------------------------------------------------
diff --git 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
index 7b6b40d..35e8a9d 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
@@ -49,6 +49,7 @@ import com.gemstone.gemfire.internal.ConfigSource;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import com.gemstone.gemfire.internal.net.SocketCreator;
import com.gemstone.gemfire.internal.process.ProcessLauncherContext;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
import com.gemstone.gemfire.memcached.GemFireMemcachedServer;
@@ -553,7 +554,7 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement
private String httpServiceSSLAlias = DEFAULT_SSL_ALIAS;
- private SecurableComponent[] sslEnabledComponents = DEFAULT_SSL_ENABLED_COMPONENTS;
+ private SecurableCommunicationChannel[] securableCommunicationChannels = DEFAULT_SSL_ENABLED_COMPONENTS;
private String sslProtocols = DEFAULT_SSL_PROTOCOLS;
private String sslCiphers = DEFAULT_SSL_CIPHERS;
@@ -774,7 +775,7 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement
this.serverSSLAlias = other.getServerSSLAlias();
this.locatorSSLAlias = other.getLocatorSSLAlias();
- this.sslEnabledComponents = ((DistributionConfigImpl) other).sslEnabledComponents;
+ this.securableCommunicationChannels = ((DistributionConfigImpl) other).securableCommunicationChannels;
this.sslCiphers = other.getSSLCiphers();
this.sslProtocols = other.getSSLProtocols();
@@ -984,22 +985,22 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement
}
}
case CLUSTER: {
- return StringUtils.isEmpty(getClusterSSLAlias()) ? true : (getSSLEnabledComponents().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
+ return StringUtils.isEmpty(getClusterSSLAlias()) ? true : (getSecurableCommunicationChannels().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
}
case GATEWAY: {
- return StringUtils.isEmpty(getGatewaySSLAlias()) ? true : (getSSLEnabledComponents().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
+ return StringUtils.isEmpty(getGatewaySSLAlias()) ? true : (getSecurableCommunicationChannels().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
}
case HTTP_SERVICE: {
- return StringUtils.isEmpty(getHTTPServiceSSLAlias()) ? true : (getSSLEnabledComponents().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
+ return StringUtils.isEmpty(getHTTPServiceSSLAlias()) ? true : (getSecurableCommunicationChannels().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
}
case JMX: {
- return StringUtils.isEmpty(getJMXSSLAlias()) ? true : (getSSLEnabledComponents().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
+ return StringUtils.isEmpty(getJMXSSLAlias()) ? true : (getSecurableCommunicationChannels().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
}
case LOCATOR: {
- return StringUtils.isEmpty(getLocatorSSLAlias()) ? true : (getSSLEnabledComponents().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
+ return StringUtils.isEmpty(getLocatorSSLAlias()) ? true : (getSecurableCommunicationChannels().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
}
case SERVER: {
- return StringUtils.isEmpty(getServerSSLAlias()) ? true : (getSSLEnabledComponents().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
+ return StringUtils.isEmpty(getServerSSLAlias()) ? true : (getSecurableCommunicationChannels().length > 1 ? !StringUtils.isEmpty(getSSLDefaultAlias()) : true);
}
default:
return false;
@@ -2583,13 +2584,13 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement
}
@Override
- public SecurableComponent[] getSSLEnabledComponents() {
- return sslEnabledComponents;
+ public SecurableCommunicationChannel[] getSecurableCommunicationChannels() {
+ return securableCommunicationChannels;
}
@Override
- public void setSSLEnabledComponents(final SecurableComponent[] sslEnabledComponents) {
- this.sslEnabledComponents = sslEnabledComponents;
+ public void setSecurableCommunicationChannels(final SecurableCommunicationChannel[] sslEnabledComponents) {
+ this.securableCommunicationChannels = sslEnabledComponents;
}
@Override
@@ -2867,7 +2868,7 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement
.append(httpServiceSSLTrustStore, that.httpServiceSSLTrustStore)
.append(httpServiceSSLTrustStorePassword, that.httpServiceSSLTrustStorePassword)
.append(httpServiceSSLAlias, that.httpServiceSSLAlias)
- .append(sslEnabledComponents, that.sslEnabledComponents)
+ .append(securableCommunicationChannels, that.securableCommunicationChannels)
.append(sslProtocols, that.sslProtocols)
.append(sslCiphers, that.sslCiphers)
.append(sslKeyStore, that.sslKeyStore)
@@ -3041,7 +3042,7 @@ public class DistributionConfigImpl extends AbstractDistributionConfig implement
.append(httpServiceSSLTrustStore)
.append(httpServiceSSLTrustStorePassword)
.append(httpServiceSSLAlias)
- .append(sslEnabledComponents)
+ .append(securableCommunicationChannels)
.append(sslProtocols)
.append(sslCiphers)
.append(sslRequireAuthentication)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
index fd94153..b8cdbe9 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
@@ -65,6 +65,7 @@ import com.gemstone.gemfire.distributed.internal.membership.gms.messages.Suspect
import com.gemstone.gemfire.internal.ConnectionWatcher;
import com.gemstone.gemfire.internal.Version;
import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
/**
@@ -489,7 +490,7 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler {
InternalDistributedSystem internalDistributedSystem = InternalDistributedSystem.getConnectedInstance();
try {
logger.debug("Checking member {} with TCP socket connection {}:{}.", suspectMember, suspectMember.getInetAddress(), port);
- clientSocket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).connect(suspectMember.getInetAddress(), port,
+ clientSocket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).connect(suspectMember.getInetAddress(), port,
(int)memberTimeout, new ConnectTimeoutTask(services.getTimer(), memberTimeout), false, -1, false);
clientSocket.setTcpNoDelay(true);
return doTCPCheckMember(suspectMember, clientSocket);
@@ -635,7 +636,7 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler {
ServerSocket createServerSocket(InetAddress socketAddress, int[] portRange) {
ServerSocket serverSocket;
try {
- serverSocket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).createServerSocketUsingPortRange(socketAddress, 50/*backlog*/,
+ serverSocket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).createServerSocketUsingPortRange(socketAddress, 50/*backlog*/,
true/*isBindAddress*/, false/*useNIO*/, 65536/*tcpBufferSize*/, portRange, false);
socketPort = serverSocket.getLocalPort();
} catch (IOException | SystemConnectException e) {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
index 9aaee9f..2bb1b7f 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpClient.java
@@ -40,6 +40,7 @@ import com.gemstone.gemfire.internal.VersionedDataOutputStream;
import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.gemfire.internal.net.SocketCreator;
import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
/**
@@ -58,7 +59,7 @@ public class TcpClient {
private final SocketCreator socketCreator;
public TcpClient(DistributionConfig distributionConfig) {
- this(SocketCreatorFactory.setDistributionConfig(distributionConfig).getSocketCreatorForComponent(SecurableComponent.LOCATOR));
+ this(SocketCreatorFactory.setDistributionConfig(distributionConfig).getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR));
}
/**
@@ -66,7 +67,7 @@ public class TcpClient {
* SocketCreatorFactory should be initialized before invoking this method.
*/
public TcpClient() {
- this(SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.LOCATOR));
+ this(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
index 29d1d35..05c209c 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServer.java
@@ -60,6 +60,7 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.gemfire.internal.net.SocketCreator;
import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
/**
@@ -167,7 +168,7 @@ public class TcpServer {
}
if (this.socketCreator == null) {
- this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.LOCATOR);
+ this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR);
} else {
throw new RuntimeException("The socket Creator already exists");
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/SSLConfig.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/SSLConfig.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/SSLConfig.java
index 063ee05..9e5481e 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/SSLConfig.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/SSLConfig.java
@@ -22,6 +22,7 @@ import java.util.Iterator;
import java.util.Properties;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
import com.gemstone.gemfire.management.internal.SSLUtil;
@@ -41,7 +42,7 @@ public class SSLConfig {
private String truststorePassword = DistributionConfig.DEFAULT_SSL_TRUSTSTORE_PASSWORD;
private String truststoreType = DistributionConfig.DEFAULT_CLUSTER_SSL_KEYSTORE_TYPE;
private String alias = null;
- private SecurableComponent sslEnabledComponent = null;
+ private SecurableCommunicationChannel securableCommunicationChannel = null;
/**
* SSL implementation-specific key-value pairs. Each key should be prefixed
@@ -163,17 +164,17 @@ public class SSLConfig {
}
}
- public SecurableComponent getSecuredComponent() {
- return sslEnabledComponent;
+ public SecurableCommunicationChannel getSecuredCommunicationChannel() {
+ return securableCommunicationChannel;
}
- public void setSslEnabledComponent(final SecurableComponent sslEnabledComponent) {
- this.sslEnabledComponent = sslEnabledComponent;
+ public void setSecurableCommunicationChannel(final SecurableCommunicationChannel securableCommunicationChannel) {
+ this.securableCommunicationChannel = securableCommunicationChannel;
}
@Override
public String toString() {
- return "SSLConfig{" + "enabled=" + enabled + ", protocols='" + protocols + '\'' + ", ciphers='" + ciphers + '\'' + ", requireAuth=" + requireAuth + ", keystore='" + keystore + '\'' + ", keystoreType='" + keystoreType + '\'' + ", keystorePassword='" + keystorePassword + '\'' + ", truststore='" + truststore + '\'' + ", truststorePassword='" + truststorePassword + '\'' + ", truststoreType='" + truststoreType + '\'' + ", alias='" + alias + '\'' + ", sslEnabledComponent=" + sslEnabledComponent + ", properties=" + properties + '}';
+ return "SSLConfig{" + "enabled=" + enabled + ", protocols='" + protocols + '\'' + ", ciphers='" + ciphers + '\'' + ", requireAuth=" + requireAuth + ", keystore='" + keystore + '\'' + ", keystoreType='" + keystoreType + '\'' + ", keystorePassword='" + keystorePassword + '\'' + ", truststore='" + truststore + '\'' + ", truststorePassword='" + truststorePassword + '\'' + ", truststoreType='" + truststoreType + '\'' + ", alias='" + alias + '\'' + ", securableCommunicationChannel=" + securableCommunicationChannel + ", properties=" + properties + '}';
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImpl.java
index 0ad87ed..611b9fb 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/AcceptorImpl.java
@@ -86,6 +86,7 @@ import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.gemfire.internal.logging.LoggingThreadGroup;
import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
import com.gemstone.gemfire.internal.security.IntegratedSecurityService;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
import com.gemstone.gemfire.internal.security.SecurityService;
import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
@@ -388,9 +389,9 @@ public class AcceptorImpl extends Acceptor implements Runnable
{
if(!isGatewayReceiver) {
//If configured use SSL properties for cache-server
- this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.SERVER);
+ this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.SERVER);
} else {
- this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.GATEWAY);
+ this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.GATEWAY);
}
final GemFireCacheImpl gc;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactory.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactory.java
index 1339f5a..03b1a47 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactory.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactory.java
@@ -27,13 +27,14 @@ import org.springframework.util.StringUtils;
import com.gemstone.gemfire.GemFireConfigException;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.admin.SSLConfig;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
public class SSLConfigurationFactory {
private static SSLConfigurationFactory instance = new SSLConfigurationFactory();
private DistributionConfig distributionConfig = null;
- private Map<SecurableComponent, SSLConfig> registeredSSLConfig = new HashMap<>();
+ private Map<SecurableCommunicationChannel, SSLConfig> registeredSSLConfig = new HashMap<>();
private SSLConfigurationFactory() {
}
@@ -61,7 +62,7 @@ public class SSLConfigurationFactory {
getInstance().distributionConfig = distributionConfig;
}
- public static SSLConfig getSSLConfigForComponent(SecurableComponent sslEnabledComponent) {
+ public static SSLConfig getSSLConfigForComponent(SecurableCommunicationChannel sslEnabledComponent) {
SSLConfig sslConfig = getInstance().getRegisteredSSLConfigForComponent(sslEnabledComponent);
if (sslConfig == null) {
sslConfig = getInstance().createSSLConfigForComponent(sslEnabledComponent);
@@ -70,21 +71,21 @@ public class SSLConfigurationFactory {
return sslConfig;
}
- private synchronized void registeredSSLConfigForComponent(final SecurableComponent sslEnabledComponent, final SSLConfig sslConfig) {
+ private synchronized void registeredSSLConfigForComponent(final SecurableCommunicationChannel sslEnabledComponent, final SSLConfig sslConfig) {
registeredSSLConfig.put(sslEnabledComponent, sslConfig);
}
- private SSLConfig createSSLConfigForComponent(final SecurableComponent sslEnabledComponent) {
+ private SSLConfig createSSLConfigForComponent(final SecurableCommunicationChannel sslEnabledComponent) {
SSLConfig sslConfig = createSSLConfig(sslEnabledComponent);
- SecurableComponent[] sslEnabledComponents = getDistributionConfig().getSSLEnabledComponents();
+ SecurableCommunicationChannel[] sslEnabledComponents = getDistributionConfig().getSecurableCommunicationChannels();
if (sslEnabledComponents.length == 0) {
sslConfig = configureLegacyClusterSSL(sslConfig);
}
- sslConfig.setSslEnabledComponent(sslEnabledComponent);
+ sslConfig.setSecurableCommunicationChannel(sslEnabledComponent);
switch (sslEnabledComponent) {
case ALL: {
//Create a SSLConfig separate for HTTP Service. As the require-authentication might differ
- createSSLConfigForComponent(SecurableComponent.HTTP_SERVICE);
+ createSSLConfigForComponent(SecurableCommunicationChannel.WEB);
break;
}
case CLUSTER: {
@@ -117,7 +118,7 @@ public class SSLConfigurationFactory {
}
break;
}
- case HTTP_SERVICE: {
+ case WEB: {
if (sslEnabledComponents.length > 0) {
sslConfig = setAliasForComponent(sslConfig, getDistributionConfig().getHTTPServiceSSLAlias());
sslConfig.setRequireAuth(getDistributionConfig().getSSLHTTPRequireAuthentication());
@@ -146,7 +147,7 @@ public class SSLConfigurationFactory {
return sslConfig;
}
- private SSLConfig createSSLConfig(final SecurableComponent sslEnabledComponent) {
+ private SSLConfig createSSLConfig(final SecurableCommunicationChannel sslEnabledComponent) {
SSLConfig sslConfig = new SSLConfig();
sslConfig.setCiphers(getDistributionConfig().getSSLCiphers());
sslConfig.setEnabled(determineIfSSLEnabledForSSLComponent(sslEnabledComponent));
@@ -161,14 +162,14 @@ public class SSLConfigurationFactory {
return sslConfig;
}
- private boolean determineIfSSLEnabledForSSLComponent(final SecurableComponent sslEnabledComponent) {
- if (ArrayUtils.contains(getDistributionConfig().getSSLEnabledComponents(), SecurableComponent.NONE)) {
+ private boolean determineIfSSLEnabledForSSLComponent(final SecurableCommunicationChannel sslEnabledComponent) {
+ if (ArrayUtils.contains(getDistributionConfig().getSecurableCommunicationChannels(), SecurableComponent.NONE)) {
return false;
}
- if (ArrayUtils.contains(getDistributionConfig().getSSLEnabledComponents(), SecurableComponent.ALL)) {
+ if (ArrayUtils.contains(getDistributionConfig().getSecurableCommunicationChannels(), SecurableComponent.ALL)) {
return true;
}
- return ArrayUtils.contains(getDistributionConfig().getSSLEnabledComponents(), sslEnabledComponent) ? true : false;
+ return ArrayUtils.contains(getDistributionConfig().getSecurableCommunicationChannels(), sslEnabledComponent) ? true : false;
}
/**
@@ -308,7 +309,7 @@ public class SSLConfigurationFactory {
return propertyValue;
}
- private SSLConfig getRegisteredSSLConfigForComponent(final SecurableComponent sslEnabledComponent) {
+ private SSLConfig getRegisteredSSLConfigForComponent(final SecurableCommunicationChannel sslEnabledComponent) {
return registeredSSLConfig.get(sslEnabledComponent);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreator.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreator.java
index 6ddd0a2..5136f19 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreator.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreator.java
@@ -331,7 +331,7 @@ public class SocketCreator {
private void initialize() {
try {
// set p2p values...
- if (SecurableComponent.CLUSTER.equals(sslConfig.getSecuredComponent())) {
+ if (SecurableComponent.CLUSTER.equals(sslConfig.getSecuredCommunicationChannel())) {
if (this.sslConfig.isEnabled()) {
System.setProperty("p2p.useSSL", "true");
System.setProperty("p2p.oldIO", "true");
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreatorFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreatorFactory.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreatorFactory.java
index 337ca9c..4ef3103 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreatorFactory.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/net/SocketCreatorFactory.java
@@ -19,20 +19,18 @@ package com.gemstone.gemfire.internal.net;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import java.util.StringTokenizer;
-import java.util.Vector;
import org.apache.commons.lang.ArrayUtils;
import com.gemstone.gemfire.GemFireConfigException;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.internal.admin.SSLConfig;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
public class SocketCreatorFactory {
private static SocketCreatorFactory instance = null;
- private Map<SecurableComponent, SocketCreator> socketCreators = new HashMap<>();
+ private Map<SecurableCommunicationChannel, SocketCreator> socketCreators = new HashMap<>();
private DistributionConfig distributionConfig;
/**
@@ -65,16 +63,16 @@ public class SocketCreatorFactory {
return getInstance(false);
}
- public static SocketCreator getSocketCreatorForComponent(SecurableComponent sslEnabledComponent) {
+ public static SocketCreator getSocketCreatorForComponent(SecurableCommunicationChannel sslEnabledComponent) {
SSLConfig sslConfigForComponent = SSLConfigurationFactory.getSSLConfigForComponent(sslEnabledComponent);
return getInstance().getOrCreateSocketCreatorForSSLEnabledComponent(sslEnabledComponent, sslConfigForComponent);
}
- private SocketCreator getSSLSocketCreator(final SecurableComponent sslComponent, final SSLConfig sslConfig) {
+ private SocketCreator getSSLSocketCreator(final SecurableCommunicationChannel sslComponent, final SSLConfig sslConfig) {
if (sslConfig.isEnabled()) {
- if (ArrayUtils.contains(getDistributionConfig().getSSLEnabledComponents(), SecurableComponent.ALL)) {
- return createSSLSocketCreator(SecurableComponent.ALL, sslConfig);
-// } else if (ArrayUtils.contains(getDistributionConfig().getSSLEnabledComponents(), sslComponent)) {
+ if (ArrayUtils.contains(getDistributionConfig().getSecurableCommunicationChannels(), SecurableCommunicationChannel.ALL)) {
+ return createSSLSocketCreator(SecurableCommunicationChannel.ALL, sslConfig);
+ // } else if (ArrayUtils.contains(getDistributionConfig().getSecurableCommunicationChannels(), sslComponent)) {
} else {
return createSSLSocketCreator(sslComponent, sslConfig);
}
@@ -83,7 +81,7 @@ public class SocketCreatorFactory {
}
- private SocketCreator getOrCreateSocketCreatorForSSLEnabledComponent(final SecurableComponent sslEnabledComponent, final SSLConfig sslConfig) {
+ private SocketCreator getOrCreateSocketCreatorForSSLEnabledComponent(final SecurableCommunicationChannel sslEnabledComponent, final SSLConfig sslConfig) {
SocketCreator socketCreator = getRegisteredSocketCreatorForComponent(sslEnabledComponent);
if (socketCreator == null) {
return getSSLSocketCreator(sslEnabledComponent, sslConfig);
@@ -92,7 +90,7 @@ public class SocketCreatorFactory {
}
}
- private SocketCreator createSSLSocketCreator(final SecurableComponent sslEnableComponent, final SSLConfig sslConfig) {
+ private SocketCreator createSSLSocketCreator(final SecurableCommunicationChannel sslEnableComponent, final SSLConfig sslConfig) {
SocketCreator socketCreator = null;
if (sslConfig.isEnabled()) {
socketCreator = new SocketCreator(sslConfig);
@@ -107,11 +105,11 @@ public class SocketCreatorFactory {
return socketCreator;
}
- private synchronized void registerSocketCreatorForComponent(SecurableComponent sslEnabledComponent, SocketCreator socketCreator) {
+ private synchronized void registerSocketCreatorForComponent(SecurableCommunicationChannel sslEnabledComponent, SocketCreator socketCreator) {
socketCreators.put(sslEnabledComponent, socketCreator);
}
- private synchronized SocketCreator getRegisteredSocketCreatorForComponent(SecurableComponent sslEnabledComponent) {
+ private synchronized SocketCreator getRegisteredSocketCreatorForComponent(SecurableCommunicationChannel sslEnabledComponent) {
return socketCreators.get(sslEnabledComponent);
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/internal/security/SecurableCommunicationChannel.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/security/SecurableCommunicationChannel.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/SecurableCommunicationChannel.java
new file mode 100644
index 0000000..5dce877
--- /dev/null
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/security/SecurableCommunicationChannel.java
@@ -0,0 +1,56 @@
+/*
+ * 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.internal.security;
+
+import org.apache.geode.security.SecurableCommunicationChannels;
+
+import com.gemstone.gemfire.GemFireConfigException;
+
+public enum SecurableCommunicationChannel {
+ ALL(SecurableCommunicationChannels.ALL),
+ CLUSTER(SecurableCommunicationChannels.CLUSTER),
+ SERVER(SecurableCommunicationChannels.SERVER),
+ JMX(SecurableCommunicationChannels.JMX),
+ WEB(SecurableCommunicationChannels.WEB),
+ GATEWAY(SecurableCommunicationChannels.GATEWAY),
+ LOCATOR(SecurableCommunicationChannels.LOCATOR),
+ NONE("NO_COMPONENT");
+
+ private final String constant;
+
+ SecurableCommunicationChannel(final String constant) {
+ this.constant = constant;
+ }
+
+ public static SecurableCommunicationChannel getEnum(String enumString) {
+ for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
+ if (securableCommunicationChannel.constant.equalsIgnoreCase(enumString)) {
+ return securableCommunicationChannel;
+ }
+ }
+ throw new GemFireConfigException("There is no registered component for the name: " + enumString);
+ }
+
+ public String getConstant() {
+ return constant;
+ }
+
+ @Override
+ public String toString() {
+ return constant;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/TCPConduit.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/TCPConduit.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/TCPConduit.java
index aa60101..dc8fdff 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/TCPConduit.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/tcp/TCPConduit.java
@@ -61,6 +61,7 @@ import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
import com.gemstone.gemfire.internal.logging.log4j.LogMarker;
import com.gemstone.gemfire.internal.net.SocketCreator;
import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
/**
@@ -282,7 +283,7 @@ public class TCPConduit implements Runnable {
}
}
- this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER);
+ this.socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER);
startAcceptor();
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/management/GemFireProperties.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/GemFireProperties.java b/geode-core/src/main/java/com/gemstone/gemfire/management/GemFireProperties.java
index 61f4072..fce1314 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/GemFireProperties.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/GemFireProperties.java
@@ -17,6 +17,7 @@
package com.gemstone.gemfire.management;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.SecurableComponent;
/**
@@ -640,7 +641,7 @@ public class GemFireProperties {
private String locatorSSLAlias;
- private SecurableComponent[] sslEnabledComponents;
+ private SecurableCommunicationChannel[] securableCommunicationChannels;
private String sslProtocols;
private String sslCiphers;
private boolean sslRequireAuthentication;
@@ -1785,12 +1786,12 @@ public class GemFireProperties {
this.locatorSSLAlias = locatorSSLAlias;
}
- public SecurableComponent[] getSSLEnabledComponents() {
- return sslEnabledComponents;
+ public SecurableCommunicationChannel[] getSecurableCommunicationChannel() {
+ return securableCommunicationChannels;
}
- public void setSSLEnabledComponents(final SecurableComponent[] sslEnabledComponents) {
- this.sslEnabledComponents = sslEnabledComponents;
+ public void setSecurableCommunicationChannel(final SecurableCommunicationChannel[] sslEnabledComponents) {
+ this.securableCommunicationChannels = sslEnabledComponents;
}
public String getSSLProtocols() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JettyHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JettyHelper.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JettyHelper.java
index 569cb7b..69acb3e 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JettyHelper.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/JettyHelper.java
@@ -37,7 +37,7 @@ import com.gemstone.gemfire.internal.admin.SSLConfig;
import com.gemstone.gemfire.internal.lang.StringUtils;
import com.gemstone.gemfire.internal.logging.LogService;
import com.gemstone.gemfire.internal.net.SSLConfigurationFactory;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
/**
* @since GemFire 8.1
@@ -197,7 +197,7 @@ public class JettyHelper {
if (args.length > 1) {
System.out.printf("Temporary Directory @ ($1%s)%n", USER_DIR);
- final Server jetty = JettyHelper.initJetty(null, 8090, SSLConfigurationFactory.getSSLConfigForComponent(SecurableComponent.HTTP_SERVICE));
+ final Server jetty = JettyHelper.initJetty(null, 8090, SSLConfigurationFactory.getSSLConfigForComponent(SecurableCommunicationChannel.WEB));
for (int index = 0; index < args.length; index += 2) {
final String webAppContext = args[index];
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java
index 5f0d497..a9cc0ed 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementAgent.java
@@ -60,7 +60,7 @@ import com.gemstone.gemfire.internal.net.SSLConfigurationFactory;
import com.gemstone.gemfire.internal.net.SocketCreator;
import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
import com.gemstone.gemfire.internal.security.GeodeSecurityUtil;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.internal.security.shiro.JMXShiroAuthenticator;
import com.gemstone.gemfire.internal.tcp.TCPConduit;
import com.gemstone.gemfire.management.ManagementException;
@@ -227,7 +227,7 @@ public class ManagementAgent {
boolean isRestWebAppAdded = false;
- this.httpServer = JettyHelper.initJetty(bindAddress, port, SSLConfigurationFactory.getSSLConfigForComponent(SecurableComponent.HTTP_SERVICE));
+ this.httpServer = JettyHelper.initJetty(bindAddress, port, SSLConfigurationFactory.getSSLConfigForComponent(SecurableCommunicationChannel.WEB));
if (agentUtil.isWebApplicationAvailable(gemfireWar)) {
this.httpServer = JettyHelper
@@ -356,7 +356,7 @@ public class ManagementAgent {
bindAddr = InetAddress.getByName(hostname);
}
- final SocketCreator socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.JMX);
+ final SocketCreator socketCreator = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.JMX);
final boolean ssl = socketCreator.useSSL();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/management/internal/RestAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/RestAgent.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/RestAgent.java
index a8c480b..ed586db 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/RestAgent.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/RestAgent.java
@@ -36,7 +36,7 @@ import com.gemstone.gemfire.internal.net.SocketCreator;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.InternalRegionArguments;
import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.management.ManagementService;
/**
@@ -133,7 +133,7 @@ public class RestAgent {
final int port = this.config.getHttpServicePort();
- this.httpServer = JettyHelper.initJetty(httpServiceBindAddress, port, SSLConfigurationFactory.getSSLConfigForComponent(SecurableComponent.HTTP_SERVICE));
+ this.httpServer = JettyHelper.initJetty(httpServiceBindAddress, port, SSLConfigurationFactory.getSSLConfigForComponent(SecurableCommunicationChannel.WEB));
this.httpServer = JettyHelper.addWebApplication(httpServer, "/gemfire-api", gemfireAPIWar);
this.httpServer = JettyHelper.addWebApplication(httpServer, "/geode", gemfireAPIWar);
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/BeanUtilFuncs.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/BeanUtilFuncs.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/BeanUtilFuncs.java
index 8e05d74..c591192 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/BeanUtilFuncs.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/beans/BeanUtilFuncs.java
@@ -334,7 +334,7 @@ public class BeanUtilFuncs {
gemFirePropertyData.setStartDevRestApi(config.getStartDevRestApi());
gemFirePropertyData.setSSLCiphers(config.getSSLCiphers());
- gemFirePropertyData.setSSLEnabledComponents(config.getSSLEnabledComponents());
+ gemFirePropertyData.setSecurableCommunicationChannel(config.getSecurableCommunicationChannels());
gemFirePropertyData.setSSLHttpServiceRequireAuthentication(config.getSSLHTTPRequireAuthentication());
gemFirePropertyData.setSSLKeyStore(config.getSSLKeyStore());
gemFirePropertyData.setSSLKeyStoreType(config.getSSLKeyStoreType());
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/main/java/org/apache/geode/security/SecurableCommunicationChannels.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/security/SecurableCommunicationChannels.java b/geode-core/src/main/java/org/apache/geode/security/SecurableCommunicationChannels.java
new file mode 100644
index 0000000..cf398da
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/security/SecurableCommunicationChannels.java
@@ -0,0 +1,62 @@
+/*
+ * 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 org.apache.geode.security;
+
+import com.gemstone.gemfire.distributed.ConfigurationProperties;
+
+/**
+ * This class defines all the static definitions for the {@link ConfigurationProperties#SSL_ENABLED_COMPONENTS}
+ * <U>Since</U>: Geode 1.0
+ */
+public interface SecurableCommunicationChannels {
+
+ /**
+ * This determines that all components will be secured.
+ * <U>Since</U>: Geode 1.0
+ */
+ String ALL = "all";
+ /**
+ * This determines that the client-server communication will be secured.
+ * <U>Since</U>: Geode 1.0
+ */
+ String SERVER = "server";
+ /**
+ * This determines that the inter-server (or server-to-server) communication will be secured.
+ * <U>Since</U>: Geode 1.0
+ */
+ String CLUSTER = "cluster";
+ /**
+ * This determines that test jmx communication will be secured.
+ * <U>Since</U>: Geode 1.0
+ */
+ String JMX = "jmx";
+ /**
+ * This determines that the http service communication will be secured.
+ * <U>Since</U>: Geode 1.0
+ */
+ String WEB = "web";
+ /**
+ * This determines that the gateway communication will be secured.
+ * <U>Since</U>: Geode 1.0
+ */
+ String GATEWAY = "gateway";
+ /**
+ * This determines that the locator communication will be secured.
+ * <U>Since</U>: Geode 1.0
+ */
+ String LOCATOR = "locator";
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherLocalIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherLocalIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherLocalIntegrationTest.java
index a3623f6..8b9bd96 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherLocalIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherLocalIntegrationTest.java
@@ -25,7 +25,7 @@ import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
import com.gemstone.gemfire.internal.process.ProcessControllerFactory;
import com.gemstone.gemfire.internal.process.ProcessType;
import com.gemstone.gemfire.internal.process.ProcessUtils;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import com.gemstone.gemfire.test.junit.runners.CategoryWithParameterizedRunnerFactory;
import org.junit.After;
@@ -327,7 +327,7 @@ public class LocatorLauncherLocalIntegrationTest extends AbstractLocatorLauncher
return;
}
- this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).createServerSocket(this.locatorPort, 50, null, -1);
+ this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).createServerSocket(this.locatorPort, 50, null, -1);
assertTrue(this.socket.isBound());
assertFalse(this.socket.isClosed());
assertFalse(AvailablePort.isPortAvailable(this.locatorPort, AvailablePort.SOCKET));
@@ -544,7 +544,7 @@ public class LocatorLauncherLocalIntegrationTest extends AbstractLocatorLauncher
}
// generate one free port and then use it instead of default
- this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).createServerSocket(this.locatorPort, 50, null, -1);
+ this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).createServerSocket(this.locatorPort, 50, null, -1);
this.launcher = new Builder()
.setMemberName(getUniqueName())
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
index 129e727..03b01cf 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
@@ -35,7 +35,7 @@ import com.gemstone.gemfire.internal.net.SocketCreatorFactory;
import com.gemstone.gemfire.internal.process.ProcessControllerFactory;
import com.gemstone.gemfire.internal.process.ProcessType;
import com.gemstone.gemfire.internal.process.ProcessUtils;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import org.junit.After;
import org.junit.Before;
@@ -609,7 +609,7 @@ public class ServerLauncherLocalIntegrationTest extends AbstractServerLauncherIn
String rootFolder = this.temporaryFolder.getRoot().getCanonicalPath();
// generate one free port and then use TEST_OVERRIDE_DEFAULT_PORT_PROPERTY
- this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).createServerSocket(this.serverPort, 50, null, -1);
+ this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).createServerSocket(this.serverPort, 50, null, -1);
assertFalse(AvailablePort.isPortAvailable(this.serverPort, AvailablePort.SOCKET));
// build and start the server
@@ -770,7 +770,7 @@ public class ServerLauncherLocalIntegrationTest extends AbstractServerLauncherIn
// generate one free port and then use TEST_OVERRIDE_DEFAULT_PORT_PROPERTY
final int freeTCPPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
- this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).createServerSocket(freeTCPPort, 50, null, -1);
+ this.socket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).createServerSocket(freeTCPPort, 50, null, -1);
// build and start the server
final Builder builder = new Builder()
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
index 313f797..e0f1e8c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
@@ -50,7 +50,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.test.dunit.ThreadUtils;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
import com.gemstone.gemfire.util.test.TestUtil;
@@ -127,13 +127,13 @@ public class JSSESocketJUnitTest {
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(new Properties());
SocketCreatorFactory.setDistributionConfig(distributionConfig);
- assertTrue(SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).useSSL());
+ assertTrue(SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).useSSL());
- final ServerSocket serverSocket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).createServerSocket(randport, 0, InetAddress.getByName("localhost"));
+ final ServerSocket serverSocket = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).createServerSocket(randport, 0, InetAddress.getByName("localhost"));
Thread serverThread = startServer(serverSocket, receiver);
- Socket client = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).connectForServer(InetAddress.getByName("localhost"), randport);
+ Socket client = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).connectForServer(InetAddress.getByName("localhost"), randport);
ObjectOutputStream oos = new ObjectOutputStream(client.getOutputStream());
String expected = new String("testing " + name.getMethodName());
@@ -186,7 +186,7 @@ public class JSSESocketJUnitTest {
factoryInvoked = false;
try {
try {
- Socket sock = SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).connectForClient("localhost", 12345, 0);
+ Socket sock = SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).connectForClient("localhost", 12345, 0);
sock.close();
fail("socket factory was invoked");
} catch (IOException e) {
@@ -194,7 +194,7 @@ public class JSSESocketJUnitTest {
}
} finally {
System.getProperties().remove(DistributionConfig.GEMFIRE_PREFIX + "clientSocketFactory");
- SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).initializeClientSocketFactory();
+ SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).initializeClientSocketFactory();
}
}
@@ -222,7 +222,7 @@ public class JSSESocketJUnitTest {
public void run() {
try {
Socket s = serverSocket.accept();
- SocketCreatorFactory.getSocketCreatorForComponent(SecurableComponent.CLUSTER).configureServerSSLSocket(s);
+ SocketCreatorFactory.getSocketCreatorForComponent(SecurableCommunicationChannel.CLUSTER).configureServerSSLSocket(s);
ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
receiver[0] = ois.readObject();
server = s;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8ff5e7a4/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactoryTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactoryTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactoryTest.java
index bc142e2..18729fd 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactoryTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SSLConfigurationFactoryTest.java
@@ -29,7 +29,7 @@ import org.junit.experimental.categories.Category;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
import com.gemstone.gemfire.internal.admin.SSLConfig;
-import com.gemstone.gemfire.internal.security.SecurableComponent;
+import com.gemstone.gemfire.internal.security.SecurableCommunicationChannel;
import com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase;
import com.gemstone.gemfire.test.junit.categories.UnitTest;
@@ -55,7 +55,7 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
properties.setProperty(SSL_PROTOCOLS, "Protocol1,Protocol2");
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
SSLConfigurationFactory.setDistributionConfig(distributionConfig);
- for (SecurableComponent securableComponent : SecurableComponent.values()) {
+ for (SecurableCommunicationChannel securableComponent : SecurableCommunicationChannel.values()) {
assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
}
}
@@ -74,8 +74,8 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
properties.setProperty(SSL_PROTOCOLS, "any");
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
SSLConfigurationFactory.setDistributionConfig(distributionConfig);
- for (SecurableComponent securableComponent : SecurableComponent.values()) {
- assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
+ for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
+ assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
}
}
@@ -93,15 +93,15 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
properties.setProperty(SSL_PROTOCOLS, "any");
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
SSLConfigurationFactory.setDistributionConfig(distributionConfig);
- for (SecurableComponent securableComponent : SecurableComponent.values()) {
- assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
+ for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
+ assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
}
}
@Test
public void getSSLConfigForComponentHTTPService() throws Exception {
Properties properties = new Properties();
- properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableComponent.HTTP_SERVICE.getConstant());
+ properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant());
properties.setProperty(SSL_KEYSTORE, "someKeyStore");
properties.setProperty(SSL_KEYSTORE_PASSWORD, "keystorePassword");
properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
@@ -112,15 +112,15 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
properties.setProperty(SSL_PROTOCOLS, "any");
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
SSLConfigurationFactory.setDistributionConfig(distributionConfig);
- for (SecurableComponent securableComponent : SecurableComponent.values()) {
- assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
+ for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
+ assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
}
}
@Test
public void getSSLConfigForComponentHTTPServiceWithAlias() throws Exception {
Properties properties = new Properties();
- properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableComponent.HTTP_SERVICE.getConstant());
+ properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant());
properties.setProperty(SSL_KEYSTORE, "someKeyStore");
properties.setProperty(SSL_KEYSTORE_PASSWORD, "keystorePassword");
properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
@@ -132,15 +132,15 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
properties.setProperty(SSL_PROTOCOLS, "any");
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
SSLConfigurationFactory.setDistributionConfig(distributionConfig);
- for (SecurableComponent securableComponent : SecurableComponent.values()) {
- assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
+ for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
+ assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
}
}
@Test
public void getSSLConfigForComponentHTTPServiceWithMutualAuth() throws Exception {
Properties properties = new Properties();
- properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableComponent.HTTP_SERVICE.getConstant());
+ properties.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant());
properties.setProperty(SSL_KEYSTORE, "someKeyStore");
properties.setProperty(SSL_KEYSTORE_PASSWORD, "keystorePassword");
properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
@@ -153,16 +153,16 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
properties.setProperty(SSL_PROTOCOLS, "any");
DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
SSLConfigurationFactory.setDistributionConfig(distributionConfig);
- for (SecurableComponent securableComponent : SecurableComponent.values()) {
- assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableComponent), securableComponent, distributionConfig);
+ for (SecurableCommunicationChannel securableCommunicationChannel : SecurableCommunicationChannel.values()) {
+ assertSSLConfig(properties, SSLConfigurationFactory.getSSLConfigForComponent(securableCommunicationChannel), securableCommunicationChannel, distributionConfig);
}
}
private void assertSSLConfig(final Properties properties,
final SSLConfig sslConfig,
- final SecurableComponent expectedSecurableComponent,
+ final SecurableCommunicationChannel expectedSecurableComponent,
final DistributionConfigImpl distributionConfig) {
- assertEquals(isSSLComponentEnabled(expectedSecurableComponent, distributionConfig.getSSLEnabledComponents()), sslConfig.isEnabled());
+ assertEquals(isSSLComponentEnabled(expectedSecurableComponent, distributionConfig.getSecurableCommunicationChannels()), sslConfig.isEnabled());
assertEquals(properties.getProperty(SSL_KEYSTORE), sslConfig.getKeystore());
assertEquals(properties.getProperty(SSL_KEYSTORE_PASSWORD), sslConfig.getKeystorePassword());
assertEquals(properties.getProperty(SSL_KEYSTORE_TYPE), sslConfig.getKeystoreType());
@@ -172,17 +172,17 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
assertEquals(properties.getProperty(SSL_PROTOCOLS).replace(","," "), sslConfig.getProtocols());
assertEquals(getCorrectAlias(expectedSecurableComponent, properties), sslConfig.getAlias());
assertEquals(requiresAuthentication(properties, expectedSecurableComponent), sslConfig.isRequireAuth());
- assertEquals(expectedSecurableComponent, sslConfig.getSecuredComponent());
+ assertEquals(expectedSecurableComponent, sslConfig.getSecuredCommunicationChannel());
}
- private boolean requiresAuthentication(final Properties properties, final SecurableComponent expectedSecurableComponent) {
- boolean defaultAuthentication = expectedSecurableComponent.equals(SecurableComponent.HTTP_SERVICE) ? DistributionConfig.DEFAULT_SSL_HTTP_SERVICE_REQUIRE_AUTHENTICATION : DistributionConfig.DEFAULT_SSL_REQUIRE_AUTHENTICATION;
+ private boolean requiresAuthentication(final Properties properties, final SecurableCommunicationChannel expectedSecurableComponent) {
+ boolean defaultAuthentication = expectedSecurableComponent.equals(SecurableCommunicationChannel.WEB) ? DistributionConfig.DEFAULT_SSL_HTTP_SERVICE_REQUIRE_AUTHENTICATION : DistributionConfig.DEFAULT_SSL_REQUIRE_AUTHENTICATION;
String httpRequiresAuthentication = properties.getProperty(SSL_HTTP_SERVICE_REQUIRE_AUTHENTICATION);
return httpRequiresAuthentication == null ? defaultAuthentication : Boolean.parseBoolean(httpRequiresAuthentication);
}
- private String getCorrectAlias(final SecurableComponent expectedSecurableComponent, final Properties properties) {
+ private String getCorrectAlias(final SecurableCommunicationChannel expectedSecurableComponent, final Properties properties) {
switch (expectedSecurableComponent) {
case ALL:
return properties.getProperty(SSL_DEFAULT_ALIAS);
@@ -190,7 +190,7 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
return getAliasForComponent(properties, SSL_CLUSTER_ALIAS);
case GATEWAY:
return getAliasForComponent(properties, SSL_GATEWAY_ALIAS);
- case HTTP_SERVICE:
+ case WEB:
return getAliasForComponent(properties, SSL_HTTP_SERVICE_ALIAS);
case JMX:
return getAliasForComponent(properties, SSL_JMX_ALIAS);
@@ -208,9 +208,9 @@ public class SSLConfigurationFactoryTest extends JUnit4DistributedTestCase {
return !StringUtils.isEmpty(aliasProperty) ? aliasProperty : properties.getProperty(SSL_DEFAULT_ALIAS);
}
- private boolean isSSLComponentEnabled(final SecurableComponent expectedSecurableComponent, final SecurableComponent[] SecurableComponents) {
- for (SecurableComponent SecurableComponent : SecurableComponents) {
- if (SecurableComponent.ALL.equals(SecurableComponent) || SecurableComponent.equals(expectedSecurableComponent)) {
+ private boolean isSSLComponentEnabled(final SecurableCommunicationChannel expectedSecurableComponent, final SecurableCommunicationChannel[] SecurableComponents) {
+ for (SecurableCommunicationChannel securableCommunicationChannel : SecurableComponents) {
+ if (securableCommunicationChannel.ALL.equals(securableCommunicationChannel) || securableCommunicationChannel.equals(expectedSecurableComponent)) {
return true;
}
}