Package com.couchbase.client.core
Class Core
- java.lang.Object
-
- com.couchbase.client.core.Core
-
public class Core extends Object
The main entry point into the core layer.This class has been around behind a facade in the 1.x days, but here it is just a plain simple class that can be instantiated and is used across the upper language bindings.
- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Core(CoreEnvironment environment)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Void>
closeBucket(String name)
Attempts to close a bucket and fails theMono
if there is a persistent error as the reason.ClusterConfig
clusterConfig()
This API provides access to the current config that is published throughout the core.ConfigurationProvider
configurationProvider()
CoreContext
context()
Returns theCoreContext
of this core instance.static Core
create(CoreEnvironment environment)
protected Node
createNode(NodeIdentifier identifier)
Mono<Void>
ensureServiceAt(NodeIdentifier identifier, ServiceType serviceType, int port, Optional<String> bucket)
This method can be used by a caller to make sure a certain service is enabled at the given target node.Mono<Void>
openBucket(String name)
Attempts to open a bucket and fails theMono
if there is a persistent error as the reason.<R extends Response>
voidsend(Request<R> request)
<R extends Response>
voidsend(Request<R> request, boolean registerForTimeout)
Mono<Void>
shutdown()
Shuts down this core and all associated, owned resources.
-
-
-
Constructor Detail
-
Core
protected Core(CoreEnvironment environment)
-
-
Method Detail
-
create
public static Core create(CoreEnvironment environment)
-
configurationProvider
@Internal public ConfigurationProvider configurationProvider()
-
send
@Internal public <R extends Response> void send(Request<R> request, boolean registerForTimeout)
-
context
public CoreContext context()
Returns theCoreContext
of this core instance.- Returns:
- the core context.
-
openBucket
@Internal public Mono<Void> openBucket(String name)
Attempts to open a bucket and fails theMono
if there is a persistent error as the reason.
-
clusterConfig
@Internal public ClusterConfig clusterConfig()
This API provides access to the current config that is published throughout the core.Note that this is internal API and might change at any time.
-
closeBucket
@Internal public Mono<Void> closeBucket(String name)
Attempts to close a bucket and fails theMono
if there is a persistent error as the reason.
-
ensureServiceAt
@Internal public Mono<Void> ensureServiceAt(NodeIdentifier identifier, ServiceType serviceType, int port, Optional<String> bucket)
This method can be used by a caller to make sure a certain service is enabled at the given target node.This is advanced, internal functionality and should only be used if the caller knows what they are doing.
- Parameters:
identifier
- the node to check.serviceType
- the service type to enable if not enabled already.- Returns:
- a
Mono
which completes once initiated.
-
createNode
protected Node createNode(NodeIdentifier identifier)
-
-