Class CronTriggerPersistenceDelegate
- Namespace
- Quartz.Impl.AdoJobStore
- Assembly
- Quartz.dll
Persist a CronTriggerImpl.
public sealed class CronTriggerPersistenceDelegate : ITriggerPersistenceDelegate
- Inheritance
-
CronTriggerPersistenceDelegate
- Implements
- Inherited Members
Methods
CanHandleTriggerType(IOperableTrigger)
Returns whether the trigger type can be handled by delegate.
public bool CanHandleTriggerType(IOperableTrigger trigger)
Parameters
triggerIOperableTrigger
Returns
DeleteExtendedTriggerProperties(ConnectionAndTransactionHolder, TriggerKey, CancellationToken)
Deletes trigger's special properties.
public ValueTask<int> DeleteExtendedTriggerProperties(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
connConnectionAndTransactionHoldertriggerKeyTriggerKeycancellationTokenCancellationToken
Returns
GetHandledTriggerTypeDiscriminator()
Returns database discriminator value for trigger type.
public string GetHandledTriggerTypeDiscriminator()
Returns
Initialize(TriggerPersistenceDelegateContext)
Initializes the persistence delegate with the settings it works from.
public void Initialize(TriggerPersistenceDelegateContext context)
Parameters
contextTriggerPersistenceDelegateContextThe 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.
public ValueTask<int> InsertExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IOperableTrigger trigger, StoredTriggerState state, IJobDetail jobDetail, CancellationToken cancellationToken = default)
Parameters
connConnectionAndTransactionHoldertriggerIOperableTriggerstateStoredTriggerStatejobDetailIJobDetailcancellationTokenCancellationToken
Returns
LoadExtendedTriggerProperties(ConnectionAndTransactionHolder, TriggerKey, CancellationToken)
Loads trigger's special properties.
public ValueTask<TriggerPropertyBundle> LoadExtendedTriggerProperties(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, CancellationToken cancellationToken = default)
Parameters
connConnectionAndTransactionHoldertriggerKeyTriggerKeycancellationTokenCancellationToken
Returns
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.
public ValueTask<Dictionary<TriggerKey, TriggerPropertyBundle>> LoadExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IReadOnlyCollection<TriggerKey> triggerKeys, CancellationToken cancellationToken = default)
Parameters
connConnectionAndTransactionHolderThe DB connection.
triggerKeysIReadOnlyCollection<TriggerKey>The keys of the triggers to load properties for.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
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.
public TriggerPropertyBundle ReadTriggerPropertyBundle(DbDataReader rs)
Parameters
rsDbDataReader
Returns
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.
public bool TryDescribeUpdateExtendedTriggerProperties(IOperableTrigger trigger, StoredTriggerState state, IJobDetail jobDetail, ICollection<SqlStatement> statements)
Parameters
triggerIOperableTriggerThe trigger whose properties are being written.
stateStoredTriggerStateThe state being written on the trigger's own row.
jobDetailIJobDetailThe job the trigger fires.
statementsICollection<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.
public ValueTask<int> UpdateExtendedTriggerProperties(ConnectionAndTransactionHolder conn, IOperableTrigger trigger, StoredTriggerState state, IJobDetail jobDetail, CancellationToken cancellationToken = default)
Parameters
connConnectionAndTransactionHoldertriggerIOperableTriggerstateStoredTriggerStatejobDetailIJobDetailcancellationTokenCancellationToken