maulin-vasavada commented on code in PR #3638:
URL: https://github.com/apache/cassandra/pull/3638#discussion_r1821662198


##########
src/java/org/apache/cassandra/utils/jmx/DefaultJmxSocketFactory.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.cassandra.utils.jmx;
+
+import java.net.InetAddress;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.stream.Collectors;
+import javax.management.remote.rmi.RMIConnectorServer;
+import javax.net.ssl.SSLException;
+import javax.rmi.ssl.SslRMIClientSocketFactory;
+import javax.rmi.ssl.SslRMIServerSocketFactory;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.cassandra.config.EncryptionOptions;
+import org.apache.cassandra.utils.JmxSslRMIServerSocketFactory;
+import org.apache.cassandra.utils.RMIServerSocketFactoryImpl;
+
+/**
+ * Default implementation of the {@link IJmxSocketFactory}.
+ */
+public final class DefaultJmxSocketFactory extends AbstractJmxSocketFactory
+{
+    private static final Logger logger = 
LoggerFactory.getLogger(DefaultJmxSocketFactory.class);
+
+    @Override
+    public void configureLocalSocketFactory(Map<String, Object> env, 
InetAddress serverAddress)
+    {
+        env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, new 
RMIServerSocketFactoryImpl(serverAddress));
+    }
+
+    @Override

Review Comment:
   Currently its method overloading with different input params to effectively 
do the same thing - `configure the relevant ssl server socket factory`. We have 
two use-cases primarily-
   
   1. setting the socket factory based on system configure key/trust store
   2. setting the socket factory based on JMX `encryption_options`. 
   
   The third `configure` method is for Client socket factory.
   
   We have JavaDocs about those in [the parent abstract 
class](https://github.com/apache/cassandra/pull/3638/files#diff-039489ddb488470626dad5fac18d1541da0bd23f3137178cf3f63b29e020d5da).
 
   
   Let me know if it still makes more sense to rename methods to reflect what 
it does. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to