Data Archiving Service

IDataArchiveService in assembly SanteDB.Core.Api version 2.1.151.0

Summary

Service contract for data archival and purging

Description

The data archive service is used by various jobs throughout SanteDB iCDR (such as the DataRetentionJob) to copy records which are past their retention rules to a secondary data storage facility. This service can be used for long-term archival of old (non-clinically relevant data) data and supports the purging of data which is no longer needed.

Operations

OperationResponse/ReturnInput/ParameterDescription

Archive

void

Type modelType Guid[] keysToBeArchived

Push the specified records to the archive

Retrieve

IdentifiedData

Type modelType Guid keyToRetrieve

Retrieve a record from the archive by key and type

Exists

Boolean

Type modelType Guid keyToCheck

Validates whether the specified key exists in the archive

Purge

void

Type modelType Guid[] keysToBePurged

Purge the specified object from the archive

Implementations

ADO.NET Archiving and Data Shipping - (SanteDB.Persistence.Data.ADO)

The AdoArchiveService is an archival service which stores data in a secondary database

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Persistence.Data.ADO.Services.AdoArchiveService, SanteDB.Persistence.Data.ADO, Version=2.1.151.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

Example Implementation

/// Example Implementation
using SanteDB.Core.Services;
/// Other usings here
public class MyDataArchiveService : SanteDB.Core.Services.IDataArchiveService { 
	public String ServiceName => "My own IDataArchiveService service";
	/// <summary>
	/// Push the specified records to the archive
	/// </summary>
	public void Archive(Type modelType,Guid[] keysToBeArchived){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Retrieve a record from the archive by key and type
	/// </summary>
	public IdentifiedData Retrieve(Type modelType,Guid keyToRetrieve){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Validates whether the specified key exists in the archive
	/// </summary>
	public Boolean Exists(Type modelType,Guid keyToCheck){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Purge the specified object from the archive
	/// </summary>
	public void Purge(Type modelType,Guid[] keysToBePurged){
		throw new System.NotImplementedException();
	}
}

References

Last updated