Class ResumeConnectorHandlerTestBuilder


  • public class ResumeConnectorHandlerTestBuilder
    extends Object
    Builder for the ResumeConnectorHandler.

    Allows for customization of the following handler components:

    • ResumeConnectorStateValidator
    • ResumeConnectorCallback
    • ConnectorErrorHelper
    • LifecycleService
    • ResumeConnectorSdkCallback
    • ResumeTaskReactorService
    • InstanceStreamService
    • TaskReactorInstanceActionExecutor
    • Constructor Detail

      • ResumeConnectorHandlerTestBuilder

        public ResumeConnectorHandlerTestBuilder()
        Creates a new, empty ResumeConnectorHandlerTestBuilder.

        Properties of the new builder instance must be fully customized before a handler instance can be built.

      • ResumeConnectorHandlerTestBuilder

        public ResumeConnectorHandlerTestBuilder​(Session session)
        Creates a new ResumeConnectorHandler.

        The properties of this builder are initialised with:

        • a default implementation of ResumeConnectorStateValidator
        • a default implementation of ResumeConnectorCallback
        • ConnectorErrorHelper built using buildDefault
        • a default implementation of LifecycleService, with PAUSED 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
    • 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