Interface IBank
Provides abstraction for Global Database Bank instance
Inherited Members
Namespace: NFX.DataAccess.Distributed
Assembly: NFX.dll
Syntax
public interface IBank : INamed
Properties
Areas
Returns registry of named bank schema area instances
Declaration
IRegistry<IAreaInstance> Areas { get; }
Property Value
| Type | Description |
|---|---|
| IRegistry<IAreaInstance> |
DataStore
References data store that this data bank is a part of
Declaration
IDistributedDataStore DataStore { get; }
Property Value
| Type | Description |
|---|---|
| IDistributedDataStore |
Description
Returns database description
Declaration
string Description { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
IDGenerator
Returns sequence provider that generates unique identifiers in the store
Declaration
IGDIDProvider IDGenerator { get; }
Property Value
| Type | Description |
|---|---|
| IGDIDProvider |
Schema
Returns the schema that this bank implements
Declaration
ISchema Schema { get; }
Property Value
| Type | Description |
|---|---|
| ISchema |
Methods
GenerateReplicationVersionInfo(Parcel)
Generates version replication information for the parcel instance which is being sealed
Declaration
IReplicationVersionInfo GenerateReplicationVersionInfo(Parcel parcel)
Parameters
| Type | Name | Description |
|---|---|---|
| Parcel | parcel |
Returns
| Type | Description |
|---|---|
| IReplicationVersionInfo |
GetDescription(String)
Returns database description for the specific culture. This method is needed because end users may need to see the description of the database instance in their native language
Declaration
string GetDescription(string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | culture |
Returns
| Type | Description |
|---|---|
| System.String |
Load(Type, GDID, Object, DataVeracity, DataCaching, Nullable<Int32>, ISession)
Loads parcel by fetching it from the bank backened by its primary id
Declaration
Parcel Load(Type tParcel, GDID id, object shardingID = null, DataVeracity veracity = DataVeracity.Maximum, DataCaching cacheOpt = DataCaching.LatestData, int ? cacheMaxAgeSec = default (int ? ), ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | tParcel | Parcel type to load |
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.GetParcelAttr(typeof(T)).ShardingParcel |
| DataVeracity | veracity | The level of data veracity |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cacheMaxAgeSec | The maximum acceptable age of cached instance, cached data will be re-queried from backend if it is older |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| Parcel |
Load<T>(GDID, Object, DataVeracity, DataCaching, Nullable<Int32>, ISession)
Loads parcel by fetching it from the bank backened by its primary id
Declaration
T Load<T>(GDID id, object shardingID = null, DataVeracity veracity = DataVeracity.Maximum, DataCaching cacheOpt = DataCaching.LatestData, int ? cacheMaxAgeSec = default (int ? ), ISession session = null)where T : Parcel
Parameters
| Type | Name | Description |
|---|---|---|
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.GetParcelAttr(typeof(T)).ShardingParcel |
| DataVeracity | veracity | The level of data veracity |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cacheMaxAgeSec | The maximum acceptable age of cached instance, cached data will be re-queried from backend if it is older |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
LoadAsync(Type, GDID, Object, DataVeracity, DataCaching, Nullable<Int32>, ISession)
Async version: Loads parcel by fetching it from the bank backened by its primary id
Declaration
Task<Parcel> LoadAsync(Type tParcel, GDID id, object shardingID = null, DataVeracity veracity = DataVeracity.Maximum, DataCaching cacheOpt = DataCaching.LatestData, int ? cacheMaxAgeSec = default (int ? ), ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | tParcel | Parcel type to load |
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.GetParcelAttr(typeof(T)).ShardingParcel |
| DataVeracity | veracity | The level of data veracity |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cacheMaxAgeSec | The maximum acceptable age of cached instance, cached data will be re-queried from backend if it is older |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Parcel> |
LoadAsync<T>(GDID, Object, DataVeracity, DataCaching, Nullable<Int32>, ISession)
Async version: Loads parcel by fetching it from the bank backened by its primary id
Declaration
Task<T> LoadAsync<T>(GDID id, object shardingID = null, DataVeracity veracity = DataVeracity.Maximum, DataCaching cacheOpt = DataCaching.LatestData, int ? cacheMaxAgeSec = default (int ? ), ISession session = null)where T : Parcel
Parameters
| Type | Name | Description |
|---|---|---|
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.GetParcelAttr(typeof(T)).ShardingParcel |
| DataVeracity | veracity | The level of data veracity |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cacheMaxAgeSec | The maximum acceptable age of cached instance, cached data will be re-queried from backend if it is older |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
ObjectToShardingID(Object)
Returns ULONG for an object so any object (i.e. a string) may be used as a sharding key. Suppose a string needs to be used for sharding, this method translates a string into a 64 bit hash expressed as ulong
Declaration
ulong ObjectToShardingID(object key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | key | An object used for sharding ID translation |
Returns
| Type | Description |
|---|---|
| System.UInt64 | UInt64 that represents the sharding ID |
Query(Command, DataVeracity, DataCaching, Nullable<Int32>, ISession)
Loads result object by executing a query command in the bank backend fetching necessary parcels/records/documents and aggregating the result. The query may return parcel/s that can be modified and saved back into the store
Declaration
object Query(Command command, DataVeracity veracity = DataVeracity.Maximum, DataCaching cacheOpt = DataCaching.LatestData, int ? cacheMaxAgeSec = default (int ? ), ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | command | The command object that contains command name and parameters to query the datastore |
| DataVeracity | veracity | The level of data veracity |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cacheMaxAgeSec | The maximum acceptable age of cached instance, cached data will be re-queried from backend if it is older |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Object |
QueryAsync(Command, DataVeracity, DataCaching, Nullable<Int32>, ISession)
Async version: Loads result object by executing a query command in the bank backend fetching necessary parcels/records/documents and aggregating the result. The query may return parcel/s that can be modified and saved back into the store
Declaration
Task<object> QueryAsync(Command command, DataVeracity veracity = DataVeracity.Maximum, DataCaching cacheOpt = DataCaching.LatestData, int ? cacheMaxAgeSec = default (int ? ), ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Command | command | The command object that contains command name and parameters to query the datastore |
| DataVeracity | veracity | The level of data veracity |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cacheMaxAgeSec | The maximum acceptable age of cached instance, cached data will be re-queried from backend if it is older |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Object> |
Remove(Type, GDID, Object, ISession)
Removes the parcel from the bank returning true if parcel was found and removed
Declaration
bool Remove(Type tParcel, GDID id, object shardingID = null, ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | tParcel | Type of parcel to remove |
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.ShardingParcel |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remove<T>(GDID, Object, ISession)
Removes the parcel from the bank returning true if parcel was found and removed
Declaration
bool Remove<T>(GDID id, object shardingID = null, ISession session = null)where T : Parcel
Parameters
| Type | Name | Description |
|---|---|---|
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.ShardingParcel |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Type Parameters
| Name | Description |
|---|---|
| T |
RemoveAsync(Type, GDID, Object, ISession)
Async version: Removes the parcel from the bank returning true if parcel was found and removed
Declaration
Task<bool> RemoveAsync(Type tParcel, GDID id, object shardingID = null, ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | tParcel | Type of parcel to remove |
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.ShardingParcel |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> |
RemoveAsync<T>(GDID, Object, ISession)
Async version: Removes the parcel from the bank returning true if parcel was found and removed
Declaration
Task<bool> RemoveAsync<T>(GDID id, object shardingID = null, ISession session = null)where T : Parcel
Parameters
| Type | Name | Description |
|---|---|---|
| GDID | id | The unique GDID of the parcel |
| System.Object | shardingID | The ID of the entity used for sharding, i.e. a message may use ID of the item that the message relates to, so messages get sharded in the same location as their "parent" record. The parcel type T specifies the DataParcelAttirbute.ShardingParcel |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> |
Type Parameters
| Name | Description |
|---|---|
| T |
Save(Parcel, DataCaching, Nullable<Int32>, Nullable<Int32>, Nullable<DateTime>, ISession)
Saves/sends the parcel into this bank
Declaration
void Save(Parcel parcel, DataCaching cacheOpt = DataCaching.Everywhere, int ? cachePriority = default (int ? ), int ? cacheMaxAgeSec = default (int ? ), DateTime? cacheAbsoluteExpirationUTC = default (DateTime? ), ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Parcel | parcel | parcel instance to save |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cachePriority | The relative priority of the item in cache. If null is passed then the value is obtained from the parcel instance |
| System.Nullable<System.Int32> | cacheMaxAgeSec | Specifies the duration of parcel lifespan in cache devices. If null is passed then the value is obtained from the parcel instance |
| System.Nullable<System.DateTime> | cacheAbsoluteExpirationUTC | Specifies absolute expiration time for this parcel instance in cache. If null is passed then the value is obtained from the parcel instance |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
SaveAsync(Parcel, DataCaching, Nullable<Int32>, Nullable<Int32>, Nullable<DateTime>, ISession)
Async version: Saves/sends the parcel into this bank
Declaration
Task SaveAsync(Parcel parcel, DataCaching cacheOpt = DataCaching.Everywhere, int ? cachePriority = default (int ? ), int ? cacheMaxAgeSec = default (int ? ), DateTime? cacheAbsoluteExpirationUTC = default (DateTime? ), ISession session = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Parcel | parcel | parcel instance to save |
| DataCaching | cacheOpt | The cache control options |
| System.Nullable<System.Int32> | cachePriority | The relative priority of the item in cache. If null is passed then the value is obtained from the parcel instance |
| System.Nullable<System.Int32> | cacheMaxAgeSec | Specifies the duration of parcel lifespan in cache devices. If null is passed then the value is obtained from the parcel instance |
| System.Nullable<System.DateTime> | cacheAbsoluteExpirationUTC | Specifies absolute expiration time for this parcel instance in cache. If null is passed then the value is obtained from the parcel instance |
| ISession | session | User session, if null session will be taken from execution context. The session may be needed for policy filtering |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |