Package com.yahoo.config.provision
Class HostFilter
- java.lang.Object
-
- com.yahoo.config.provision.HostFilter
-
public class HostFilter extends Object
A filter which matches a host depending on its properties.- Author:
- bratseth
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HostFilter
all()
Returns a filter which matches all hostsstatic HostFilter
clusterId(ClusterSpec.Id clusterId)
Returns a filter which matches a given cluster id onlystatic HostFilter
clusterType(ClusterSpec.Type clusterType)
Returns a filter which matches a given cluster type onlyboolean
equals(Object o)
static HostFilter
flavor(String flavor)
Returns a filter which matches a given flavor onlystatic HostFilter
from(String hostNames, String flavors, String clusterTypes, String clusterIds)
Returns a host filter from three comma and-or space separated string lists.static HostFilter
from(Collection<String> hostNames, Collection<String> flavors, Collection<ClusterSpec.Type> clusterTypes, Collection<ClusterSpec.Id> clusterIds)
Returns a host filter from three optional conditionsint
hashCode()
static HostFilter
hostname(String hostname)
Returns a filter which matches a given host onlyboolean
matches(String hostname, String flavor, Optional<ClusterMembership> membership)
Returns true if this filter matches the given host properties
-
-
-
Method Detail
-
matches
public boolean matches(String hostname, String flavor, Optional<ClusterMembership> membership)
Returns true if this filter matches the given host properties
-
all
public static HostFilter all()
Returns a filter which matches all hosts
-
hostname
public static HostFilter hostname(String hostname)
Returns a filter which matches a given host only
-
flavor
public static HostFilter flavor(String flavor)
Returns a filter which matches a given flavor only
-
clusterType
public static HostFilter clusterType(ClusterSpec.Type clusterType)
Returns a filter which matches a given cluster type only
-
clusterId
public static HostFilter clusterId(ClusterSpec.Id clusterId)
Returns a filter which matches a given cluster id only
-
from
public static HostFilter from(Collection<String> hostNames, Collection<String> flavors, Collection<ClusterSpec.Type> clusterTypes, Collection<ClusterSpec.Id> clusterIds)
Returns a host filter from three optional conditions
-
from
public static HostFilter from(String hostNames, String flavors, String clusterTypes, String clusterIds)
Returns a host filter from three comma and-or space separated string lists. The strings may be null or empty.
-
-