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:
PauseConnectorStateValidator
PauseConnectorCallback
ConnectorErrorHelper
LifecycleService
PauseConnectorSdkCallback
PauseTaskReactorService
-
-
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.PauseConnectorHandler
build()
Builds a new handler instance.PauseConnectorHandlerTestBuilder
withCallback(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorCallback callback)
Sets the callback used to build the handler instance.PauseConnectorHandlerTestBuilder
withErrorHelper(com.snowflake.connectors.common.exception.helper.ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.PauseConnectorHandlerTestBuilder
withLifecycleService(com.snowflake.connectors.application.lifecycle.LifecycleService lifecycleService)
Sets the lifecycle service used to build the handler instance.PauseConnectorHandlerTestBuilder
withPauseTaskReactorService(com.snowflake.connectors.taskreactor.lifecycle.PauseTaskReactorService pauseTaskReactorService)
Sets the service used to pause Task Reactor instances.PauseConnectorHandlerTestBuilder
withSdkCallback(com.snowflake.connectors.application.lifecycle.pause.PauseConnectorSdkCallback sdkCallback)
Sets the internal sdk callback used to build the handler instance.PauseConnectorHandlerTestBuilder
withStateValidator(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
ConnectorErrorHelper
built usingbuildDefault
- a default implementation of
LifecycleService
, withSTARTED
state as post-rollback status - a default implementation of
PauseConnectorSdkCallback
- a default implementation of
PauseTaskReactorService
- 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
-
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
-
-