Package com.couchbase.client.core.util
Class ConnectionString
- java.lang.Object
-
- com.couchbase.client.core.util.ConnectionString
-
public class ConnectionString extends Object
Implements aConnectionString
.- Since:
- 2.4.0
- Author:
- Michael Nitschinger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConnectionString.PortType
static class
ConnectionString.Scheme
static class
ConnectionString.UnresolvedSocket
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_SCHEME
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectionString(String input)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConnectionString
create(String input)
static ConnectionString
fromHostnames(List<String> hostnames)
List<ConnectionString.UnresolvedSocket>
hosts()
Get the list of all hosts from the connection string.boolean
isValidDnsSrv()
Returns true if this connection string qualifies for DNS SRV resolving per spec.String
original()
Returns the unmodified, original connection string.Map<String,String>
params()
ConnectionString.Scheme
scheme()
String
toString()
String
username()
-
-
-
Field Detail
-
DEFAULT_SCHEME
public static final String DEFAULT_SCHEME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConnectionString
protected ConnectionString(String input)
-
-
Method Detail
-
create
public static ConnectionString create(String input)
-
fromHostnames
public static ConnectionString fromHostnames(List<String> hostnames)
-
scheme
public ConnectionString.Scheme scheme()
-
username
public String username()
-
hosts
public List<ConnectionString.UnresolvedSocket> hosts()
Get the list of all hosts from the connection string.- Returns:
- hosts
-
isValidDnsSrv
public boolean isValidDnsSrv()
Returns true if this connection string qualifies for DNS SRV resolving per spec.To be valid, the following criteria have to be met: only couchbase(s) schema, single host with no port specified and no IP address.
-
original
public String original()
Returns the unmodified, original connection string.
-
-