Class CreateResourceHandlerBuilder
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.create.CreateResourceHandlerBuilder
-
public class CreateResourceHandlerBuilder extends Object
Builder for theCreateResourceHandler
.Allows for customization of the following handler components:
-
-
Constructor Summary
Constructors Constructor Description CreateResourceHandlerBuilder(Session session)
Creates a newCreateResourceHandlerBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateResourceHandler
build()
Builds a new handler instance.CreateResourceHandlerBuilder
withCreateResourceValidator(CreateResourceValidator validator)
Sets the CreateResourceValidator used to build the handler instance.CreateResourceHandlerBuilder
withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.CreateResourceHandlerBuilder
withPostCreateResourceCallback(PostCreateResourceCallback callback)
Sets the PostCreateResourceCallback used to build the handler instance.CreateResourceHandlerBuilder
withPreCreateResourceCallback(PreCreateResourceCallback callback)
Sets the PreCreateResourceCallback used to build the handler instance.
-
-
-
Constructor Detail
-
CreateResourceHandlerBuilder
public CreateResourceHandlerBuilder(Session session)
Creates a newCreateResourceHandlerBuilder
.The properties of this builder are initialised with:
ConnectorErrorHelper
built usingbuildDefault
- Default implementation of
PreCreateResourceCallback
- Default implementation of
PostCreateResourceCallback
- Default implementation of
CreateResourceValidator
- Parameters:
session
- Snowpark session object- Throws:
NullPointerException
- if the provided session object is null
-
-
Method Detail
-
withErrorHelper
public CreateResourceHandlerBuilder withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.- Parameters:
errorHelper
- connector error helper- Returns:
- this builder
-
withCreateResourceValidator
public CreateResourceHandlerBuilder withCreateResourceValidator(CreateResourceValidator validator)
Sets the CreateResourceValidator used to build the handler instance. It allows to add connector-specific logic which validates whether a resource can be created.- Parameters:
validator
- custom callback implementation- Returns:
- this builder
-
withPreCreateResourceCallback
public CreateResourceHandlerBuilder withPreCreateResourceCallback(PreCreateResourceCallback callback)
Sets the PreCreateResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked before a resource is created.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
withPostCreateResourceCallback
public CreateResourceHandlerBuilder withPostCreateResourceCallback(PostCreateResourceCallback callback)
Sets the PostCreateResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked after a resource is created.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
build
public CreateResourceHandler build()
Builds a new handler instance.- Returns:
- new handler instance
- Throws:
NullPointerException
- if any property for the new handler is null
-
-