Interface IUniqueSequenceProvider
Represents an entity that provides unique identifiers via named sequences
Inherited Members
Namespace: NFX.DataAccess
Assembly: NFX.dll
Syntax
public interface IUniqueSequenceProvider : INamed
Properties
SequenceScopeNames
Returns the list of all scope names in the instance
Declaration
IEnumerable<string> SequenceScopeNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
Methods
GenerateOneSequenceID(String, String, Int32, Nullable<UInt64>, Boolean)
Generates one ID for the supplied sequence name. Note: do not confuse with block pre-allocation, which is an internal optimization. Even if 100 IDs are pre-allocated the method returns one unique ID
Declaration
ulong GenerateOneSequenceID(string scopeName, string sequenceName, int blockSize = 0, ulong ? vicinity, bool noLWM = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | scopeName | The name of scope where sequences are kept |
System.String | sequenceName | The name of sequence within the scope for which ID to be obtained |
System.Int32 | blockSize | If >0 specifies how many sequence values to pre-allocate, otherwise provider would use its default setting |
System.Nullable<System.UInt64> | vicinity | The location on ID counter scale, the issuing authority may disregard this parameter |
System.Boolean | noLWM | When true, does not start async fetch of the next ID block while the current block reaches low-water-mark. This may not be desired in some short-lived processes. The provider may disregard this flag |
Returns
Type | Description |
---|---|
System.UInt64 | The new ULONG sequence value |
GetSequenceInfos(String)
Returns sequnce information enumerable for all sequences in the named scope
Declaration
IEnumerable<ISequenceInfo> GetSequenceInfos(string scopeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | scopeName |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISequenceInfo> |
TryGenerateManyConsecutiveSequenceIDs(String, String, Int32, Nullable<UInt64>, Boolean)
Tries to generate many consecutive IDs. If the reserved block gets exhausted, then the returned ID count may be less than requested.
Declaration
ConsecutiveUniqueSequenceIDs TryGenerateManyConsecutiveSequenceIDs(string scopeName, string sequenceName, int idCount, ulong ? vicinity, bool noLWM = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | scopeName | The name of scope where sequences are kept |
System.String | sequenceName | The name of sequence within the scope for which ID to be obtained |
System.Int32 | idCount | How many Consecutive IDs should the system try to reserve |
System.Nullable<System.UInt64> | vicinity | The location on ID counter scale, the issuing authority may disregard this parameter |
System.Boolean | noLWM | When true, does not start async fetch of the next ID block while the current block reaches low-water-mark. This may not be desired in some short-lived processes. The provider may disregard this flag |
Returns
Type | Description |
---|---|
ConsecutiveUniqueSequenceIDs | The first uniqueID along with the number of Consecutive IDs that the system could allocate which can be less than requested number of IDs |