Class ResumeConnectorHandlerTestBuilder
- java.lang.Object
-
- com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorHandlerTestBuilder
-
public class ResumeConnectorHandlerTestBuilder extends Object
Builder for theResumeConnectorHandler
.Allows for customization of the following handler components:
ResumeConnectorStateValidator
ResumeConnectorCallback
ConnectorErrorHelper
LifecycleService
ResumeConnectorSdkCallback
ResumeTaskReactorService
InstanceStreamService
TaskReactorInstanceActionExecutor
-
-
Constructor Summary
Constructors Constructor Description ResumeConnectorHandlerTestBuilder()
Creates a new, emptyResumeConnectorHandlerTestBuilder
.ResumeConnectorHandlerTestBuilder(Session session)
Creates a newResumeConnectorHandler
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorHandler
build()
Builds a new handler instance.ResumeConnectorHandlerTestBuilder
withCallback(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorCallback callback)
Sets the callback used to build the handler instance.ResumeConnectorHandlerTestBuilder
withErrorHelper(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.ResumeConnectorHandlerTestBuilder
withInstanceStreamService(com.snowflake.connectors.taskreactor.InstanceStreamService instanceStreamService)
Sets the task reactor instance stream service used to build the handler instance.ResumeConnectorHandlerTestBuilder
withLifecycleService(com.snowflake.connectors.application.lifecycle.LifecycleService lifecycleService)
Sets the lifecycle service used to build the handler instance.ResumeConnectorHandlerTestBuilder
withResumeTaskReactorService(com.snowflake.connectors.taskreactor.lifecycle.ResumeTaskReactorService resumeTaskReactorService)
Sets the service used to resume Task Reactor instances.ResumeConnectorHandlerTestBuilder
withSdkCallback(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorSdkCallback sdkCallback)
Sets the internal sdk callback used to build the handler instance.ResumeConnectorHandlerTestBuilder
withStateValidator(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorStateValidator stateValidator)
Sets the state validator used to build the handler instance.ResumeConnectorHandlerTestBuilder
withTaskReactorInstanceActionExecutor(com.snowflake.connectors.taskreactor.TaskReactorInstanceActionExecutor taskReactorInstanceActionExecutor)
Sets the task reactor instance action executor used to build the handler instance.
-
-
-
Constructor Detail
-
ResumeConnectorHandlerTestBuilder
public ResumeConnectorHandlerTestBuilder()
Creates a new, emptyResumeConnectorHandlerTestBuilder
.Properties of the new builder instance must be fully customized before a handler instance can be built.
-
ResumeConnectorHandlerTestBuilder
public ResumeConnectorHandlerTestBuilder(Session session)
Creates a newResumeConnectorHandler
.The properties of this builder are initialised with:
- a default implementation of
ResumeConnectorStateValidator
- a default implementation of
ResumeConnectorCallback
ConnectorErrorHelper
built usingbuildDefault
- a default implementation of
LifecycleService
, withPAUSED
state as post-rollback status - a default implementation of
ResumeConnectorSdkCallback
- a default implementation of
ResumeTaskReactorService
- a default implementation of
InstanceStreamService
- a default implementation of
TaskReactorInstanceActionExecutor
- Parameters:
session
- Snowpark session object- Throws:
NullPointerException
- if the provided session object is null
- a default implementation of
-
-
Method Detail
-
withStateValidator
public ResumeConnectorHandlerTestBuilder withStateValidator(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorStateValidator stateValidator)
Sets the state validator used to build the handler instance.- Parameters:
stateValidator
- connector state validator- Returns:
- this builder
-
withCallback
public ResumeConnectorHandlerTestBuilder withCallback(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorCallback callback)
Sets the callback used to build the handler instance.- Parameters:
callback
- resume connector callback- Returns:
- this builder
-
withErrorHelper
public ResumeConnectorHandlerTestBuilder withErrorHelper(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.- Parameters:
errorHelper
- connector error helper- Returns:
- this builder
-
withLifecycleService
public ResumeConnectorHandlerTestBuilder withLifecycleService(com.snowflake.connectors.application.lifecycle.LifecycleService lifecycleService)
Sets the lifecycle service used to build the handler instance.- Parameters:
lifecycleService
- lifecycle service- Returns:
- this builder
-
withSdkCallback
public ResumeConnectorHandlerTestBuilder withSdkCallback(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorSdkCallback sdkCallback)
Sets the internal sdk callback used to build the handler instance.- Parameters:
sdkCallback
- internal sdk callback- Returns:
- this builder
-
withResumeTaskReactorService
public ResumeConnectorHandlerTestBuilder withResumeTaskReactorService(com.snowflake.connectors.taskreactor.lifecycle.ResumeTaskReactorService resumeTaskReactorService)
Sets the service used to resume Task Reactor instances.- Parameters:
resumeTaskReactorService
- service which resumes Task Reactor- Returns:
- this builder
-
withInstanceStreamService
public ResumeConnectorHandlerTestBuilder withInstanceStreamService(com.snowflake.connectors.taskreactor.InstanceStreamService instanceStreamService)
Sets the task reactor instance stream service used to build the handler instance.- Parameters:
instanceStreamService
- task reactor instance stream service- Returns:
- this builder
-
withTaskReactorInstanceActionExecutor
public ResumeConnectorHandlerTestBuilder withTaskReactorInstanceActionExecutor(com.snowflake.connectors.taskreactor.TaskReactorInstanceActionExecutor taskReactorInstanceActionExecutor)
Sets the task reactor instance action executor used to build the handler instance.- Parameters:
taskReactorInstanceActionExecutor
- task reactor instance action executor- Returns:
- this builder
-
build
public com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorHandler build()
Builds a new handler instance.- Returns:
- new handler instance
- Throws:
NullPointerException
- if any property for the new handler is null
-
-