public void putService(KerberosServiceDescriptor service) {
    if (service != null) {
      String name = service.getName();

      if (name == null) {
        throw new IllegalArgumentException("The service name must not be null");
      }

      if (services == null) {
        services = new TreeMap<String, KerberosServiceDescriptor>();
      }

      KerberosServiceDescriptor existing = services.get(name);
      if (existing == null) {
        services.put(name, service);
        // Set the service's parent to this KerberosDescriptor
        service.setParent(this);
      } else {
        existing.update(service);
      }
    }
  }
Adds, replaces, or updates a KerberosServiceDescriptor
<p/>
If a KerberosServiceDescriptor with the same name does not exist in the services Map, a new
entry will be added; else if it one already exists and <code>overwrite</code> is
<code>true</code>, it will be replaced; else the exsting entry will be updated.

@param service the KerberosServiceDescriptor to put
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java