public static void checkUpdateConfiguration(
      ServiceComponentHost serviceComponentHost,
      State currentState, State desiredState)
      throws AmbariException {

    if (desiredState != null) {
      if (!(desiredState == State.INIT
          || desiredState == State.INSTALLED
          || desiredState == State.STARTED)) {
        throw new AmbariException("Changing of configs not supported"
            + " for this transition"
            + ", clusterName=" + serviceComponentHost.getClusterName()
            + ", serviceName=" + serviceComponentHost.getServiceName()
            + ", componentName=" + serviceComponentHost.getServiceComponentName()
            + ", hostname=" + serviceComponentHost.getHostName()
            + ", currentState=" + currentState
            + ", newDesiredState=" + desiredState);
      }
    }
  }
Determine whether or not it is safe to update the configuration of the given service
component host for the given states.

@param serviceComponentHost  the service component host
@param currentState          the current state
@param desiredState          the desired state

@throws AmbariException if the changing of configuration is not supported
ambari-server/src/main/java/org/apache/ambari/server/state/State.java