Runs the health check with the given name.

@param name the health check's name
@return the result of the health check
@throws NoSuchElementException if there is no health check with the given name
5617
public HealthCheck.Result runHealthCheck(String name) throws NoSuchElementException {
        final HealthCheck healthCheck = healthChecks.get(name);
        if (healthCheck == null) {
            throw new NoSuchElementException("No health check named " + name + " exists");
        }
        return healthCheck.execute();
    }
672714
public Service getService(String name) {
        Service service = store.get(name);
        if (service == null) {
            throw HttpException.notFound("Service not found for name '" + name + "'");
        }
        return service;
    }
416847
@Override
    public Query createNamedQuery(String name)
    {
        try
        {
            return ivEm.createNamedQuery(name);
        } finally
        {
            if (!inJTATransaction())
            {
                ivEm.clear();
            }
        }
    }
58859
public boolean containsName(final String name) {
        for (final T i : this) {
            if (i.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }
458893
public static void checkGoodName(String name) throws Failure {
        if(name==null || name.length()==0)
            throw new Failure(Messages.Hudson_NoName());

        if(".".equals(name.trim()))
            throw new Failure(Messages.Jenkins_NotAllowedName("."));
        if("..".equals(name.trim()))
            throw new Failure(Messages.Jenkins_NotAllowedName(".."));
        for( int i=0; i<name.length(); i++ ) {
            char ch = name.charAt(i);
            if(Character.isISOControl(ch)) {
                throw new Failure(Messages.Hudson_ControlCodeNotAllowed(toPrintableName(name)));
            }
            if("?*/\\%!@#$^&|<>[]:;".indexOf(ch)!=-1)
                throw new Failure(Messages.Hudson_UnsafeChar(ch));
        }

        // looks good
    }
407047
public Observable<CheckNameAvailabilityResultInner> checkNameAvailabilityAsync(String name) {
        return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1<ServiceResponse<CheckNameAvailabilityResultInner>, CheckNameAvailabilityResultInner>() {
            @Override
            public CheckNameAvailabilityResultInner call(ServiceResponse<CheckNameAvailabilityResultInner> response) {
                return response.body();
            }
        });
    }
1177551
public static <T extends Collection<?>> T checkNotEmpty(final String name,
                                                            final T parameter) {
        if (parameter == null || parameter.size() == 0) {
            throw new IllegalArgumentException("Parameter named '" + name + "' should be filled!");
        }
        return parameter;
    }
291035
public static void validateSimonName(String name) {
		if (!checkName(name)) {
			throw new SimonException("Simon name must match following pattern: '" + SimonUtils.NAME_PATTERN.pattern() + "', used name: " + name);
		}
	}
318929
public void addName(String name)
   {
      if (names.contains(name))
      {
         throw new IllegalArgumentException("already contains: " + name);
      }
      indexes.add(name);
      names.add(name);
      dirty = true;
   }
889305
@Override
    protected void doHealthCheck(final Health.Builder builder) {
        val samlServices = servicesManager.findServiceBy(registeredService -> registeredService instanceof SamlRegisteredService);
        val availableResolvers = this.metadataResolutionPlan.getRegisteredMetadataResolvers();
        LOGGER.debug("There are [{}] metadata resolver(s) available in the chain", availableResolvers.size());

        builder.up();

        samlServices
            .stream()
            .map(SamlRegisteredService.class::cast)
            .forEach(service -> {
                val map = new LinkedHashMap<String, Object>();
                map.put("name", service.getName());
                map.put("id", service.getId());
                map.put("metadataLocation", service.getMetadataLocation());
                map.put("serviceId", service.getServiceId());
                val available = availableResolvers
                    .stream()
                    .filter(Objects::nonNull)
                    .peek(r -> LOGGER.debug("Checking if metadata resolver [{}] is available for service [{}]", r.getName(), service.getName()))
                    .anyMatch(r -> r.isAvailable(service));
                map.put("availability", BooleanUtils.toStringYesNo(available));
                builder.withDetail(service.getName(), map);
                if (!available) {
                    LOGGER.debug("No metadata resolver is available for service [{}]", service.getName());
                    builder.down();
                }
            });
    }
1349636
public SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor, HealthCheckFilter filter) {
        final Map<String, Future<HealthCheck.Result>> futures = new HashMap<>();
        for (final Map.Entry<String, HealthCheck> entry : healthChecks.entrySet()) {
            final String name = entry.getKey();
            final HealthCheck healthCheck = entry.getValue();
            if (filter.matches(name, healthCheck)) {
                futures.put(name, executor.submit(() -> healthCheck.execute()));
            }
        }

        final SortedMap<String, HealthCheck.Result> results = new TreeMap<>();
        for (Map.Entry<String, Future<Result>> entry : futures.entrySet()) {
            try {
                results.put(entry.getKey(), entry.getValue().get());
            } catch (Exception e) {
                LOGGER.warn("Error executing health check {}", entry.getKey(), e);
                results.put(entry.getKey(), HealthCheck.Result.unhealthy(e));
            }
        }

        return Collections.unmodifiableSortedMap(results);
    }
221581
public void reserve(String name) {
    checkName(name);
    // if this is new
    if (reserved.add(name)) {
      // add it to names, so that generateName will still work for reserved names (they will just
      // get suffixes).
      if (!names.add(name)) {
        names.remove(name);
        throw new IllegalArgumentException("newly reserved name: " + name + " was already used!");
      }
    }
  }
1159972
@RequestMapping(value = "/{name}", method = RequestMethod.DELETE)
	@ResponseStatus(HttpStatus.OK)
	protected void delete(@PathVariable("name") String name) {
		FieldValueCounter counter = repository.findOne(name);
		if (counter == null) {
			throw new NoSuchMetricException(name);
		}
		repository.reset(name);
	}
389355
public Value check(ILexNameToken name)
	{
		Value v = get(name);

		if (v == null)
		{
			if (outer != null)
			{
				return outer.check(name);
			}
		}

		return v;
	}
600463
public static <T> T[] checkNotEmpty(final String name,
                                        final T[] parameter) {
        if (parameter == null || parameter.length == 0) {
            throw new IllegalArgumentException("Parameter named '" + name + "' should be filled!");
        }
        return parameter;
    }
1283651
public void claimName(String name) {
    checkName(name);
    if (names.add(name, 1) != 0) {
      names.remove(name);
      // give a slightly better error message in this case
      if (reserved.contains(name)) {
        throw new IllegalArgumentException("Tried to claim a reserved name: " + name);
      }
      throw new IllegalArgumentException("Name: " + name + " was already claimed!");
    }
  }
621423
@Bean
    public HealthChecker tomcatConnectorHealthChecker(ServletWebServerApplicationContext applicationContext) {
        final Connector connector = getConnector(applicationContext);
        return () -> connector.getState().isAvailable();
    }