/// <summary> /// Existing match service /// </summary> public MdmRecordMatchingService(IDataPersistenceService <AssigningAuthority> authorityService, IDataPersistenceService <Bundle> bundleService, IDataPersistenceService <EntityRelationship> erService, IDataPersistenceService <ActRelationship> arService, IRecordMatchingService existingMatchService = null) { this.m_matchService = existingMatchService; this.m_erService = erService; this.m_arService = arService; this.m_uniqueAuthorities = authorityService.Query(o => o.IsUnique, AuthenticationContext.SystemPrincipal).Select(o => o.Key.Value).ToList(); bundleService.Inserted += (o, e) => { foreach (var i in e.Data.Item.OfType <AssigningAuthority>()) { if (i.BatchOperation == BatchOperationType.Delete || i.ObsoletionTime.HasValue) { this.m_uniqueAuthorities.Remove(i.Key.Value); } else if (i.IsUnique) { this.m_uniqueAuthorities.Add(i.Key.Value); } } }; authorityService.Inserted += (o, e) => { if (e.Data.IsUnique) { this.m_uniqueAuthorities.Add(e.Data.Key.Value); } }; authorityService.Obsoleted += (o, e) => { this.m_uniqueAuthorities.Remove(e.Data.Key.Value); }; }
/// <summary> /// Creates a new resource merger with specified configuration /// </summary> public SimResourceMerger() { // Find the specified matching configuration this.m_matchingService = ApplicationServiceContext.Current.GetService <IRecordMatchingService>(); this.m_matchingConfigurationService = ApplicationServiceContext.Current.GetService <IRecordMatchingConfigurationService>(); ApplicationServiceContext.Current.GetService <IDataPersistenceService <TModel> >().Inserting += DataInsertingHandler; ApplicationServiceContext.Current.GetService <IDataPersistenceService <TModel> >().Updating += DataUpdatingHandler; }
/// <summary> /// Create injected service /// </summary> public MdmDataManagementService(IServiceManager serviceManager, IConfigurationManager configuration, IDataCachingService cachingService = null, IRecordMatchingConfigurationService matchConfigurationService = null, IRecordMatchingService matchingService = null, ISubscriptionExecutor subscriptionExecutor = null, SimDataManagementService simDataManagementService = null, IJobManagerService jobManagerService = null) { this.m_configuration = configuration.GetSection <ResourceManagementConfigurationSection>(); this.m_matchingService = matchingService; this.m_serviceManager = serviceManager; this.m_subscriptionExecutor = subscriptionExecutor; this.m_jobManager = jobManagerService; this.m_matchConfigurationService = matchConfigurationService; this.m_dataCachingService = cachingService; if (simDataManagementService != null) { throw new InvalidOperationException("Cannot run MDM and SIM in same mode"); } }
/// <summary> /// Matching service /// </summary> public MatchOperation(IRecordMatchingService matchingService = null, IRecordMatchingConfigurationService matchConfigService = null) { this.m_matchingService = matchingService; this.m_matchConfiguration = matchConfigService; }
/// <summary> /// Create a new match configuration operation /// </summary> public TestMatchConfigurationOperation(IRecordMatchingConfigurationService configService = null, IRecordMatchingService matchingService = null, IMatchReportFactory matchReportFactory = null) { this.m_configService = configService; this.m_matchingService = matchingService; this.m_matchReportFactory = matchReportFactory; }