/** * Caches a keystore location as a system property. No-op if the {@link * #KEYSTORE_LOCATION_SYS_PROP_KEY} system property has a non-<code>null</code> value. Otherwise * caches the keystore location from the currently assigned {@link LdapConnectionManagerConfig}. * * @param config * @throws NullPointerException if a non-null keystore location cannot be resolved */ protected void initKeystoreLocation() { if (M_log.isDebugEnabled()) { M_log.debug("initKeystoreLocation()"); } String sysKeystoreLocation = System.getProperty(KEYSTORE_LOCATION_SYS_PROP_KEY); if (sysKeystoreLocation == null) { String configuredKeystoreLocation = config.getKeystoreLocation(); if (configuredKeystoreLocation != null) { if (M_log.isDebugEnabled()) { M_log.debug( "initKeystoreLocation(): setting system property [location = " + configuredKeystoreLocation + "]"); } System.setProperty(KEYSTORE_LOCATION_SYS_PROP_KEY, configuredKeystoreLocation); } } else { if (M_log.isDebugEnabled()) { M_log.debug( "initKeystoreLocation(): retained existing system property [location = " + sysKeystoreLocation + "]"); } } }
/** * Caches a keystore password as a system property. No-op if the {@link * #KEYSTORE_PASSWORD_SYS_PROP_KEY} system property has a non-<code>null</code> value. Otherwise * caches the keystore password from the currently assigned {@link LdapConnectionManagerConfig}. * * @param config * @throws NullPointerException if a non-null keystore password cannot be resolved */ protected void initKeystorePassword() { if (M_log.isDebugEnabled()) { M_log.debug("initKeystorePassword()"); } String sysKeystorePassword = System.getProperty(KEYSTORE_PASSWORD_SYS_PROP_KEY); if (sysKeystorePassword == null) { String configuredKeystorePassword = config.getKeystorePassword(); if (configuredKeystorePassword != null) { if (M_log.isDebugEnabled()) { M_log.debug("initKeystorePassword(): setting system property"); } System.setProperty(KEYSTORE_PASSWORD_SYS_PROP_KEY, configuredKeystorePassword); } } else { if (M_log.isDebugEnabled()) { M_log.debug("initKeystorePassword(): retained existing system property"); } } }