@Override
  public void setCredentialStoreEnabled(boolean credentialStoreEnabled) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Setting CredentialStoreEnabled of Service, clusterName={}, clusterId={}, serviceName={}, oldCredentialStoreEnabled={}, newCredentialStoreEnabled={}",
          cluster.getClusterName(), cluster.getClusterId(), getName(), isCredentialStoreEnabled(), credentialStoreEnabled);
    }

    ServiceDesiredStateEntity desiredStateEntity = getServiceDesiredStateEntity();

    if (desiredStateEntity != null) {
      ServiceCredentialStoreUpdateEvent serviceCredentialStoreUpdateEvent = null;
      //create event only if the value changed
      if (desiredStateEntity.isCredentialStoreEnabled() != credentialStoreEnabled) {
        StackId stackId = getDesiredStackId();
        serviceCredentialStoreUpdateEvent =
            new ServiceCredentialStoreUpdateEvent(getClusterId(), stackId.getStackName(),
                stackId.getStackVersion(), getName());
      }
      desiredStateEntity.setCredentialStoreEnabled(credentialStoreEnabled);
      desiredStateEntity = serviceDesiredStateDAO.merge(desiredStateEntity);

      //publish event after the value has changed
      if (serviceCredentialStoreUpdateEvent != null) {
        eventPublisher.publish(serviceCredentialStoreUpdateEvent);
      }
    } else {
      LOG.warn("Setting a member on an entity object that may have been "
          + "previously deleted, serviceName = " + getName());
    }
  }
Set a true or false value specifying whether this
service is to be enabled for credential store use.

@param credentialStoreEnabled - true or false
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java