本文整理了Java中org.neo4j.kernel.configuration.Config.enabledHttpConnectors()
方法的一些代码示例,展示了Config.enabledHttpConnectors()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.enabledHttpConnectors()
方法的具体详情如下:
包路径:org.neo4j.kernel.configuration.Config
类名称:Config
方法名:enabledHttpConnectors
暂无
代码示例来源:origin: neo4j/neo4j
/**
* @return list of all configured http connectors which are enabled
*/
@Nonnull
public List<HttpConnector> enabledHttpConnectors()
{
return enabledHttpConnectors( params );
}
代码示例来源:origin: neo4j/neo4j
private static HttpConnector findConnector( Config config, Encryption encryption )
{
return config.enabledHttpConnectors()
.stream()
.filter( connector -> connector.encryptionLevel() == encryption )
.findFirst()
.orElse( null );
}
代码示例来源:origin: neo4j/neo4j
private Optional<URI> httpConnectorUri( String scheme, Encryption encryption )
{
return server.getConfig()
.enabledHttpConnectors()
.stream()
.filter( connector -> connector.encryptionLevel() == encryption )
.findFirst()
.map( connector -> connectorUri( scheme, connector ) );
}
代码示例来源:origin: neo4j/neo4j
private NeoServer createNeoServer( Config config, GraphDatabaseDependencies dependencies )
{
GraphFactory graphFactory = createGraphFactory( config );
boolean httpAndHttpsDisabled = config.enabledHttpConnectors().isEmpty();
if ( httpAndHttpsDisabled )
{
return new DisabledNeoServer( graphFactory, dependencies, config );
}
return createNeoServer( graphFactory, config, dependencies );
}
代码示例来源:origin: neo4j/neo4j
@Test
void shouldBeAbleToOverrideHttpListenAddressWithJustOneParameter()
{
// given
Config config = Config.defaults( stringMap(
"dbms.connector.http.enabled", "true",
"dbms.connector.http.listen_address", ":8000" ) );
// then
assertEquals( 1, config.enabledHttpConnectors().size() );
HttpConnector httpConnector = config.enabledHttpConnectors().get( 0 );
assertEquals( new ListenSocketAddress( "127.0.0.1", 8000 ),
config.get( httpConnector.listen_address ) );
}
代码示例来源:origin: neo4j/neo4j
@Test
void shouldBeAbleToOverrideHttpsListenAddressWithJustOneParameter()
{
// given
Config config = Config.defaults( stringMap(
"dbms.connector.https.enabled", "true",
"dbms.connector.https.listen_address", ":8000" ) );
// then
assertEquals( 1, config.enabledHttpConnectors().size() );
HttpConnector httpConnector = config.enabledHttpConnectors().get( 0 );
assertEquals( new ListenSocketAddress( "127.0.0.1", 8000 ),
config.get( httpConnector.listen_address ) );
}
代码示例来源:origin: neo4j/neo4j
@Test
void shouldStillSupportCustomNameForHttpConnector()
{
Config config = Config.defaults( stringMap(
"dbms.connector.random_name_that_will_be_unsupported.type", "HTTP",
"dbms.connector.random_name_that_will_be_unsupported.encryption", "NONE",
"dbms.connector.random_name_that_will_be_unsupported.enabled", "true",
"dbms.connector.random_name_that_will_be_unsupported.listen_address", ":8000" ) );
// then
assertEquals( 1, config.enabledHttpConnectors().size() );
assertEquals( new ListenSocketAddress( "127.0.0.1", 8000 ),
config.get( config.enabledHttpConnectors().get( 0 ).listen_address ) );
}
代码示例来源:origin: neo4j/neo4j
@Test
void shouldStillSupportCustomNameForHttpsConnector()
{
Config config = Config.defaults( stringMap(
"dbms.connector.random_name_that_will_be_unsupported.type", "HTTP",
"dbms.connector.random_name_that_will_be_unsupported.encryption", "TLS",
"dbms.connector.random_name_that_will_be_unsupported.enabled", "true",
"dbms.connector.random_name_that_will_be_unsupported.listen_address", ":9000" ) );
// then
assertEquals( 1, config.enabledHttpConnectors().size() );
assertEquals( new ListenSocketAddress( "127.0.0.1", 9000 ),
config.get( config.enabledHttpConnectors().get( 0 ).listen_address ) );
}
代码示例来源:origin: neo4j/neo4j
@Test
void shouldBeAbleToDisableHttpConnectorWithJustOneParameter()
{
// given
Config disableHttpConfig = Config.defaults(
stringMap( "dbms.connector.http.enabled", "false",
"dbms.connector.https.enabled", "false" ) );
// then
assertTrue( disableHttpConfig.enabledHttpConnectors().isEmpty() );
assertEquals( 2, disableHttpConfig.httpConnectors().size() );
}
代码示例来源:origin: neo4j/neo4j
@Test
void shouldDeriveListenAddressFromDefaultListenAddress()
{
// given
Config config = Config.fromSettings( stringMap( "dbms.connector.https.enabled", "true",
"dbms.connector.http.enabled", "true",
"dbms.connectors.default_listen_address", "0.0.0.0" ) ).withServerDefaults().build();
// then
assertEquals( 2, config.enabledHttpConnectors().size() );
config.enabledHttpConnectors().forEach( c ->
assertEquals( "0.0.0.0", config.get( c.listen_address ).getHostname() ) );
}
代码示例来源:origin: neo4j/neo4j
boolean httpAndHttpsDisabled = dbConfig.enabledHttpConnectors().isEmpty();
代码示例来源:origin: neo4j/neo4j
@Test
void shouldDeriveListenAddressFromDefaultListenAddressAndSpecifiedPorts()
{
// given
Config config = Config.defaults( stringMap( "dbms.connector.https.enabled", "true",
"dbms.connector.http.enabled", "true",
"dbms.connectors.default_listen_address", "0.0.0.0",
"dbms.connector.http.listen_address", ":8000",
"dbms.connector.https.listen_address", ":9000" ) );
// then
assertEquals( 2, config.enabledHttpConnectors().size() );
config.enabledHttpConnectors().forEach( c ->
{
if ( c.key().equals( "https" ) )
{
assertEquals( new ListenSocketAddress( "0.0.0.0", 9000 ),
config.get( c.listen_address ) );
}
else
{
assertEquals( new ListenSocketAddress( "0.0.0.0", 8000 ),
config.get( c.listen_address ) );
}
}
);
}
代码示例来源:origin: org.neo4j/neo4j-kernel
/**
* @return list of all configured http connectors which are enabled
*/
@Nonnull
public List<HttpConnector> enabledHttpConnectors()
{
return enabledHttpConnectors( params );
}
代码示例来源:origin: org.neo4j.app/neo4j-server
private static HttpConnector findConnector( Config config, Encryption encryption )
{
return config.enabledHttpConnectors()
.stream()
.filter( connector -> connector.encryptionLevel() == encryption )
.findFirst()
.orElse( null );
}
代码示例来源:origin: org.neo4j.test/neo4j-harness
private Optional<URI> httpConnectorUri( String scheme, Encryption encryption )
{
return server.getConfig()
.enabledHttpConnectors()
.stream()
.filter( connector -> connector.encryptionLevel() == encryption )
.findFirst()
.map( connector -> connectorUri( scheme, connector ) );
}
代码示例来源:origin: org.neo4j.app/neo4j-server
private NeoServer createNeoServer( Config config, GraphDatabaseDependencies dependencies )
{
GraphFactory graphFactory = createGraphFactory( config );
boolean httpAndHttpsDisabled = config.enabledHttpConnectors().isEmpty();
if ( httpAndHttpsDisabled )
{
return new DisabledNeoServer( graphFactory, dependencies, config );
}
return createNeoServer( graphFactory, config, dependencies );
}
代码示例来源:origin: org.neo4j/neo4j-causal-clustering
static ClientConnectorAddresses extractFromConfig( Config config )
{
List<ConnectorUri> connectorUris = new ArrayList<>();
List<BoltConnector> boltConnectors = config.enabledBoltConnectors();
if ( boltConnectors.isEmpty() )
{
throw new IllegalArgumentException( "A Bolt connector must be configured to run a cluster" );
}
boltConnectors
.forEach( c -> connectorUris.add( new ConnectorUri( bolt, config.get( c.advertised_address ) ) ) );
config.enabledHttpConnectors()
.forEach( c -> connectorUris.add( new ConnectorUri( Encryption.NONE.equals(c.encryptionLevel() ) ?
http : https, config.get( c.advertised_address ) ) ) );
return new ClientConnectorAddresses( connectorUris );
}
代码示例来源:origin: org.neo4j.test/neo4j-harness
boolean httpAndHttpsDisabled = dbConfig.enabledHttpConnectors().isEmpty();
内容来源于网络,如有侵权,请联系作者删除!