Class UpdateResourceHandlerBuilder
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.update.UpdateResourceHandlerBuilder
-
public class UpdateResourceHandlerBuilder extends Object
Builder for theUpdateResourceHandler
.Allows for customization of the following handler components:
-
-
Constructor Summary
Constructors Constructor Description UpdateResourceHandlerBuilder(Session session)
Creates a newUpdateResourceHandlerBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UpdateResourceHandler
build()
Builds a new handler instance.UpdateResourceHandlerBuilder
withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.UpdateResourceHandlerBuilder
withPostUpdateResourceCallback(PostUpdateResourceCallback callback)
Sets the PostUpdateResourceCallback used to build the handler instance.UpdateResourceHandlerBuilder
withPreUpdateResourceCallback(PreUpdateResourceCallback callback)
Sets the PreUpdateResourceCallback used to build the handler instance.UpdateResourceHandlerBuilder
withUpdateResourceValidator(UpdateResourceValidator validator)
Sets the UpdateResourceValidator used to build the handler instance.
-
-
-
Constructor Detail
-
UpdateResourceHandlerBuilder
public UpdateResourceHandlerBuilder(Session session)
Creates a newUpdateResourceHandlerBuilder
.The properties of this builder are initialised with:
- Parameters:
session
- Snowpark session object- Throws:
NullPointerException
- if the provided session object is null
-
-
Method Detail
-
withErrorHelper
public UpdateResourceHandlerBuilder withErrorHelper(ConnectorErrorHelper errorHelper)
Sets the error helper used to build the handler instance.- Parameters:
errorHelper
- connector error helper- Returns:
- this builder
-
withUpdateResourceValidator
public UpdateResourceHandlerBuilder withUpdateResourceValidator(UpdateResourceValidator validator)
Sets the UpdateResourceValidator used to build the handler instance. It allows to add connector-specific logic which validates whether a resource can be updated.- Parameters:
validator
- custom callback implementation- Returns:
- this builder
-
withPreUpdateResourceCallback
public UpdateResourceHandlerBuilder withPreUpdateResourceCallback(PreUpdateResourceCallback callback)
Sets the PreUpdateResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked before a resource is updated.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
withPostUpdateResourceCallback
public UpdateResourceHandlerBuilder withPostUpdateResourceCallback(PostUpdateResourceCallback callback)
Sets the PostUpdateResourceCallback used to build the handler instance. It allows to add connector-specific logic which is invoked after a resource is updated.- Parameters:
callback
- custom callback implementation- Returns:
- this builder
-
build
public UpdateResourceHandler build()
Builds a new handler instance.- Returns:
- new handler instance
- Throws:
NullPointerException
- if any property for the new handler is null
-
-