@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); ApacheSsl apacheSsl = new OperationHandler<ApacheSsl>() .setOperation(Daemon.getApacheSsl(currentDeployment, false)) .setFailureMesssage("Failed to load SSL settings.") .get(); int originalHash = apacheSsl.hashCode(); apacheSsl.setSslCertificateFile(isSet(sslCertificateFile) ? sslCertificateFile : apacheSsl.getSslCertificateFile()); apacheSsl.setSslCertificateKeyFile(isSet(sslCertificateKeyFile) ? sslCertificateKeyFile : apacheSsl.getSslCertificateKeyFile()); apacheSsl.setSslCertificatePassphrase(isSet(sslCertificatePassphrase) ? sslCertificatePassphrase : apacheSsl.getSslCertificatePassphrase()); apacheSsl.setSslCACertificateFile(isSet(sslCACertificateFile) ? sslCACertificateFile : apacheSsl.getSslCACertificateFile()); if (originalHash == apacheSsl.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setApacheSsl(currentDeployment, !noValidate, apacheSsl)) .setFailureMesssage("Failed to edit SSL settings.") .setSuccessMessage("Successfully updated SSL settings.") .get(); } }
@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); ApacheSsl apacheSsl = new OperationHandler<ApacheSsl>() .setOperation(Daemon.getApacheSsl(currentDeployment, false)) .setFailureMesssage("Failed to load SSL settings.") .get(); int originalHash = apacheSsl.hashCode(); apacheSsl.setSslCertificateFile(isSet(sslCertificateFile) ? sslCertificateFile : apacheSsl.getSslCertificateFile()); apacheSsl.setSslCertificateKeyFile(isSet(sslCertificateKeyFile) ? sslCertificateKeyFile : apacheSsl.getSslCertificateKeyFile()); apacheSsl.setSslCertificatePassphrase(isSet(sslCertificatePassphrase) ? sslCertificatePassphrase : apacheSsl.getSslCertificatePassphrase()); apacheSsl.setSslCACertificateFile(isSet(sslCACertificateFile) ? sslCACertificateFile : apacheSsl.getSslCACertificateFile()); if (originalHash == apacheSsl.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setApacheSsl(currentDeployment, !noValidate, apacheSsl)) .setFailureMesssage("Failed to edit SSL settings.") .setSuccessMessage("Successfully updated SSL settings.") .get(); } }