Package com.couchbase.client.core.util
Class ConnectionStringUtil
- java.lang.Object
-
- com.couchbase.client.core.util.ConnectionStringUtil
-
-
Field Summary
Fields Modifier and Type Field Description static String
INCOMPATIBLE_CONNECTION_STRING_PARAMS
static String
INCOMPATIBLE_CONNECTION_STRING_SCHEME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConnectionString
asConnectionString(Collection<SeedNode> nodes)
Returns a synthetic connection string corresponding to the seed nodes.static void
checkConnectionString(CoreEnvironment env, boolean ownsEnvironment, ConnectionString connStr)
static List<String>
fromDnsSrvOrThrowIfTlsRequired(String serviceName, boolean secure)
static boolean
isCapella(ConnectionString connectionString)
Returns true if the addresses indicate this is a Couchbase Capella cluster.static Set<SeedNode>
seedNodesFromConnectionString(ConnectionString connectionString, boolean dnsSrvEnabled, boolean tlsEnabled, EventBus eventBus)
Populates a list of seed nodes from the connection string.
-
-
-
Field Detail
-
INCOMPATIBLE_CONNECTION_STRING_SCHEME
public static final String INCOMPATIBLE_CONNECTION_STRING_SCHEME
- See Also:
- Constant Field Values
-
INCOMPATIBLE_CONNECTION_STRING_PARAMS
public static final String INCOMPATIBLE_CONNECTION_STRING_PARAMS
- See Also:
- Constant Field Values
-
-
Method Detail
-
seedNodesFromConnectionString
public static Set<SeedNode> seedNodesFromConnectionString(ConnectionString connectionString, boolean dnsSrvEnabled, boolean tlsEnabled, EventBus eventBus)
Populates a list of seed nodes from the connection string.Note that this method also performs DNS SRV lookups if the connection string qualifies!
- Parameters:
connectionString
- the connection string in its encoded form.dnsSrvEnabled
- true if dns srv is enabled.tlsEnabled
- true if tls is enabled.- Returns:
- a set of seed nodes populated.
-
isCapella
public static boolean isCapella(ConnectionString connectionString)
Returns true if the addresses indicate this is a Couchbase Capella cluster.
-
asConnectionString
public static ConnectionString asConnectionString(Collection<SeedNode> nodes)
Returns a synthetic connection string corresponding to the seed nodes.
-
checkConnectionString
public static void checkConnectionString(CoreEnvironment env, boolean ownsEnvironment, ConnectionString connStr)
-
fromDnsSrvOrThrowIfTlsRequired
@Internal public static List<String> fromDnsSrvOrThrowIfTlsRequired(String serviceName, boolean secure) throws NamingException
- Throws:
NamingException
-
-