Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: AbstractRESTInteraction(java.util.Map<String,String> config) throws java.io.IOException
        internal AbstractRESTInteraction(IDictionary <string, string> config)
        {
            CommunityServerBuilder builder = EnterpriseServerBuilder.serverOnRandomPorts();

            builder = builder.WithProperty((new BoltConnector("bolt")).type.name(), "BOLT").withProperty((new BoltConnector("bolt")).enabled.name(), "true").withProperty((new BoltConnector("bolt")).encryption_level.name(), OPTIONAL.name()).withProperty(LegacySslPolicyConfig.tls_key_file.name(), NeoInteractionLevel.tempPath("key", ".key")).withProperty(LegacySslPolicyConfig.tls_certificate_file.name(), NeoInteractionLevel.tempPath("cert", ".cert")).withProperty(GraphDatabaseSettings.auth_enabled.name(), Convert.ToString(true));

            foreach (KeyValuePair <string, string> entry in config.SetOfKeyValuePairs())
            {
                builder = builder.WithProperty(entry.Key, entry.Value);
            }
            this.Server = builder.Build();
            this.Server.start();
            _authManager           = this.Server.DependencyResolver.resolveDependency(typeof(EnterpriseAuthManager));
            _connectorPortRegister = Server.DependencyResolver.resolveDependency(typeof(ConnectorPortRegister));
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private CommunityNeoServer buildServer(String hstsValue) throws Exception
        private CommunityNeoServer BuildServer(string hstsValue)
        {
            CommunityServerBuilder builder = serverOnRandomPorts().withHttpsEnabled().usingDataDir(Folder.directory(Name.MethodName).AbsolutePath);

            if (!string.ReferenceEquals(hstsValue, null))
            {
                builder.WithProperty(ServerSettings.http_strict_transport_security.name(), hstsValue);
            }

            return(builder.Build());
        }