Class ResumeConnectorHandler
- java.lang.Object
-
- com.snowflake.connectors.application.lifecycle.resume.ResumeConnectorHandler
-
public class ResumeConnectorHandler extends Object
Handler for the connector resuming process. A new instance of the handler must be created usingthe builder.
-
-
Field Summary
Fields Modifier and Type Field Description static StringERROR_TYPEError type for the connector resuming failure, used by theConnectorErrorHelper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResumeConnectorHandlerBuilderbuilder(Session session)Returns a new instance ofResumeConnectorHandlerBuilder.ConnectorResponseresumeConnector()Executes the main logic of the handler, with logging usingwithExceptionLogging.static VariantresumeConnector(Session session)Default handler method for thePUBLIC.RESUME_CONNECTORprocedure.
-
-
-
Field Detail
-
ERROR_TYPE
public static final String ERROR_TYPE
Error type for the connector resuming failure, used by theConnectorErrorHelper.- See Also:
- Constant Field Values
-
-
Method Detail
-
resumeConnector
public static Variant resumeConnector(Session session)
Default handler method for thePUBLIC.RESUME_CONNECTORprocedure.- Parameters:
session- Snowpark session object- Returns:
- a variant representing the
ConnectorResponsereturned byresumeConnector
-
builder
public static ResumeConnectorHandlerBuilder builder(Session session)
Returns a new instance ofResumeConnectorHandlerBuilder.- Parameters:
session- Snowpark session object- Returns:
- a new builder instance
-
resumeConnector
public ConnectorResponse resumeConnector()
Executes the main logic of the handler, with logging usingwithExceptionLogging.The handler logic consists of:
- connector privileges check
- connector status check
ResumeConnectorStateValidator.validate()ResumeConnectorCallback.execute()ResumeConnectorSdkCallback.execute()InstanceStreamService.recreateStreams(Identifier)executed for all Task Reactor instances- connector status update
If the callback execution returns a
ROLLBACKcode, any changes made by this handler are also rolled back.- Returns:
- a response with the code
OKif the execution was successful, a response with the codeROLLBACKif a rollback operation was performed, or a response with an error code and an error message
-
-