Table of Contents

Interface ITriggerPersistenceDelegate

Namespace
Quartz.Impl.AdoJobStore
Assembly
Quartz.dll

An interface which provides an implementation for storing a particular type of ITrigger's extended properties.

public interface ITriggerPersistenceDelegate

Methods

CanHandleTriggerType(IOperableTrigger)

Returns whether the trigger type can be handled by delegate.

bool CanHandleTriggerType(IOperableTrigger trigger)

Parameters

trigger IOperableTrigger

Returns

bool

DeleteExtendedTriggerProperties(ConnectionAndTransactionHolder, TriggerKey, CancellationToken)

Deletes trigger's special properties.

ValueTask<int> DeleteExtendedTriggerProperties(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

conn ConnectionAndTransactionHolder
triggerKey TriggerKey
cancellationToken CancellationToken

Returns

ValueTask<int>

GetHandledTriggerTypeDiscriminator()

Returns database discriminator value for trigger type.

string GetHandledTriggerTypeDiscriminator()

Returns

string

Initialize(TriggerPersistenceDelegateContext)

Initializes the persistence delegate with the settings it works from.

void Initialize(TriggerPersistenceDelegateContext context)

Parameters

context TriggerPersistenceDelegateContext

The settings the driver delegate was initialized with.

Remarks

Called once by the driver delegate before this delegate is used. There is no default implementation: a delegate that does not read the context has no accessor to prepare its commands with, and would fail at its first statement rather than at startup.

InsertExtendedTriggerProperties(ConnectionAndTransactionHolder, IOperableTrigger, StoredTriggerState, IJobDetail, CancellationToken)

Inserts trigger's special properties.

ValueTask<int> InsertExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IOperableTrigger trigger, StoredTriggerState state, IJobDetail jobDetail, CancellationToken cancellationToken = default)

Parameters

conn ConnectionAndTransactionHolder
trigger IOperableTrigger
state StoredTriggerState
jobDetail IJobDetail
cancellationToken CancellationToken

Returns

ValueTask<int>

LoadExtendedTriggerProperties(ConnectionAndTransactionHolder, TriggerKey, CancellationToken)

Loads trigger's special properties.

ValueTask<TriggerPropertyBundle> LoadExtendedTriggerProperties(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, CancellationToken cancellationToken = default)

Parameters

conn ConnectionAndTransactionHolder
triggerKey TriggerKey
cancellationToken CancellationToken

Returns

ValueTask<TriggerPropertyBundle>

LoadExtendedTriggerProperties(ConnectionAndTransactionHolder, IReadOnlyCollection<TriggerKey>, CancellationToken)

Loads the special properties of several triggers of this delegate's type in as few round trips as the delegate can manage.

ValueTask<Dictionary<TriggerKey, TriggerPropertyBundle>> LoadExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)

Parameters

conn ConnectionAndTransactionHolder

The DB connection.

triggerKeys IReadOnlyCollection<TriggerKey>

The keys of the triggers to load properties for.

cancellationToken CancellationToken

The cancellation instruction.

Returns

ValueTask<Dictionary<TriggerKey, TriggerPropertyBundle>>

Remarks

The default implementation loops the single-key overload, so a delegate that does not override this keeps working unchanged. Keys whose row is missing — the trigger was deleted concurrently, QTZ-386 — are simply absent from the result rather than failing the whole batch.

ReadTriggerPropertyBundle(DbDataReader)

Read trigger state data from open data reader.

TriggerPropertyBundle ReadTriggerPropertyBundle(DbDataReader rs)

Parameters

rs DbDataReader

Returns

TriggerPropertyBundle

TryDescribeUpdateExtendedTriggerProperties(IOperableTrigger, StoredTriggerState, IJobDetail, ICollection<SqlStatement>)

Describes what UpdateExtendedTriggerProperties(ConnectionAndTransactionHolder, IOperableTrigger, StoredTriggerState, IJobDetail, CancellationToken) would issue, instead of issuing it, so that the caller can send it in the same round trip as the trigger's own row.

bool TryDescribeUpdateExtendedTriggerProperties(IOperableTrigger trigger, StoredTriggerState state, IJobDetail jobDetail, ICollection<SqlStatement> statements)

Parameters

trigger IOperableTrigger

The trigger whose properties are being written.

state StoredTriggerState

The state being written on the trigger's own row.

jobDetail IJobDetail

The job the trigger fires.

statements ICollection<SqlStatement>

The statements to append to.

Returns

bool

true when the update was appended and must not also be issued through UpdateExtendedTriggerProperties(ConnectionAndTransactionHolder, IOperableTrigger, StoredTriggerState, IJobDetail, CancellationToken).

Remarks

The default implementation describes nothing and reports false, so a delegate written before this existed — or one whose update is not expressible as plain parameterized statements, a blob it has to serialize under its own control being the case that matters — keeps being given a round trip of its own and behaves exactly as it did.

UpdateExtendedTriggerProperties(ConnectionAndTransactionHolder, IOperableTrigger, StoredTriggerState, IJobDetail, CancellationToken)

Updates trigger's special properties.

ValueTask<int> UpdateExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IOperableTrigger trigger, StoredTriggerState state, IJobDetail jobDetail, CancellationToken cancellationToken = default)

Parameters

conn ConnectionAndTransactionHolder
trigger IOperableTrigger
state StoredTriggerState
jobDetail IJobDetail
cancellationToken CancellationToken

Returns

ValueTask<int>