Package com.couchbase.client.core
Class CoreContext
java.lang.Object
com.couchbase.client.core.cnc.AbstractContext
com.couchbase.client.core.CoreContext
- All Implemented Interfaces:
Context
- Direct Known Subclasses:
EndpointContext,IoContext,NodeContext,ObserveContext,RequestContext,ServiceContext
The
CoreContext is bound to a core and provides both exportable and
usable state for the rest of the application to use.- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.couchbase.client.core.cnc.Context
Context.ExportFormat -
Constructor Summary
ConstructorsConstructorDescriptionCoreContext(Core core, long id, CoreEnvironment env, Authenticator authenticator) Creates a newCoreContext. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Always return an empty optional.alternateAddress(Optional<String> alternateAddress) Deprecated.This method does not do anything.Returns the authenticator used for this core.core()Returns the core to which this context belongs.The attached environment for this core.longid()A (app local) unique ID per core instance.voidinjectExportableParams(Map<String, Object> input) This method needs to be implemented by the actual context implementations to inject the params they need for exporting.Methods inherited from class com.couchbase.client.core.cnc.AbstractContext
exportAsMap, exportAsString, toString
-
Constructor Details
-
CoreContext
Creates a newCoreContext.- Parameters:
id- the core id.env- the core environment.
-
-
Method Details
-
id
public long id()A (app local) unique ID per core instance. -
environment
The attached environment for this core. -
coreResources
-
alternateAddress
Deprecated.Always return an empty optional. Alternate addresses are now resolved immediately when parsing cluster topology. -
authenticator
Returns the authenticator used for this core. -
alternateAddress
Deprecated.This method does not do anything.- Returns:
- the same
CoreContextfor chaining purposes.
-
core
Returns the core to which this context belongs. -
injectExportableParams
Description copied from class:AbstractContextThis method needs to be implemented by the actual context implementations to inject the params they need for exporting.- Overrides:
injectExportableParamsin classAbstractContext- Parameters:
input- pass exportable params in here.
-