Class UpdateWarehouseHandler
- java.lang.Object
-
- com.snowflake.connectors.application.configuration.warehouse.UpdateWarehouseHandler
-
public class UpdateWarehouseHandler extends Object
Handler for the warehouse update 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 warehouse update failure, used by theConnectorErrorHelper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UpdateWarehouseHandlerBuilderbuilder(Session session)Returns a new instance ofUpdateWarehouseHandlerBuilder.static VariantupdateWarehouse(Session session, String warehouseName)Default handler method for thePUBLIC.UPDATE_WAREHOUSEprocedure.ConnectorResponseupdateWarehouse(String warehouseName)Executes the main logic of the handler, with logging usingwithExceptionLogging.
-
-
-
Field Detail
-
ERROR_TYPE
public static final String ERROR_TYPE
Error type for the warehouse update failure, used by theConnectorErrorHelper.- See Also:
- Constant Field Values
-
-
Method Detail
-
updateWarehouse
public static Variant updateWarehouse(Session session, String warehouseName)
Default handler method for thePUBLIC.UPDATE_WAREHOUSEprocedure.- Parameters:
session- Snowpark session objectwarehouseName- new warehouse name- Returns:
- a variant representing the
ConnectorResponsereturned byupdateWarehouse
-
builder
public static UpdateWarehouseHandlerBuilder builder(Session session)
Returns a new instance ofUpdateWarehouseHandlerBuilder.- Parameters:
session- Snowpark session object- Returns:
- a new builder instance
-
updateWarehouse
public ConnectorResponse updateWarehouse(String warehouseName)
Executes the main logic of the handler, with logging usingwithExceptionLogging.The handler logic consists of:
- connector status check
UpdateWarehouseInputValidator.validate(Identifier)UpdateWarehouseCallback.execute(Identifier)UpdateWarehouseSdkCallback.execute(Identifier)- connector configuration update
- Parameters:
warehouseName- new warehouse name- Returns:
- a response with the code
OKif the execution was successful, otherwise a response with an error code and an error message
-
-