code: 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(this.baseDn, rs);
              LdapUtils.executeModifyOperation(currentDn, this.connectionFactory, entry);
          } else {
              LOGGER.debug("Failed to locate DN for registered service by id [{}]. Attempting to save the service anew", rs.getId());
              insert(rs);
          }
          return rs;
      }
docs: Update the ldap entry with the given registered service.
  
  @param rs the rs
  @return the registered service