private boolean checkUserHookPrerequisites() {

    if (!configuration.isUserHookEnabled()) {
      LOGGER.warn("Post user creation hook disabled.");
      return false;
    }

    if (clusters.getClusters().isEmpty()) {
      LOGGER.warn("There's no cluster found. Post user creation hook won't be executed.");
      return false;
    }

    return true;
  }
Service in charge for handling user initialization related logic.
It's expected that this implementation encapsulates all the logic around the user initialization hook:
1. validates the context  (all the input is available)
2. checks if prerequisites are satisfied for the hook execution
3. triggers the hook execution flow
4. executes the flow (on a separate thread)
ambari-server/src/main/java/org/apache/ambari/server/hooks/users/UserHookService.java