Package com.couchbase.client.core.io
Class IoContext
java.lang.Object
com.couchbase.client.core.cnc.AbstractContext
com.couchbase.client.core.CoreContext
com.couchbase.client.core.io.IoContext
- All Implemented Interfaces:
Context
The
IoContext
is used to extend the core context with IO related metadata
that is useful during event generation.- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.couchbase.client.core.cnc.Context
Context.ExportFormat
-
Constructor Summary
ConstructorDescriptionIoContext
(CoreContext ctx, SocketAddress localSocket, SocketAddress remoteSocket, Optional<String> bucket) Creates a new IO Context. -
Method Summary
Modifier and TypeMethodDescriptionbucket()
Returns the bucket name if present.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.Returns the local hostname, might be null if not available.int
Returns the local port, might be 0 if not available.Returns the local socket.Returns the remote socket.Methods inherited from class com.couchbase.client.core.CoreContext
alternateAddress, alternateAddress, authenticator, core, environment, id
Methods inherited from class com.couchbase.client.core.cnc.AbstractContext
exportAsMap, exportAsString, toString
-
Constructor Details
-
IoContext
public IoContext(CoreContext ctx, SocketAddress localSocket, SocketAddress remoteSocket, Optional<String> bucket) Creates a new IO Context.- Parameters:
ctx
- the core context as a parent.localSocket
- the local io socket.remoteSocket
- the remote io socket.bucket
- the bucket name, if it makes sense.
-
-
Method Details
-
injectExportableParams
Description copied from class:AbstractContext
This method needs to be implemented by the actual context implementations to inject the params they need for exporting.- Overrides:
injectExportableParams
in classCoreContext
- Parameters:
input
- pass exportable params in here.
-
localSocket
Returns the local socket. -
remoteSocket
Returns the remote socket. -
localHostname
Returns the local hostname, might be null if not available. -
localPort
public int localPort()Returns the local port, might be 0 if not available. -
bucket
Returns the bucket name if present.
-