class ServicesMaintenanceModeCheck extends AbstractCheckDescriptor {

  @Override
  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException {
    final Cluster cluster = clustersProvider.get().getCluster(request.getClusterName());
    Set<String> servicesInUpgrade = getServicesInUpgrade(request);

    for (String serviceName : servicesInUpgrade) {
      final Service service = cluster.getService(serviceName);
      if (!service.isClientOnlyService() && service.getMaintenanceState() == MaintenanceState.ON) {
        prerequisiteCheck.getFailedOn().add(service.getName());
      }
    }
    if (!prerequisiteCheck.getFailedOn().isEmpty()) {
      prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
      prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request));
    }
  }

  public  ServicesMaintenanceModeCheck();

}