public boolean isOperationAllowed(Cluster cluster,
      RequestOperationLevel levelObj, RequestResourceFilter reqFilter,
      String serviceName, String componentName, String hostname)
      throws AmbariException {
    Resource.Type level;
    if (levelObj == null) {
      level = guessOperationLevel(reqFilter);
    } else {
      level = levelObj.getLevel();
    }
    return isOperationAllowed(cluster, level, serviceName, componentName,
        hostname);
  }
@param cluster
         cluster for request
@param levelObj
         operation level (can be null)
@param reqFilter
         request resource filter for operation (can't be null)
@param serviceName
         service name (can be null)
@param componentName
         component name (can be null)
@param hostname
         host name (can't be null)
@return true if operation may be performed on a given target (based on
        target's maintenance status).
ambari-server/src/main/java/org/apache/ambari/server/controller/MaintenanceStateHelper.java