diff options
Diffstat (limited to 'config-provisioning/src/main/java/com/yahoo/config/provision/SharedHosts.java')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/SharedHosts.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/SharedHosts.java b/config-provisioning/src/main/java/com/yahoo/config/provision/SharedHosts.java new file mode 100644 index 00000000000..44a91d2861d --- /dev/null +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/SharedHosts.java @@ -0,0 +1,30 @@ +package com.yahoo.config.provision; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** + * @author hakonhall + */ +public interface SharedHosts { + static SharedHosts empty() { + return new SharedHosts() { + @Override public boolean supportsClusterType(ClusterSpec.Type clusterType) { return false; } + @Override public boolean hasClusterType(ClusterSpec.Type clusterType) { return false; } + }; + } + + static SharedHosts ofConstant(boolean supportsClusterType, boolean hasClusterType) { + return new SharedHosts() { + @Override public boolean supportsClusterType(ClusterSpec.Type clusterType) { return supportsClusterType; } + @Override public boolean hasClusterType(ClusterSpec.Type clusterType) { return hasClusterType; } + }; + } + + /** Whether there are any shared hosts specifically for the given cluster type, or without a cluster type restriction. */ + @JsonIgnore + boolean supportsClusterType(ClusterSpec.Type clusterType); + + /** Whether there are any shared hosts specifically for the given cluster type. */ + @JsonIgnore + boolean hasClusterType(ClusterSpec.Type clusterType); +} |