public boolean isOperationAllowed(Resource.Type level, Service service)
      throws AmbariException {
    if (level == Resource.Type.Cluster) {
      return service.getMaintenanceState() == MaintenanceState.OFF;
    } else {
      return true;
    }
  }
@param level
         operation level
@param service
         the service
@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