Class DisableResourceHandlerBuilder
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.disable.DisableResourceHandlerBuilder
-
public class DisableResourceHandlerBuilder extends Object
Builder for theDisableResourceHandler
.Allows for customization of the following handler components:
-
-
Constructor Summary
Constructors Constructor Description DisableResourceHandlerBuilder(Session session)
Creates a newDisableResourceHandlerBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DisableResourceHandler
build()
Builds a new handler instance.DisableResourceHandlerBuilder
withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.DisableResourceHandlerBuilder
withPostDisableResourceCallback(PostDisableResourceCallback callback)
Sets the PostDisableResourceCallback used to build the handler instance.DisableResourceHandlerBuilder
withPreDisableResourceCallback(PreDisableResourceCallback callback)
Sets the PreDisableResourceCallback used to build the handler instance.
-
-
-
Constructor Detail
-
DisableResourceHandlerBuilder
public DisableResourceHandlerBuilder(Session session)
Creates a newDisableResourceHandlerBuilder
.The properties of this builder are initialised with:
ConnectorErrorHelper
built usingbuildDefault
- default implementation of
PreDisableResourceCallback
- default implementation of
PostDisableResourceCallback
- Parameters:
session
- Snowpark session object- Throws:
NullPointerException
- if the provided session object is null
-
-
Method Detail
-
withErrorHelper
public DisableResourceHandlerBuilder withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.- Parameters:
errorHelper
- connector error helper- Returns:
- this builder
-
withPreDisableResourceCallback
public DisableResourceHandlerBuilder withPreDisableResourceCallback(PreDisableResourceCallback callback)
Sets the PreDisableResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked before a resource is disabled.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
withPostDisableResourceCallback
public DisableResourceHandlerBuilder withPostDisableResourceCallback(PostDisableResourceCallback callback)
Sets the PostDisableResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked after a resource is disabled.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
build
public DisableResourceHandler build()
Builds a new handler instance.- Returns:
- new handler instance
- Throws:
NullPointerException
- if any property for the new handler is null
-
-