Package com.yahoo.config.subscription
Class ConfigSourceSet
java.lang.Object
com.yahoo.config.subscription.ConfigSourceSet
- All Implemented Interfaces:
ConfigSource
An immutable set of connection endpoints, where each endpoint points to either a
remote config server or a config proxy.
Two sets are said to be equal if they contain the same sources, independent of order,
upper/lower-casing and whitespaces.
- Author:
- gjoranv
-
Constructor Summary
ConstructorDescriptionCreates an empty ConfigSourceSet, mostly used for unit testing.ConfigSourceSet
(String address) Convenience constructor to create a ConfigSourceSet with only one input address.ConfigSourceSet
(String[] addresses) Creates a ConfigSourceSet containing all the unique given input addresses.ConfigSourceSet
(List<String> addresses) Creates a ConfigSourceSet containing all the unique given input addresses. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigSourceSet
Create a new source set using the environment variables or system propertiesboolean
Returns an unmodifiable set containing all sources in this ConfigSourceSet.int
hashCode()
toString()
-
Constructor Details
-
ConfigSourceSet
public ConfigSourceSet()Creates an empty ConfigSourceSet, mostly used for unit testing. -
ConfigSourceSet
Creates a ConfigSourceSet containing all the unique given input addresses. Each address is trimmed and lower-cased before adding.- Parameters:
addresses
- Connection endpoints on the format "tcp/host:port".
-
ConfigSourceSet
Creates a ConfigSourceSet containing all the unique given input addresses. Each address is trimmed and lower-cased before adding.- Parameters:
addresses
- Connection endpoints on the format "tcp/host:port".
-
ConfigSourceSet
Convenience constructor to create a ConfigSourceSet with only one input address.- Parameters:
address
- Connection endpoint on the format "tcp/host:port".
-
-
Method Details
-
getSources
Returns an unmodifiable set containing all sources in this ConfigSourceSet. Iteration order is guaranteed to be the same as that of the list or array that was given when this set was created.- Returns:
- All sources in this ConfigSourceSet.
-
equals
-
hashCode
public int hashCode() -
toString
-
createDefault
Create a new source set using the environment variables or system properties- Returns:
- a new source set if available, null if not.
-