Table of Contents

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

string

ColumnBoolProp2

The BOOL_PROP_2 column of TableSimplePropertiesTriggers.

protected const string ColumnBoolProp2 = "BOOL_PROP_2"

Field Value

string

ColumnDecProp1

The DEC_PROP_1 column of TableSimplePropertiesTriggers.

protected const string ColumnDecProp1 = "DEC_PROP_1"

Field Value

string

ColumnDecProp2

The DEC_PROP_2 column of TableSimplePropertiesTriggers.

protected const string ColumnDecProp2 = "DEC_PROP_2"

Field Value

string

ColumnIntProp1

The INT_PROP_1 column of TableSimplePropertiesTriggers.

protected const string ColumnIntProp1 = "INT_PROP_1"

Field Value

string

ColumnIntProp2

The INT_PROP_2 column of TableSimplePropertiesTriggers.

protected const string ColumnIntProp2 = "INT_PROP_2"

Field Value

string

ColumnLongProp1

The LONG_PROP_1 column of TableSimplePropertiesTriggers.

protected const string ColumnLongProp1 = "LONG_PROP_1"

Field Value

string

ColumnLongProp2

The LONG_PROP_2 column of TableSimplePropertiesTriggers.

protected const string ColumnLongProp2 = "LONG_PROP_2"

Field Value

string

ColumnStrProp1

The STR_PROP_1 column of TableSimplePropertiesTriggers.

protected const string ColumnStrProp1 = "STR_PROP_1"

Field Value

string

ColumnStrProp2

The STR_PROP_2 column of TableSimplePropertiesTriggers.

protected const string ColumnStrProp2 = "STR_PROP_2"

Field Value

string

ColumnStrProp3

The STR_PROP_3 column of TableSimplePropertiesTriggers.

protected const string ColumnStrProp3 = "STR_PROP_3"

Field Value

string

ColumnTimeZoneId

The TIME_ZONE_ID column of TableSimplePropertiesTriggers.

protected const string ColumnTimeZoneId = "TIME_ZONE_ID"

Field Value

string

TableSimplePropertiesTriggers

The table this delegate persists into, kept here as the spelling a derived delegate writes.

protected const string TableSimplePropertiesTriggers = "SIMPROP_TRIGGERS"

Field Value

string

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

IDbAccessor

SchedulerName

The scheduler whose rows this delegate reads and writes.

protected string SchedulerName { get; }

Property Value

string

TablePrefix

The table prefix the store was configured with.

protected string TablePrefix { get; }

Property Value

string

Methods

CanHandleTriggerType(IOperableTrigger)

Returns whether the trigger type can be handled by delegate.

public abstract bool CanHandleTriggerType(IOperableTrigger trigger)

Parameters

trigger IOperableTrigger

Returns

bool

DeleteExtendedTriggerProperties(ConnectionAndTransactionHolder, TriggerKey, CancellationToken)

Deletes trigger's special properties.

public 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.

public abstract string GetHandledTriggerTypeDiscriminator()

Returns

string

GetTriggerProperties(IOperableTrigger)

Reads a trigger of the derived delegate's own family into the generic property columns.

protected abstract SimplePropertiesTriggerProperties GetTriggerProperties(IOperableTrigger trigger)

Parameters

trigger IOperableTrigger

The trigger being stored.

Returns

SimplePropertiesTriggerProperties

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

properties SimplePropertiesTriggerProperties

The columns as they were read.

Returns

TriggerPropertyBundle

Initialize(TriggerPersistenceDelegateContext)

Initializes the persistence delegate with the settings it works from.

public 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.

public 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.

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

Parameters

conn ConnectionAndTransactionHolder
triggerKey TriggerKey
cancellationToken CancellationToken

Returns

ValueTask<TriggerPropertyBundle>

ReadTriggerPropertyBundle(DbDataReader)

Read trigger state data from open data reader.

public 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.

public 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.

public 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>

See Also