Ejemplo n.º 1
0
 internal SecurityModuleDependenciesDependencies(PlatformModule platformModule, AbstractEditionModule editionModule, Procedures procedures)
 {
     this._platformModule = platformModule;
     this._editionModule  = editionModule;
     this._procedures     = procedures;
 }
Ejemplo n.º 2
0
        protected internal static SecurityModule SetupSecurityModule(PlatformModule platformModule, AbstractEditionModule editionModule, Log log, Procedures procedures, string key)
        {
            SecurityModule.Dependencies  securityModuleDependencies = new SecurityModuleDependenciesDependencies(platformModule, editionModule, procedures);
            IEnumerable <SecurityModule> candidates = Service.load(typeof(SecurityModule));

            foreach (SecurityModule candidate in candidates)
            {
                if (candidate.Matches(key))
                {
                    try
                    {
                        candidate.Setup(securityModuleDependencies);
                        return(candidate);
                    }
                    catch (Exception e)
                    {
                        string errorMessage      = "Failed to load security module.";
                        string innerErrorMessage = e.Message;

                        if (!string.ReferenceEquals(innerErrorMessage, null))
                        {
                            log.Error(errorMessage + " Caused by: " + innerErrorMessage, e);
                        }
                        else
                        {
                            log.Error(errorMessage, e);
                        }
                        throw new Exception(errorMessage, e);
                    }
                }
            }
            string errorMessage = "Failed to load security module with key '" + key + "'.";

            log.Error(errorMessage);
            throw new System.ArgumentException(errorMessage);
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldFailWhenAuthEnabledAndNoSecurityModuleFound()
        internal virtual void ShouldFailWhenAuthEnabledAndNoSecurityModuleFound()
        {
            System.ArgumentException argumentException = assertThrows(typeof(System.ArgumentException), () => AbstractEditionModule.SetupSecurityModule(null, null, mock(typeof(Log)), null, "non-existent-security-module"));
            assertEquals("Failed to load security module with key 'non-existent-security-module'.", argumentException.Message);
        }
Ejemplo n.º 4
0
 public virtual DatabaseManager CreateDatabaseManager(GraphDatabaseFacade graphDatabaseFacade, PlatformModule platform, AbstractEditionModule edition, Procedures procedures, Logger msgLog)
 {
     return(new DefaultDatabaseManager(platform, edition, procedures, msgLog, graphDatabaseFacade));
 }