private RegisteredService update(final RegisteredService rs) {
        val currentDn = getCurrentDnForRegisteredService(rs);

        if (StringUtils.isNotBlank(currentDn)) {
            LOGGER.debug("Updating registered service at [{}]", currentDn);
            val entry = this.ldapServiceMapper.mapFromRegisteredService(ldapProperties.getBaseDn(), rs);
            connectionFactory.executeModifyOperation(currentDn, entry);
        } else {
            LOGGER.debug("Cannot locate DN for registered service with id [{}]. Attempting to save the service", rs.getId());
            insert(rs);
        }
        return rs;
    }
Update the ldap entry with the given registered service.

@param rs the rs
@return the registered service
support/cas-server-support-ldap-service-registry/src/main/java/org/apereo/cas/adaptors/ldap/services/LdapServiceRegistry.java