Class DefaultTaskRef
- java.lang.Object
-
- com.snowflake.connectors.common.task.DefaultTaskRef
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidalterSchedule(String schedule)Changes schedule of referenced task.voidalterScheduleIfExists(String schedule)Changes schedule of referenced task if it exists.voidalterWarehouse(String warehouse)Changes warehouse of referenced task.voidalterWarehouseIfExists(String warehouse)Changes warehouse of referenced task if it exists.booleancheckIfExists()voiddrop()Removes referenced task from the database.voiddropIfExists()Removes referenced task from the database if it exists.booleanequals(Object o)voidexecute()Executes immediately the referenced task.TaskPropertiesfetch()Fetches properties containing base information about the referenced task.voidgrantMonitorPrivilegeToRole(String role)Grants monitor privilege to given application role.inthashCode()ObjectNamename()voidresume()Resumes suspended referenced task.voidresumeIfExists()Resumes suspended referenced task if it exists.voidsuspend()Suspends running referenced task.voidsuspendIfExists()Suspends running referenced task if it exists.
-
-
-
Method Detail
-
name
public ObjectName name()
-
execute
public void execute()
Description copied from interface:TaskRefExecutes immediately the referenced task.Throws
SnowflakeSQLExceptionif task does not exist or not authorized.
-
checkIfExists
public boolean checkIfExists()
- Specified by:
checkIfExistsin interfaceTaskRef- Returns:
- true if task can be matched with a task existing in Snowflake database, otherwise false
-
resume
public void resume()
Description copied from interface:TaskRefResumes suspended referenced task.If the task is already resumed - the operation is ignored.
Throws
SnowflakeSQLExceptionif task does not exist or not authorized.
-
resumeIfExists
public void resumeIfExists()
Description copied from interface:TaskRefResumes suspended referenced task if it exists.If the task is already resumed - the operation is ignored.
Throws
SnowflakeSQLExceptionnot authorized.- Specified by:
resumeIfExistsin interfaceTaskRef
-
suspend
public void suspend()
Description copied from interface:TaskRefSuspends running referenced task.If the task is already suspended - the operation is ignored.
Throws
SnowflakeSQLExceptionif task does not exist or not authorized.
-
suspendIfExists
public void suspendIfExists()
Description copied from interface:TaskRefSuspends running referenced task if it exists.If the task is already suspended - the operation is ignored.
Throws
SnowflakeSQLExceptionif not authorized.- Specified by:
suspendIfExistsin interfaceTaskRef
-
drop
public void drop()
Description copied from interface:TaskRefRemoves referenced task from the database.Current execution of the task is finished before the task is dropped.
Throws
SnowflakeSQLExceptionif task does not exist or not authorized.
-
dropIfExists
public void dropIfExists()
Description copied from interface:TaskRefRemoves referenced task from the database if it exists.Current execution of the task is finished before the task is dropped.
Throws
SnowflakeSQLExceptionif task does not exist or not authorized.- Specified by:
dropIfExistsin interfaceTaskRef
-
alterSchedule
public void alterSchedule(String schedule)
Description copied from interface:TaskRefChanges schedule of referenced task.Throws
SnowflakeSQLExceptionif task does not exist, not authorized, or schedule is invalid.- Specified by:
alterSchedulein interfaceTaskRef- Parameters:
schedule- interval or cron expression which will be set
-
alterScheduleIfExists
public void alterScheduleIfExists(String schedule)
Description copied from interface:TaskRefChanges schedule of referenced task if it exists.Throws
SnowflakeSQLExceptionif task does not exist, not authorized, or schedule is invalid.- Specified by:
alterScheduleIfExistsin interfaceTaskRef- Parameters:
schedule- interval or cron expression which will be set
-
alterWarehouse
public void alterWarehouse(String warehouse)
Description copied from interface:TaskRefChanges warehouse of referenced task.Throws
SnowflakeSQLExceptionif task does not exist, not authorized, or warehouse name is invalid.- Specified by:
alterWarehousein interfaceTaskRef- Parameters:
warehouse- warehouse name which will be set
-
alterWarehouseIfExists
public void alterWarehouseIfExists(String warehouse)
Description copied from interface:TaskRefChanges warehouse of referenced task if it exists.Throws
SnowflakeSQLExceptionif task does not exist, not authorized, or warehouse name is invalid.- Specified by:
alterWarehouseIfExistsin interfaceTaskRef- Parameters:
warehouse- warehouse name which will be set
-
grantMonitorPrivilegeToRole
public void grantMonitorPrivilegeToRole(String role)
Description copied from interface:TaskRefGrants monitor privilege to given application role.Throws
SnowflakeSQLExceptionif task does not exist, not authorized, or role is invalid.- Specified by:
grantMonitorPrivilegeToRolein interfaceTaskRef- Parameters:
role- role which will be granted monitor privilege
-
fetch
public TaskProperties fetch()
Description copied from interface:TaskRefFetches properties containing base information about the referenced task.Throws
SnowflakeSQLExceptionif task does not exist or not authorized.
-
-