Class EnableResourceHandler
- java.lang.Object
-
- com.snowflake.connectors.application.ingestion.enable.EnableResourceHandler
-
public class EnableResourceHandler extends Object
Handler for the process of enabling a resource. A new instance of the handler must be created usingthe builder.For more information about the disabling process see
enableResource(String).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EnableResourceHandlerBuilderbuilder(Session session)Returns a new instance ofEnableResourceHandlerBuilder.static VariantenableResource(Session session, String resourceIngestionDefinitionId)Default handler method for thePUBLIC.ENABLE_RESOURCEprocedure.ConnectorResponseenableResource(String resourceIngestionDefinitionId)Enables a resource with given id.
-
-
-
Method Detail
-
enableResource
public static Variant enableResource(Session session, String resourceIngestionDefinitionId)
Default handler method for thePUBLIC.ENABLE_RESOURCEprocedure.- Parameters:
session- Snowpark session objectresourceIngestionDefinitionId- id of a resource ingestion definition which should be enabled- Returns:
- a variant representing the
ConnectorResponsereturned byenableResource(String)
-
enableResource
public ConnectorResponse enableResource(String resourceIngestionDefinitionId)
Enables a resource with given id.The process of enabling a resource consists of:
EnableResourceValidator.validate(java.lang.String)PreEnableResourceCallback.execute(java.lang.String)- changing 'enabled' flag of the resource ingestion definition to true
- creating a new
IngestionProcessfor each ingestion configuration of given resource ingestion definition PostEnableResourceCallback.execute(java.lang.String)
InvalidInputExceptionis thrown.- Parameters:
resourceIngestionDefinitionId- id of resource ingestion definition- Returns:
- a response with the code
OKif the execution was successful, otherwise a response with an error code and an error message
-
builder
public static EnableResourceHandlerBuilder builder(Session session)
Returns a new instance ofEnableResourceHandlerBuilder.- Parameters:
session- Snowpark session object- Returns:
- a new builder instance
-
-