Class PauseConnectorHandlerTestBuilder
- java.lang.Object
-
- com.snowflake.connectors.application.lifecycle.pause.PauseConnectorHandlerTestBuilder
-
public class PauseConnectorHandlerTestBuilder extends Object
Test builder for thePauseConnectorHandler.Allows for customization of the following handler components:
PauseConnectorStateValidatorPauseConnectorCallbackConnectorErrorHelperLifecycleServicePauseConnectorSdkCallbackPauseTaskReactorService
-
-
Constructor Summary
Constructors Constructor Description PauseConnectorHandlerTestBuilder()Creates a new, emptyPauseConnectorHandlerTestBuilder.PauseConnectorHandlerTestBuilder(Session session)Creates a newPauseConnectorHandlerTestBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.snowflake.connectors.application.lifecycle.pause.PauseConnectorHandlerbuild()Builds a new handler instance.PauseConnectorHandlerTestBuilderwithCallback(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorCallback callback)Sets the callback used to build the handler instance.PauseConnectorHandlerTestBuilderwithErrorHelper(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)Sets the error helper used to build the handler instance.PauseConnectorHandlerTestBuilderwithLifecycleService(com.snowflake.connectors.application.lifecycle.LifecycleService lifecycleService)Sets the lifecycle service used to build the handler instance.PauseConnectorHandlerTestBuilderwithPauseTaskReactorService(com.snowflake.connectors.taskreactor.lifecycle.PauseTaskReactorService pauseTaskReactorService)Sets the service used to pause Task Reactor instances.PauseConnectorHandlerTestBuilderwithSchedulerManager(com.snowflake.connectors.application.scheduler.SchedulerManager schedulerManager)Sets the scheduler manager used to build the handler instance.PauseConnectorHandlerTestBuilderwithSdkCallback(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorSdkCallback sdkCallback)Sets the internal sdk callback used to build the handler instance.PauseConnectorHandlerTestBuilderwithStateValidator(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorStateValidator stateValidator)Sets the state validator used to build the handler instance.
-
-
-
Constructor Detail
-
PauseConnectorHandlerTestBuilder
public PauseConnectorHandlerTestBuilder()
Creates a new, emptyPauseConnectorHandlerTestBuilder.Properties of the new builder instance must be fully customized before a handler instance can be built.
-
PauseConnectorHandlerTestBuilder
public PauseConnectorHandlerTestBuilder(Session session)
Creates a newPauseConnectorHandlerTestBuilder.The properties of this builder are initialised with:
- a default implementation of
PauseConnectorStateValidator - a default implementation of
PauseConnectorCallback ConnectorErrorHelperbuilt usingbuildDefault- a default implementation of
LifecycleService, withSTARTEDstate as post-rollback status - a default implementation of
PauseConnectorSdkCallback - a default implementation of
PauseTaskReactorService - 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 PauseConnectorHandlerTestBuilder withStateValidator(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorStateValidator stateValidator)
Sets the state validator used to build the handler instance.- Parameters:
stateValidator- connector state validator- Returns:
- this builder
-
withCallback
public PauseConnectorHandlerTestBuilder withCallback(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorCallback callback)
Sets the callback used to build the handler instance.- Parameters:
callback- pause connector callback- Returns:
- this builder
-
withErrorHelper
public PauseConnectorHandlerTestBuilder 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 PauseConnectorHandlerTestBuilder 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 PauseConnectorHandlerTestBuilder withSdkCallback(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorSdkCallback sdkCallback)
Sets the internal sdk callback used to build the handler instance.- Parameters:
sdkCallback- internal sdk callback- Returns:
- this builder
-
withPauseTaskReactorService
public PauseConnectorHandlerTestBuilder withPauseTaskReactorService(com.snowflake.connectors.taskreactor.lifecycle.PauseTaskReactorService pauseTaskReactorService)
Sets the service used to pause Task Reactor instances.- Parameters:
pauseTaskReactorService- service which pauses Task Reactor- Returns:
- this builder
-
withSchedulerManager
public PauseConnectorHandlerTestBuilder 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.pause.PauseConnectorHandler build()
Builds a new handler instance.- Returns:
- new handler instance
- Throws:
NullPointerException- if any property for the new handler is null
-
-