Package com.couchbase.client.dcp
Class DefaultConnectionNameGenerator
java.lang.Object
com.couchbase.client.dcp.DefaultConnectionNameGenerator
- All Implemented Interfaces:
ConnectionNameGenerator
The default implementation for the
ConnectionNameGenerator
.
It generates a new name every time called, using the format specified by the Response Time Observability RFC.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConnectionNameGenerator
A connection name generator with a default User Agent string.Fields inherited from interface com.couchbase.client.dcp.ConnectionNameGenerator
CONNECTION_NAME_MAX_UTF8_BYTES
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
extractConnectionId
(String connectionName) Returns the connection ID from the given connection name, or null if the connection name was not generated by this connection name generator.forProduct
(String productName, String productVersion, String... comments) Returns a new connection name generator that includes the given product information in the User Agent string.name()
Generates the name for a DCP Connection.toString()
-
Field Details
-
INSTANCE
A connection name generator with a default User Agent string.
-
-
Method Details
-
forProduct
public static DefaultConnectionNameGenerator forProduct(String productName, String productVersion, String... comments) Returns a new connection name generator that includes the given product information in the User Agent string.- Parameters:
productName
- Product name to include in the User Agent string.productVersion
- Optional product version to include in the User Agent string. May be null.comments
- Optional comments to include in the User Agent string.
-
name
Description copied from interface:ConnectionNameGenerator
Generates the name for a DCP Connection.The UTF-8 encoding of the name must be no longer than 200 bytes.
- Specified by:
name
in interfaceConnectionNameGenerator
-
extractConnectionId
Returns the connection ID from the given connection name, or null if the connection name was not generated by this connection name generator. -
toString
-