Package io.temporal.client
Class WorkflowClientOptions.Builder
- java.lang.Object
-
- io.temporal.client.WorkflowClientOptions.Builder
-
- Enclosing class:
- WorkflowClientOptions
public static final class WorkflowClientOptions.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description WorkflowClientOptionsbuild()WorkflowClientOptions.BuildersetBinaryChecksum(java.lang.String binaryChecksum)Deprecated.useWorkerOptions.Builder.setBuildId(String)instead.WorkflowClientOptions.BuildersetContextPropagators(java.util.List<ContextPropagator> contextPropagators)WorkflowClientOptions.BuildersetDataConverter(DataConverter dataConverter)Overrides a data converter implementation used serialize workflow and activity arguments and results.WorkflowClientOptions.BuildersetIdentity(java.lang.String identity)Override human readable identity of the worker.WorkflowClientOptions.BuildersetInterceptors(WorkflowClientInterceptor... interceptors)Interceptor used to intercept workflow client calls.WorkflowClientOptions.BuildersetNamespace(java.lang.String namespace)WorkflowClientOptions.BuildersetPlugins(WorkflowClientPlugin... plugins)Sets the workflow client plugins to use with this client.WorkflowClientOptions.BuildersetQueryRejectCondition(io.temporal.api.enums.v1.QueryRejectCondition queryRejectCondition)Should a query be rejected by closed and failed workflows.WorkflowClientOptionsvalidateAndBuildWithDefaults()Validates options and builds with defaults applied.
-
-
-
Method Detail
-
setNamespace
public WorkflowClientOptions.Builder setNamespace(java.lang.String namespace)
-
setDataConverter
public WorkflowClientOptions.Builder setDataConverter(DataConverter dataConverter)
Overrides a data converter implementation used serialize workflow and activity arguments and results.Default is
DataConverter.getDefaultInstance().
-
setInterceptors
public WorkflowClientOptions.Builder setInterceptors(WorkflowClientInterceptor... interceptors)
Interceptor used to intercept workflow client calls.- Parameters:
interceptors- not null
-
setIdentity
public WorkflowClientOptions.Builder setIdentity(java.lang.String identity)
Override human readable identity of the worker. Identity is used to identify a worker and is recorded in the workflow history events. For example when a worker gets an activity task the correspondent ActivityTaskStarted event contains the worker identity as a field. Default is whatever(ManagementFactory.getRuntimeMXBean().getName()returns.
-
setBinaryChecksum
@Deprecated public WorkflowClientOptions.Builder setBinaryChecksum(java.lang.String binaryChecksum)
Deprecated.useWorkerOptions.Builder.setBuildId(String)instead.Sets worker binary checksum, which gets propagated in all history events and can be used for auto-reset assuming that every build has a new unique binary checksum. Can be null.
-
setContextPropagators
public WorkflowClientOptions.Builder setContextPropagators(java.util.List<ContextPropagator> contextPropagators)
- Parameters:
contextPropagators- specifies the list of context propagators to use with the client.
-
setQueryRejectCondition
public WorkflowClientOptions.Builder setQueryRejectCondition(io.temporal.api.enums.v1.QueryRejectCondition queryRejectCondition)
Should a query be rejected by closed and failed workflows.Default is
QueryRejectCondition.QUERY_REJECT_CONDITION_UNSPECIFIEDwhich means that closed and failed workflows are still queryable.
-
setPlugins
@Experimental public WorkflowClientOptions.Builder setPlugins(WorkflowClientPlugin... plugins)
Sets the workflow client plugins to use with this client. Plugins can modify client configuration.Plugins that also implement
WorkerPluginare automatically propagated to workers created from this client.- Parameters:
plugins- the workflow client plugins to use- Returns:
- this builder for chaining
- See Also:
WorkflowClientPlugin,WorkerPlugin
-
build
public WorkflowClientOptions build()
-
validateAndBuildWithDefaults
public WorkflowClientOptions validateAndBuildWithDefaults()
Validates options and builds with defaults applied.Note: If plugins are configured via
setPlugins(WorkflowClientPlugin...), they will have an opportunity to modify options after this method is called, when the options are passed toWorkflowClient.newInstance(io.temporal.serviceclient.WorkflowServiceStubs). This means validation performed here occurs before plugin modifications. In most cases, users should simply callbuild()and let the client creation handle validation.- Returns:
- validated options with defaults applied
-
-