Class PauseConnectorHandler
- java.lang.Object
-
- com.snowflake.connectors.application.lifecycle.pause.PauseConnectorHandler
-
public class PauseConnectorHandler extends Object
Handler for the connector pausing process. A new instance of the handler must be created usingthe builder
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_TYPE
Error type for the connector pausing failure, used by theConnectorErrorHelper
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PauseConnectorHandlerBuilder
builder(Session session)
Returns a new instance ofPauseConnectorHandlerBuilder
.ConnectorResponse
pauseConnector()
Executes the main logic of the handler, with logging usingwithExceptionLogging
.static Variant
pauseConnector(Session session)
Default handler method for thePUBLIC.PAUSE_CONNECTOR
procedure.
-
-
-
Field Detail
-
ERROR_TYPE
public static final String ERROR_TYPE
Error type for the connector pausing failure, used by theConnectorErrorHelper
.- See Also:
- Constant Field Values
-
-
Method Detail
-
pauseConnector
public static Variant pauseConnector(Session session)
Default handler method for thePUBLIC.PAUSE_CONNECTOR
procedure.- Parameters:
session
- Snowpark session object- Returns:
- a variant representing the
ConnectorResponse
returned bypauseConnector
-
builder
public static PauseConnectorHandlerBuilder builder(Session session)
Returns a new instance ofPauseConnectorHandlerBuilder
.- Parameters:
session
- Snowpark session object- Returns:
- a new builder instance
-
pauseConnector
public ConnectorResponse pauseConnector()
Executes the main logic of the handler, with logging usingwithExceptionLogging
.The handler logic consists of:
- connector privileges check
- connector status check
PauseConnectorStateValidator.validate()
PauseConnectorCallback.execute()
PauseConnectorSdkCallback.execute()
PauseTaskReactorService.pauseAllInstances()
- connector status update
If the callback execution returns a
ROLLBACK
code, any changes made by this handler are also rolled back.- Returns:
- a response with the code
OK
if the execution was successful, a response with the codeROLLBACK
if a rollback operation was performed, or a response with an error code and an error message
-
-