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 EnableResourceHandlerBuilder
builder(Session session)
Returns a new instance ofEnableResourceHandlerBuilder
.static Variant
enableResource(Session session, String resourceIngestionDefinitionId)
Default handler method for thePUBLIC.ENABLE_RESOURCE
procedure.ConnectorResponse
enableResource(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_RESOURCE
procedure.- Parameters:
session
- Snowpark session objectresourceIngestionDefinitionId
- id of a resource ingestion definition which should be enabled- Returns:
- a variant representing the
ConnectorResponse
returned 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
IngestionProcess
for each ingestion configuration of given resource ingestion definition PostEnableResourceCallback.execute(java.lang.String)
InvalidInputException
is thrown.- Parameters:
resourceIngestionDefinitionId
- id of resource ingestion definition- 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 EnableResourceHandlerBuilder builder(Session session)
Returns a new instance ofEnableResourceHandlerBuilder
.- Parameters:
session
- Snowpark session object- Returns:
- a new builder instance
-
-