Checks if a host is part of the cluster as per configuration.
For this the host must be "included" and not "excluded".
An empty includes files means the host is "included".
@param host The host name.
@return A boolean indicating if the host is allowed.
558194
public synchronized boolean isAllowedHost(String host) {
    boolean isIncluded = includes.isEmpty() || includes.contains(host);
    boolean isExcluded = excludes.contains(host);
    return isIncluded && !isExcluded;
  }
1116988
private void determineHostsAsProperty() {
        if (hosts.startsWith("${") && hosts.endsWith("}")) {
            String hostsProperty = hosts.substring(2, hosts.length() - 1);
            hosts = PropertyUtil.getProperty(hostsProperty);
            if (hosts == null) {
                throw new IllegalArgumentException("Could not find property '"
                        + hostsProperty + "'");
            }
        }

    }
185927
function _filterHost($host)
    {
        if (strstr($host, ':') !== false)
            throw new \InvalidArgumentException('Host name can`t contains port number.');

        $host = strtolower($host);
        return $host;
    }
859427
public Proxy setHost( String host )
    {
        if ( this.host.equals( host ) || ( host == null && this.host.length() <= 0 ) )
        {
            return this;
        }
        return new Proxy( type, host, port, auth );
    }
196841
private boolean isDomainExcludedFromProxy(String domainName) {
        if (domainName == null || domainName.isEmpty()) {
            return false;
        }

        for (DomainMatcher excludedDomain : proxyExcludedDomainsEnabled) {
            if (excludedDomain.matches(domainName)) {
                return true;
            }
        }
        return false;
    }
681818
public boolean isExcluded(String endpoint) {
        for (int i = 0; i < exclusions.size(); i++) {
            if (exclusions.get(i).test(endpoint)) {
                return true;
            }
        }
        return false;
    }
906698
private boolean verifyHostname(String hostname, X509Certificate certificate) {
        hostname = hostname.toLowerCase(Locale.US);
        boolean hasDns = false;
        List<String> altNames = getSubjectAltNames(certificate, ALT_DNS_NAME);
        for (int i = 0, size = altNames.size(); i < size; i++) {
            hasDns = true;
            if (verifyHostname(hostname, altNames.get(i))) {
                return true;
            }
        }

        if (!hasDns) {
            X500Principal principal = certificate.getSubjectX500Principal();
            // RFC 2818 advises using the most specific name for matching.
            String cn = new DistinguishedNameParser(principal).findMostSpecific("cn");
            if (cn != null) {
                return verifyHostname(hostname, cn);
            }
            else {
                // NOTE: In case of empty Common Name (CN), not checking
                return true;
            }
        }

        return false;
    }
114841
public static int count(final String host, final String searchStr) {
    int count = 0;
    for (int startIndex = 0; startIndex < host.length(); startIndex++) {
      int findLoc = host.indexOf(searchStr, startIndex);
      if (findLoc == -1) {
        break;
      } else {
        count++;
        startIndex = findLoc + searchStr.length() - 1;
      }
    }
    return count;
  }
1008036
private synchronized boolean isIncluded(String _clazzName) {
        if (includes.size() > 0) {
            for (String include : includes) {
                if (_clazzName.startsWith(include)) {
                    return true;

                }
            }
        } // if we dont have a list, we include nothing (to prevent circular classloader dependencies)
        return false;
    }
176289
@Override
    public boolean check(String[] pHostOrAddresses) {
        if (allowedHostsSet == null) {
            return true;
        }
        for (String addr : pHostOrAddresses) {
            if (allowedHostsSet.contains(addr)) {
                return true;
            }
            if (allowedSubnetsSet != null && IP_PATTERN.matcher(addr).matches()) {
                for (String subnet : allowedSubnetsSet) {
                    if (IpChecker.matches(subnet, addr)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
180044
public function isAvailable($host)
    {
        $hostcdNode = $this->getHostcd($host);
        $node = $this->getFirst('host:name', $hostcdNode);

        return in_array($node->getAttribute('avail'), ['1', 'true']);
    }
230544
def enable_host_check(self, host):
        
        if not host.active_checks_enabled:
            host.active_checks_enabled = True
            host.modified_attributes |= \
                DICT_MODATTR["MODATTR_ACTIVE_CHECKS_ENABLED"].value
            self.send_an_element(host.get_update_status_brok())
1322553
public final UdpClient host(String host) {
		Objects.requireNonNull(host, "host");
		return bootstrap(b -> b.remoteAddress(host, getPort(b)));
	}
273830
@Nonnull
  public CSP2SourceList addHost (@Nonnull @Nonempty final String sHost)
  {
    ValueEnforcer.notEmpty (sHost, "Host");
    m_aList.add (sHost);
    return this;
  }
257750
@Override
    @Synchronized
    public void deregisterHost(Host host) {
        Preconditions.checkNotNull(host, "host");
        PersistentNode node = entryMap.get(host);
        Preconditions.checkNotNull(node, "Host is not present in cluster.");
        entryMap.remove(host);
        close(node);
    }
141720
public function isBlocked($host)
    {
        $host = parse_url($host, PHP_URL_HOST);
        $host = utf8_encode(trim($host));

        if (empty($host)) return false;

        $fullDomain = $this->getFullDomain($host);
        $rootDomain = $this->getRootDomain($fullDomain);

        return $this->spammers()
            ->whereHostIn([$fullDomain, $rootDomain])
            ->whereBlocked()
            ->count() > 0;
    }
1200407
private static boolean include(String host, java.nio.file.Path path) throws ServiceException {
        List<java.nio.file.Path> roots = getRootPaths(host);
        if (roots != null) {
            for (java.nio.file.Path rootPath : roots) {
                if (path.startsWith(rootPath))
                    return true;
            }
        }
        return false;
    }