Class HttpLoader
- java.lang.Object
-
- com.couchbase.client.core.config.loader.AbstractLoader
-
- com.couchbase.client.core.config.loader.HttpLoader
-
- All Implemented Interfaces:
Loader
public class HttpLoader extends AbstractLoader
Loads a raw bucket configuration through the Couchbase Server HTTP config interface.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
-
Field Summary
Fields Modifier and Type Field Description static String
TERSE_PATH
static String
VERBOSE_PATH
-
Constructor Summary
Constructors Constructor Description HttpLoader(ClusterFacade cluster, CoreEnvironment environment)
Creates a newHttpLoader
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected rx.Observable<String>
discoverConfig(String bucket, String username, String password, String hostname)
Run theBucketConfig
discovery process.protected int
port(String hostname)
Port to use for theServiceType
.-
Methods inherited from class com.couchbase.client.core.config.loader.AbstractLoader
cluster, env, loadConfig, loadConfig, replaceHostWildcard, tryLoadingPortFromConfig
-
-
-
-
Field Detail
-
TERSE_PATH
public static final String TERSE_PATH
- See Also:
- Constant Field Values
-
VERBOSE_PATH
public static final String VERBOSE_PATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpLoader
public HttpLoader(ClusterFacade cluster, CoreEnvironment environment)
Creates a newHttpLoader
.- Parameters:
cluster
- the cluster reference.environment
- the environment to use.
-
-
Method Detail
-
port
protected int port(String hostname)
Description copied from class:AbstractLoader
Port to use for theServiceType
. This method needs to be implemented by the actual loader and defines the port which should be used to connect the service to. In practice, the actual port may depend on the environment (i.e. if SSL is used or not).- Specified by:
port
in classAbstractLoader
- Returns:
- the port for the service to enable.
-
discoverConfig
protected rx.Observable<String> discoverConfig(String bucket, String username, String password, String hostname)
Description copied from class:AbstractLoader
Run theBucketConfig
discovery process.- Specified by:
discoverConfig
in classAbstractLoader
- Parameters:
bucket
- the name of the bucket.username
- user authorized for bucket access.password
- the password of the user.hostname
- the hostname of the seed node list.- Returns:
- a raw config if discovered.
-
-