Class DefaultTaskRef

    • Method Detail

      • name

        public ObjectName name()
        Specified by:
        name in interface TaskRef
        Returns:
        name of the referenced task
      • execute

        public void execute()
        Description copied from interface: TaskRef
        Executes immediately the referenced task.

        Throws SnowflakeSQLException if task does not exist or not authorized.

        Specified by:
        execute in interface TaskRef
      • checkIfExists

        public boolean checkIfExists()
        Specified by:
        checkIfExists in interface TaskRef
        Returns:
        true if task can be matched with a task existing in Snowflake database, otherwise false
      • resume

        public void resume()
        Description copied from interface: TaskRef
        Resumes suspended referenced task.

        If the task is already resumed - the operation is ignored.

        Throws SnowflakeSQLException if task does not exist or not authorized.

        Specified by:
        resume in interface TaskRef
      • resumeIfExists

        public void resumeIfExists()
        Description copied from interface: TaskRef
        Resumes suspended referenced task if it exists.

        If the task is already resumed - the operation is ignored.

        Throws SnowflakeSQLException not authorized.

        Specified by:
        resumeIfExists in interface TaskRef
      • suspend

        public void suspend()
        Description copied from interface: TaskRef
        Suspends running referenced task.

        If the task is already suspended - the operation is ignored.

        Throws SnowflakeSQLException if task does not exist or not authorized.

        Specified by:
        suspend in interface TaskRef
      • suspendIfExists

        public void suspendIfExists()
        Description copied from interface: TaskRef
        Suspends running referenced task if it exists.

        If the task is already suspended - the operation is ignored.

        Throws SnowflakeSQLException if not authorized.

        Specified by:
        suspendIfExists in interface TaskRef
      • drop

        public void drop()
        Description copied from interface: TaskRef
        Removes referenced task from the database.

        Current execution of the task is finished before the task is dropped.

        Throws SnowflakeSQLException if task does not exist or not authorized.

        Specified by:
        drop in interface TaskRef
      • dropIfExists

        public void dropIfExists()
        Description copied from interface: TaskRef
        Removes referenced task from the database if it exists.

        Current execution of the task is finished before the task is dropped.

        Throws SnowflakeSQLException if task does not exist or not authorized.

        Specified by:
        dropIfExists in interface TaskRef
      • alterSchedule

        public void alterSchedule​(String schedule)
        Description copied from interface: TaskRef
        Changes schedule of referenced task.

        Throws SnowflakeSQLException if task does not exist, not authorized, or schedule is invalid.

        Specified by:
        alterSchedule in interface TaskRef
        Parameters:
        schedule - interval or cron expression which will be set
      • alterScheduleIfExists

        public void alterScheduleIfExists​(String schedule)
        Description copied from interface: TaskRef
        Changes schedule of referenced task if it exists.

        Throws SnowflakeSQLException if task does not exist, not authorized, or schedule is invalid.

        Specified by:
        alterScheduleIfExists in interface TaskRef
        Parameters:
        schedule - interval or cron expression which will be set
      • alterWarehouse

        public void alterWarehouse​(String warehouse)
        Description copied from interface: TaskRef
        Changes warehouse of referenced task.

        Throws SnowflakeSQLException if task does not exist, not authorized, or warehouse name is invalid.

        Specified by:
        alterWarehouse in interface TaskRef
        Parameters:
        warehouse - warehouse name which will be set
      • alterWarehouseIfExists

        public void alterWarehouseIfExists​(String warehouse)
        Description copied from interface: TaskRef
        Changes warehouse of referenced task if it exists.

        Throws SnowflakeSQLException if task does not exist, not authorized, or warehouse name is invalid.

        Specified by:
        alterWarehouseIfExists in interface TaskRef
        Parameters:
        warehouse - warehouse name which will be set
      • grantMonitorPrivilegeToRole

        public void grantMonitorPrivilegeToRole​(String role)
        Description copied from interface: TaskRef
        Grants monitor privilege to given application role.

        Throws SnowflakeSQLException if task does not exist, not authorized, or role is invalid.

        Specified by:
        grantMonitorPrivilegeToRole in interface TaskRef
        Parameters:
        role - role which will be granted monitor privilege
      • fetch

        public TaskProperties fetch()
        Description copied from interface: TaskRef
        Fetches properties containing base information about the referenced task.

        Throws SnowflakeSQLException if task does not exist or not authorized.

        Specified by:
        fetch in interface TaskRef
        Returns:
        properties of the referenced task