Esempio n. 1
0
        /// <summary>
        /// Data policy filter service with DI
        /// </summary>
        public DataPolicyFilterService(IConfigurationManager configurationManager, IPasswordHashingService passwordService, IPolicyDecisionService pdpService, IThreadPoolService threadPoolService,
                                       IDataCachingService dataCachingService, ISubscriptionExecutor subscriptionExecutor = null, IAdhocCacheService adhocCache = null)
        {
            this.m_hasher               = passwordService;
            this.m_adhocCache           = adhocCache;
            this.m_pdpService           = pdpService;
            this.m_subscriptionExecutor = subscriptionExecutor;
            this.m_dataCachingService   = dataCachingService;
            this.m_threadPool           = threadPoolService;

            // Configuration load
            this.m_configuration = configurationManager.GetSection <DataPolicyFilterConfigurationSection>();

            if (this.m_configuration == null)
            {
                this.m_tracer.TraceWarning("No data policy configuration exists. Setting all to HIDE");
                this.m_configuration = new DataPolicyFilterConfigurationSection()
                {
                    DefaultAction = ResourceDataPolicyActionType.Hide, Resources = new List <ResourceDataPolicyFilter>()
                };
            }

            if (this.m_configuration.Resources != null)
            {
                foreach (var t in this.m_configuration.Resources)
                {
                    if (typeof(Act).IsAssignableFrom(t.ResourceType.Type) || typeof(Entity).IsAssignableFrom(t.ResourceType.Type) || typeof(AssigningAuthority).IsAssignableFrom(t.ResourceType.Type))
                    {
                        this.m_tracer.TraceInfo("Binding privacy action {0} to {1}", t.Action, t.ResourceType.Type);
                        this.m_actions.TryAdd(t.ResourceType.Type, t);
                    }
                }
            }
        }
 /// <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>
 /// Creates a new instance with DI
 /// </summary>
 public ExemptablePolicyFilterService(IConfigurationManager configManager, IPasswordHashingService passwordService, IPolicyDecisionService pdpService, IThreadPoolService threadPoolService, IDataCachingService dataCachingService, IAdhocCacheService adhocCache = null, ISubscriptionExecutor subscriptionExecutor = null)
     : base(configManager, passwordService, pdpService, threadPoolService, dataCachingService, subscriptionExecutor, adhocCache)
 {
 }