public class CoreContext extends AbstractContext
CoreContext
is bound to a core and provides both exportable and
usable state for the rest of the application to use.Context.ExportFormat
Constructor and Description |
---|
CoreContext(Core core,
long id,
CoreEnvironment env,
Authenticator authenticator)
Creates a new
CoreContext . |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
alternateAddress()
Returns the alternate address identifier, if present.
|
CoreContext |
alternateAddress(Optional<String> alternateAddress)
Sets the alternate address on this context.
|
Authenticator |
authenticator()
Returns the authenticator used for this core.
|
Core |
core()
Returns the core to which this context belongs.
|
CoreEnvironment |
environment()
The attached environment for this core.
|
long |
id()
A (app local) unique ID per core instance.
|
void |
injectExportableParams(Map<String,Object> input)
This method needs to be implemented by the actual context implementations to
inject the params they need for exporting.
|
exportAsString, toString
public CoreContext(Core core, long id, CoreEnvironment env, Authenticator authenticator)
CoreContext
.id
- the core id.env
- the core environment.public long id()
public CoreEnvironment environment()
public Optional<String> alternateAddress()
public Authenticator authenticator()
@Stability.Internal public CoreContext alternateAddress(Optional<String> alternateAddress)
This is internal API and will alter the behavior of the system. Do not call this API if you are not 100% sure what you are doing!
alternateAddress
- the alternate address identifier, or empty if none available.CoreContext
for chaining purposes.public Core core()
public void injectExportableParams(Map<String,Object> input)
AbstractContext
injectExportableParams
in class AbstractContext
input
- pass exportable params in here.Copyright © 2020 Couchbase, Inc.. All rights reserved.