docs: public static ErrorCode validateProvidedServiceInstance(ProvidedServiceInstance serviceInstance) {
  
          ErrorCode retstr = isIdValid(serviceInstance.getProviderId());
          if (retstr != ErrorCode.OK) {
              return retstr;
          }
  
          retstr = isNameValid(serviceInstance.getServiceName());
          if (retstr != ErrorCode.OK) {
              return retstr;
          }
  
          retstr = isUriValid(serviceInstance.getUri());
          if (retstr != ErrorCode.OK) {
              return retstr;
          }
  
          retstr = isPortValid(serviceInstance.getPort());
          if (retstr != ErrorCode.OK) {
              return retstr;
          }
  
          /**
          * Skip the ip validation.
          retstr = isAddressValid(serviceInstance.getAddress());
          if (retstr != ErrorCode.OK) {
              return retstr;
          }
          **/
  
          Map<String, String> metadata = serviceInstance.getMetadata();
          if (metadata != null && metadata.size() > 0) {
              Iterator<Entry<String, String>> itor = metadata.entrySet().iterator();
              while (itor.hasNext()) {
                  Map.Entry<String, String> entry = (Map.Entry<String, String>) itor
                          .next();
                  if (!isOptionalFieldValid(entry.getKey(), metaKeyRegEx)) {
                      return ErrorCode.SERVICE_INSTANCE_METAKEY_FORMAT_ERROR;
                  }
              }
          }
          return ErrorCode.OK;
      }