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:
ResumeConnectorStateValidatorResumeConnectorCallbackConnectorErrorHelperLifecycleServiceResumeConnectorSdkCallbackResumeTaskReactorServiceInstanceStreamServiceTaskReactorInstanceActionExecutor
-
-
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.ResumeConnectorHandlerbuild()Builds a new handler instance.ResumeConnectorHandlerTestBuilderwithCallback(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorCallback callback)Sets the callback used to build the handler instance.ResumeConnectorHandlerTestBuilderwithErrorHelper(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)Sets the error helper used to build the handler instance.ResumeConnectorHandlerTestBuilderwithInstanceStreamService(com.snowflake.connectors.taskreactor.InstanceStreamService instanceStreamService)Sets the task reactor instance stream service used to build the handler instance.ResumeConnectorHandlerTestBuilderwithLifecycleService(com.snowflake.connectors.application.lifecycle.LifecycleService lifecycleService)Sets the lifecycle service used to build the handler instance.ResumeConnectorHandlerTestBuilderwithResumeTaskReactorService(com.snowflake.connectors.taskreactor.lifecycle.ResumeTaskReactorService resumeTaskReactorService)Sets the service used to resume Task Reactor instances.ResumeConnectorHandlerTestBuilderwithSchedulerManager(com.snowflake.connectors.application.scheduler.SchedulerManager schedulerManager)Sets the scheduler manager used to build the handler instance.ResumeConnectorHandlerTestBuilderwithSdkCallback(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorSdkCallback sdkCallback)Sets the internal sdk callback used to build the handler instance.ResumeConnectorHandlerTestBuilderwithStateValidator(com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorStateValidator stateValidator)Sets the state validator used to build the handler instance.ResumeConnectorHandlerTestBuilderwithTaskReactorInstanceActionExecutor(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 ConnectorErrorHelperbuilt usingbuildDefault- a default implementation of
LifecycleService, withPAUSEDstate as post-rollback status - a default implementation of
ResumeConnectorSdkCallback - a default implementation of
ResumeTaskReactorService - a default implementation of
InstanceStreamService - a default implementation of
TaskReactorInstanceActionExecutor - a default implementation of
SchedulerManager
- 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
-
withSchedulerManager
public ResumeConnectorHandlerTestBuilder withSchedulerManager(com.snowflake.connectors.application.scheduler.SchedulerManager schedulerManager)
Sets the scheduler manager used to build the handler instance.- Parameters:
schedulerManager- scheduler task manager- 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
-
-