Class RemoteProvider
Remote provider.
Inheritance
Implements
Inherited Members
Namespace: Terrasoft.Sync
Assembly: Terrasoft.Sync.dll
Syntax
public abstract class RemoteProvider : ISyncProvider<IRemoteItem>
Constructors
RemoteProvider()
Declaration
protected RemoteProvider()
RemoteProvider(ILog)
Declaration
protected RemoteProvider(ILog log)
Parameters
Type | Name | Description |
---|---|---|
ILog | log |
Fields
PageElementsCount
Declaration
protected const int PageElementsCount = 0
Field Value
Type | Description |
---|---|
System.Int32 |
PageNumber
Declaration
protected int PageNumber
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
LocalChangesCount
Count number of elements that were imported from local storage.
Declaration
public virtual int LocalChangesCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Log
The object to write to the system log.
Declaration
protected ILog Log { get; }
Property Value
Type | Description |
---|---|
ILog |
OperationErrorLczStrings
Localized error strings to export messages to an external storage
Declaration
protected static Dictionary<SyncAction, LocalizableString> OperationErrorLczStrings { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<SyncAction, LocalizableString> |
OperationInfoLczStrings
Localized info strings to export messages to an external storage.
Declaration
protected static Dictionary<SyncAction, LocalizableString> OperationInfoLczStrings { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<SyncAction, LocalizableString> |
RemoteChangesCount
Count number of elements that were imported from external storage.
Declaration
public virtual int RemoteChangesCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
SessionInfo
Session information.
Declaration
public virtual string SessionInfo { get; }
Property Value
Type | Description |
---|---|
System.String |
StoreId
Remote store identifier.
Declaration
public abstract Guid StoreId { get; }
Property Value
Type | Description |
---|---|
System.Guid |
SyncItemSchemaCollection
Collection schemes setting of remote storage.
Declaration
public List<SyncItemSchema> SyncItemSchemaCollection { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<SyncItemSchema> |
UseMetadata
Metadata storage usage flag.
Declaration
public virtual bool UseMetadata { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Version
Date and time of synchronization. It contains the end date of the last synchronization.
Declaration
public virtual DateTime Version { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
Methods
ApplyChanges(SyncContext, IRemoteItem)
Migrate the changes from local to remote storage.
Declaration
public abstract void ApplyChanges(SyncContext context, IRemoteItem syncItem)
Parameters
Type | Name | Description |
---|---|---|
SyncContext | context | Synchronization context. |
IRemoteItem | syncItem | Item of the synchronization. |
CollectNewItems(SyncContext)
Returns an enumerator new elements to synchronize the local store.
Declaration
public abstract IEnumerable<LocalItem> CollectNewItems(SyncContext context)
Parameters
Type | Name | Description |
---|---|---|
SyncContext | context | Synchronization context. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<LocalItem> | The enumerator elements of local storage synchronization. |
CommitChanges(SyncContext)
Commit changes.
Declaration
public abstract void CommitChanges(SyncContext context)
Parameters
Type | Name | Description |
---|---|---|
SyncContext | context | Synchronization context. |
CreateNewSyncItem(SyncItemSchema)
Returns remote item synchronized for a given element.
Declaration
public abstract IRemoteItem CreateNewSyncItem(SyncItemSchema schema)
Parameters
Type | Name | Description |
---|---|---|
SyncItemSchema | schema | Schema. |
Returns
Type | Description |
---|---|
IRemoteItem | Created instance of IRemoteItem. |
EnumerateChanges(SyncContext)
Returns an enumerator elements to synchronize the remote store.
Declaration
public abstract IEnumerable<IRemoteItem> EnumerateChanges(SyncContext context)
Parameters
Type | Name | Description |
---|---|---|
SyncContext | context | Synchronization context. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IRemoteItem> | The enumerator elements of remote storage synchronization. |
FindSchemaBySyncValueName(String)
Searches the synchronized scheme on the name of the entity type.
Declaration
protected SyncItemSchema FindSchemaBySyncValueName(string syncValueName)
Parameters
Type | Name | Description |
---|---|---|
System.String | syncValueName | Synchronization scheme name. |
Returns
Type | Description |
---|---|
SyncItemSchema | Found synchronization scheme or |
GetLocallyModifiedItemsMetadata(SyncContext, EntitySchemaQuery)
It returns an enumerator metadata synchronization objects that have been changed in the local store with the last synchronization date.
Declaration
public virtual IEnumerable<ItemMetadata> GetLocallyModifiedItemsMetadata(SyncContext context, EntitySchemaQuery modifiedItemsEsq)
Parameters
Type | Name | Description |
---|---|---|
SyncContext | context | Synchronization Context. |
EntitySchemaQuery | modifiedItemsEsq | Request to the scheme object SysSyncMetaData. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ItemMetadata> | The enumerator object synchronization of external data storage. |
GetNumberPageElements(SyncContext)
Returns the number of elements to be processed in the BPM in a single page.
Declaration
public virtual int GetNumberPageElements(SyncContext context)
Parameters
Type | Name | Description |
---|---|---|
SyncContext | context | Synchronization context. |
Returns
Type | Description |
---|---|
System.Int32 | Number of elements. |
KnownTypes()
Gets the types of all types of external synchronization elements. The order type determines the order in which items are synced.
Declaration
public abstract IEnumerable<Type> KnownTypes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Type> |
LoadSyncItem(SyncItemSchema, String)
Returns the external data repository synchronization object by a unique foreign key.
Declaration
public abstract IRemoteItem LoadSyncItem(SyncItemSchema schema, string id)
Parameters
Type | Name | Description |
---|---|---|
SyncItemSchema | schema | Schema. |
System.String | id | Unique foreign key. |
Returns
Type | Description |
---|---|
IRemoteItem | Created instance of IRemoteItem. |
LoadSyncItem(SyncItemSchema, ItemMetadata)
Returns synchronization object by value of metadata .
Declaration
public virtual IRemoteItem LoadSyncItem(SyncItemSchema schema, ItemMetadata itemMetadata)
Parameters
Type | Name | Description |
---|---|---|
SyncItemSchema | schema | Synchronization schema. |
ItemMetadata | itemMetadata | Synchronization metadata. |
Returns
Type | Description |
---|---|
IRemoteItem | Synchronization object.IRemoteItem. |
LogError(String, Exception, Object[])
Writes error message to the log, including information about the exception that caused this error.
Declaration
public virtual void LogError(string format, Exception exception, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | Format string with an informational message. |
System.Exception | exception | Exception. |
System.Object[] | args | Message format. |
LogError(String, Object[])
Writes error message to the log.
Declaration
protected virtual void LogError(string format, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | Format string with an informational message. |
System.Object[] | args | Message format. |
LogInfo(String, Object[])
Writes information message to the log.
Declaration
protected virtual void LogInfo(string format, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | Format string with an informational message. |
System.Object[] | args | Message format. |
NeedMetaDataActualization()
Returns a flag that requires actualized metadata.
Declaration
public virtual bool NeedMetaDataActualization()
Returns
Type | Description |
---|---|
System.Boolean |
RealeaseItem(ref IRemoteItem)
Releases remoteItem
from enumerator.
Declaration
public virtual void RealeaseItem(ref IRemoteItem remoteItem)
Parameters
Type | Name | Description |
---|---|---|
IRemoteItem | remoteItem | Remote item. |
ResolveConflict(IRemoteItem, ItemMetadata, Guid)
It resolves conflicts between the versions of the element of local and external storage.
Declaration
public virtual SyncConflictResolution ResolveConflict(IRemoteItem syncItem, ItemMetadata itemMetaData, Guid localStoreId)
Parameters
Type | Name | Description |
---|---|---|
IRemoteItem | syncItem | |
ItemMetadata | itemMetaData | |
System.Guid | localStoreId |
Returns
Type | Description |
---|---|
SyncConflictResolution | The result of the resolution of conflict. |
Remarks
It is believed that the latter was a change in the local storage if the at least one item was changed later than in the external storage - the priority changes from the local store.