/// <summary> /// Initializes a locklist, enclosing the ability of locking nodes, and creating a "replicated action" underneath /// </summary> /// <param name="auth">the authorization token</param> /// <param name="over">the overrides, optional</param> public void Initialize(ISessionAuth auth, IOperationOverrides over) { // we provision transactions at construction, which means they can commit in a different // order than monotonical increasing (if Tx1 starts becore Tx2 but Tx2 finishes before Tx1 does) this.SetTxIdAndTime(over); this.isLockDown = false; this.changelist = null; this.onAbort = null; this.readonlyInterfaceRequiresLocks = true; this.sessionAuth = auth; }
/// <summary> /// sets the txid and time for this locklist /// </summary> /// <param name="over">optional, the overrides</param> private void SetTxIdAndTime(IOperationOverrides over) { if (over != null && over.TxId != ulong.MaxValue) { this.TxId = (long)over.TxId; } if (over != null && over.TxTime != ulong.MaxValue) { this.TxTime = (long)over.TxTime; } else { this.TxTime = MutableStat.ConvertTime(DateTime.UtcNow); } }
/// <summary> /// initializes the object /// </summary> /// <param name="auth">Session auth</param> /// <param name="over">Not in use</param> public void Initialize(ISessionAuth auth, IOperationOverrides over) { this.auth = auth; }