Class SimplePropertiesTriggerPersistenceDelegateBase
- Namespace
- Quartz.Impl.AdoJobStore
- Assembly
- Quartz.dll
A base implementation of ITriggerPersistenceDelegate that persists trigger fields in the "QRTZ_SIMPROP_TRIGGERS" table. This allows extending concrete classes to simply implement a couple methods that do the work of getting/setting the trigger's fields, and creating the IScheduleBuilder for the particular type of trigger.
public abstract class SimplePropertiesTriggerPersistenceDelegateBase : ITriggerPersistenceDelegate
- Inheritance
-
SimplePropertiesTriggerPersistenceDelegateBase
- Implements
- Derived
- Inherited Members
Fields
ColumnBoolProp1
The BOOL_PROP_1 column of TableSimplePropertiesTriggers.
protected const string ColumnBoolProp1 = "BOOL_PROP_1"
Field Value
ColumnBoolProp2
The BOOL_PROP_2 column of TableSimplePropertiesTriggers.
protected const string ColumnBoolProp2 = "BOOL_PROP_2"
Field Value
ColumnDecProp1
The DEC_PROP_1 column of TableSimplePropertiesTriggers.
protected const string ColumnDecProp1 = "DEC_PROP_1"
Field Value
ColumnDecProp2
The DEC_PROP_2 column of TableSimplePropertiesTriggers.
protected const string ColumnDecProp2 = "DEC_PROP_2"
Field Value
ColumnIntProp1
The INT_PROP_1 column of TableSimplePropertiesTriggers.
protected const string ColumnIntProp1 = "INT_PROP_1"
Field Value
ColumnIntProp2
The INT_PROP_2 column of TableSimplePropertiesTriggers.
protected const string ColumnIntProp2 = "INT_PROP_2"
Field Value
ColumnLongProp1
The LONG_PROP_1 column of TableSimplePropertiesTriggers.
protected const string ColumnLongProp1 = "LONG_PROP_1"
Field Value
ColumnLongProp2
The LONG_PROP_2 column of TableSimplePropertiesTriggers.
protected const string ColumnLongProp2 = "LONG_PROP_2"
Field Value
ColumnStrProp1
The STR_PROP_1 column of TableSimplePropertiesTriggers.
protected const string ColumnStrProp1 = "STR_PROP_1"
Field Value
ColumnStrProp2
The STR_PROP_2 column of TableSimplePropertiesTriggers.
protected const string ColumnStrProp2 = "STR_PROP_2"
Field Value
ColumnStrProp3
The STR_PROP_3 column of TableSimplePropertiesTriggers.
protected const string ColumnStrProp3 = "STR_PROP_3"
Field Value
ColumnTimeZoneId
The TIME_ZONE_ID column of TableSimplePropertiesTriggers.
protected const string ColumnTimeZoneId = "TIME_ZONE_ID"
Field Value
TableSimplePropertiesTriggers
The table this delegate persists into, kept here as the spelling a derived delegate writes.
protected const string TableSimplePropertiesTriggers = "SIMPROP_TRIGGERS"
Field Value
Remarks
The value belongs to AdoConstants, where every table the store reads or writes is named, because that list is what startup schema validation probes. Declared only here, it was a table validation did not know about: a database missing this one alone started, and failed on the first calendar-interval, daily-time-interval or recurrence trigger written to it (#3564).
Properties
DbAccessor
How a value is bound to a command and read back out of a row.
protected IDbAccessor DbAccessor { get; }
Property Value
SchedulerName
The scheduler whose rows this delegate reads and writes.
protected string SchedulerName { get; }
Property Value
TablePrefix
The table prefix the store was configured with.
protected string TablePrefix { get; }
Property Value
Methods
CanHandleTriggerType(IOperableTrigger)
Returns whether the trigger type can be handled by delegate.
public abstract 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 abstract string GetHandledTriggerTypeDiscriminator()
Returns
GetTriggerProperties(IOperableTrigger)
Reads a trigger of the derived delegate's own family into the generic property columns.
protected abstract SimplePropertiesTriggerProperties GetTriggerProperties(IOperableTrigger trigger)
Parameters
triggerIOperableTriggerThe trigger being stored.
Returns
GetTriggerPropertyBundle(SimplePropertiesTriggerProperties)
Builds the schedule of a trigger of the derived delegate's own family back out of the generic property columns.
protected abstract TriggerPropertyBundle GetTriggerPropertyBundle(SimplePropertiesTriggerProperties properties)
Parameters
propertiesSimplePropertiesTriggerPropertiesThe columns as they were read.
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
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