Class UpdateResourceHandler
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.update.UpdateResourceHandler
-
public class UpdateResourceHandler extends Object
Handler for the process of updating a resource. A new instance of the handler must be created usingthe builder
.For more information about the update process see
updateResource(String, Variant)
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UpdateResourceHandlerBuilder
builder(Session session)
Returns a new instance ofUpdateResourceHandlerBuilder
.static Variant
updateResource(Session session, String resourceIngestionDefinitionId, Variant updatedIngestionConfigurations)
Default handler method for thePUBLIC.UPDATE_RESOURCE
procedure.ConnectorResponse
updateResource(String resourceIngestionDefinitionId, Variant updatedIngestionConfigurations)
Executes the main logic of the handler, with logging usingwithExceptionLogging
.
-
-
-
Method Detail
-
updateResource
public static Variant updateResource(Session session, String resourceIngestionDefinitionId, Variant updatedIngestionConfigurations)
Default handler method for thePUBLIC.UPDATE_RESOURCE
procedure.- Parameters:
session
- Snowpark session objectupdatedIngestionConfigurations
- resource ingestion configurationsresourceIngestionDefinitionId
- resource ingestion definition id- Returns:
- a variant representing the
ConnectorResponse
returned byupdateResource
.
-
updateResource
public ConnectorResponse updateResource(String resourceIngestionDefinitionId, Variant updatedIngestionConfigurations)
Executes the main logic of the handler, with logging usingwithExceptionLogging
.The resource update process consists of:
- initial validation - whether a resource with given id already exists and whether the provided ingestion configurations have a valid structures
UpdateResourceValidator.validate(String, List)
PreUpdateResourceCallback.execute(String, List)
- updating ingestion configurations for a particular resource ingestion definition
- finishing all ingestion processes for removed ingestion configurations
- scheduling ingestion process for updated and new ingestion configurations
PostUpdateResourceCallback.execute(String, List)
- Parameters:
resourceIngestionDefinitionId
- resource ingestion definition idupdatedIngestionConfigurations
- resource ingestion configurations- Returns:
- a response with the code
OK
if the execution was successful, otherwise a response with an error code and an error message
-
builder
public static UpdateResourceHandlerBuilder builder(Session session)
Returns a new instance ofUpdateResourceHandlerBuilder
.- Parameters:
session
- Snowpark session object- Returns:
- a new builder instance
-
-