Class ConfigureConnectorHandler
- java.lang.Object
-
- com.snowflake.connectors.application.configuration.connector.ConfigureConnectorHandler
-
public class ConfigureConnectorHandler extends Object
Handler for the connector configuration 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 configuration failure, used by theConnectorErrorHelper
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConfigureConnectorHandlerBuilder
builder(Session session)
Returns a new instance ofConfigureConnectorHandlerBuilder
.static Variant
configureConnector(Session session, Variant configuration)
Default handler method for thePUBLIC.CONFIGURE_CONNECTOR
procedure.ConnectorResponse
configureConnector(Variant configuration)
Executes the main logic of the handler, with logging usingwithExceptionLogging
.
-
-
-
Field Detail
-
ERROR_TYPE
public static final String ERROR_TYPE
Error type for the connector configuration failure, used by theConnectorErrorHelper
.- See Also:
- Constant Field Values
-
-
Method Detail
-
configureConnector
public static Variant configureConnector(Session session, Variant configuration)
Default handler method for thePUBLIC.CONFIGURE_CONNECTOR
procedure.- Parameters:
session
- Snowpark session objectconfiguration
- connector configuration properties- Returns:
- a variant representing the
ConnectorResponse
returned byconfigureConnector
-
builder
public static ConfigureConnectorHandlerBuilder builder(Session session)
Returns a new instance ofConfigureConnectorHandlerBuilder
.- Parameters:
session
- Snowpark session object- Returns:
- a new builder instance
-
configureConnector
public ConnectorResponse configureConnector(Variant configuration)
Executes the main logic of the handler, with logging usingwithExceptionLogging
.The handler logic consists of:
- connector status check
ConnectorConfigurationService.validateFields(Variant)
ConfigureConnectorInputValidator.validate(Variant)
ConfigureConnectorCallback.execute(Variant)
- connector status update
- Parameters:
configuration
- connector configuration properties- Returns:
- a response with the code
OK
if the execution was successful, otherwise a response with an error code and an error message
-
-