smiklosovic commented on code in PR #3708: URL: https://github.com/apache/cassandra/pull/3708#discussion_r1857835491
########## src/java/org/apache/cassandra/config/JMXServerOptions.java: ########## @@ -0,0 +1,196 @@ +/* + * 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.config; + +import java.util.HashMap; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; + +import static org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_JMX_AUTHORIZER; +import static org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_JMX_LOCAL_PORT; +import static org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_JMX_REMOTE_LOGIN_CONFIG; +import static org.apache.cassandra.config.CassandraRelevantProperties.CASSANDRA_JMX_REMOTE_PORT; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_ACCESS_FILE; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_AUTHENTICATE; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_PASSWORD_FILE; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_RMI_PORT; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_SSL; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_SSL_ENABLED_CIPHER_SUITES; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_SSL_ENABLED_PROTOCOLS; +import static org.apache.cassandra.config.CassandraRelevantProperties.COM_SUN_MANAGEMENT_JMXREMOTE_SSL_NEED_CLIENT_AUTH; +import static org.apache.cassandra.config.CassandraRelevantProperties.JAVAX_NET_SSL_KEYSTORE; +import static org.apache.cassandra.config.CassandraRelevantProperties.JAVAX_NET_SSL_KEYSTOREPASSWORD; +import static org.apache.cassandra.config.CassandraRelevantProperties.JAVAX_NET_SSL_TRUSTSTORE; +import static org.apache.cassandra.config.CassandraRelevantProperties.JAVAX_NET_SSL_TRUSTSTOREPASSWORD; +import static org.apache.cassandra.config.CassandraRelevantProperties.JAVA_SECURITY_AUTH_LOGIN_CONFIG; + +public class JMXServerOptions +{ + //jmx server settings + public final Boolean enabled; + public final Boolean remote; + public final int jmx_port; + public final int rmi_port; + public final Boolean authenticate; + + // ssl options + public final EncryptionOptions jmx_encryption_options; + + // options for using Cassandra's own authentication mechanisms + public final String login_config_name; + public final String login_config_file; + + // location for credentials file if using JVM's file-based authentication + public final String password_file; + // location of standard access file, if using JVM's file-based access control + public final String access_file; + + // classname of authorizer if using a custom authz mechanism. Usually, this will + // refer to o.a.c.auth.jmx.AuthorizationProxy which delegates to the IAuthorizer + // configured in cassandra.yaml + public final String authorizer; + + public JMXServerOptions() + { + this(null, false, 7199, 0, false, + new EncryptionOptions(), null, null, null, + null, null); + } + + public JMXServerOptions(int jmxPort, boolean local) + { + this(null, !local, jmxPort, 0, false, + new EncryptionOptions(), null, null, null, + null, null); + } + + public JMXServerOptions(Boolean enabled, + Boolean remote, + int jmxPort, + int rmiPort, + Boolean authenticate, + EncryptionOptions jmx_encryption_options, + String loginConfigName, + String loginConfigFile, + String passwordFile, + String accessFile, + String authorizer) + { + this.enabled = enabled; + this.remote = remote; + this.jmx_port = jmxPort; + this.rmi_port = rmiPort; + this.authenticate = authenticate; + this.jmx_encryption_options = jmx_encryption_options; + this.login_config_name = loginConfigName; + this.login_config_file = loginConfigFile; + this.password_file = passwordFile; + this.access_file = accessFile; + this.authorizer = authorizer; + } + + @Override + public String toString() + { + // we are not including encryption options on purpose Review Comment: sure -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

