Class EnableResourceHandlerBuilder
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.enable.EnableResourceHandlerBuilder
-
public class EnableResourceHandlerBuilder extends Object
Builder for theEnableResourceHandler
.Allows for customization of the following handler components:
-
-
Constructor Summary
Constructors Constructor Description EnableResourceHandlerBuilder(Session session)
Creates a newEnableResourceHandlerBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnableResourceHandler
build()
Builds a new handler instance.EnableResourceHandlerBuilder
withEnableResourceValidator(EnableResourceValidator validator)
Sets the EnableResourceValidator used to build the handler instance.EnableResourceHandlerBuilder
withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.EnableResourceHandlerBuilder
withPostEnableResourceCallback(PostEnableResourceCallback callback)
Sets the PostEnableResourceCallback used to build the handler instance.EnableResourceHandlerBuilder
withPreEnableResourceCallback(PreEnableResourceCallback callback)
Sets the PreEnableResourceCallback used to build the handler instance.
-
-
-
Constructor Detail
-
EnableResourceHandlerBuilder
public EnableResourceHandlerBuilder(Session session)
Creates a newEnableResourceHandlerBuilder
.The properties of this builder are initialised with:
ConnectorErrorHelper
built usingbuildDefault
- Parameters:
session
- Snowpark session object- Throws:
NullPointerException
- if the provided session object is null
-
-
Method Detail
-
withErrorHelper
public EnableResourceHandlerBuilder withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.- Parameters:
errorHelper
- connector error helper- Returns:
- this builder
-
withEnableResourceValidator
public EnableResourceHandlerBuilder withEnableResourceValidator(EnableResourceValidator validator)
Sets the EnableResourceValidator used to build the handler instance. It allows to add connector-specific logic which validates whether a resource can be enabled.- Parameters:
validator
- custom callback implementation- Returns:
- this builder
-
withPreEnableResourceCallback
public EnableResourceHandlerBuilder withPreEnableResourceCallback(PreEnableResourceCallback callback)
Sets the PreEnableResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked before a resource is enabled.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
withPostEnableResourceCallback
public EnableResourceHandlerBuilder withPostEnableResourceCallback(PostEnableResourceCallback callback)
Sets the PostEnableResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked after a resource is enabled.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
build
public EnableResourceHandler build()
Builds a new handler instance.- Returns:
- new handler instance
- Throws:
NullPointerException
- if any property for the new handler is null
-
-