public final class DatabaseDiscoveryRule extends Object implements org.apache.shardingsphere.infra.rule.level.FeatureRule, org.apache.shardingsphere.infra.rule.scope.SchemaRule, org.apache.shardingsphere.infra.rule.type.DataSourceContainedRule, org.apache.shardingsphere.infra.rule.type.StatusContainedRule
| Constructor and Description |
|---|
DatabaseDiscoveryRule(AlgorithmProvidedDatabaseDiscoveryRuleConfiguration config,
org.apache.shardingsphere.infra.database.type.DatabaseType databaseType,
Map<String,DataSource> dataSourceMap,
String schemaName) |
DatabaseDiscoveryRule(DatabaseDiscoveryRuleConfiguration config,
org.apache.shardingsphere.infra.database.type.DatabaseType databaseType,
Map<String,DataSource> dataSourceMap,
String schemaName) |
| Modifier and Type | Method and Description |
|---|---|
Optional<DatabaseDiscoveryDataSourceRule> |
findDataSourceRule(String dataSourceName)
Find data source rule.
|
Collection<String> |
getAllLogicDataSourceNames()
Get all logic data source names.
|
Map<String,Collection<String>> |
getDataSourceMapper() |
DatabaseDiscoveryDataSourceRule |
getSingleDataSourceRule()
Get single data source rule.
|
void |
updateRuleStatus(org.apache.shardingsphere.infra.rule.event.RuleChangedEvent event) |
public DatabaseDiscoveryRule(DatabaseDiscoveryRuleConfiguration config, org.apache.shardingsphere.infra.database.type.DatabaseType databaseType, Map<String,DataSource> dataSourceMap, String schemaName)
public DatabaseDiscoveryRule(AlgorithmProvidedDatabaseDiscoveryRuleConfiguration config, org.apache.shardingsphere.infra.database.type.DatabaseType databaseType, Map<String,DataSource> dataSourceMap, String schemaName)
public Collection<String> getAllLogicDataSourceNames()
public DatabaseDiscoveryDataSourceRule getSingleDataSourceRule()
public Optional<DatabaseDiscoveryDataSourceRule> findDataSourceRule(String dataSourceName)
dataSourceName - data source namepublic Map<String,Collection<String>> getDataSourceMapper()
getDataSourceMapper in interface org.apache.shardingsphere.infra.rule.type.DataSourceContainedRulepublic void updateRuleStatus(org.apache.shardingsphere.infra.rule.event.RuleChangedEvent event)
updateRuleStatus in interface org.apache.shardingsphere.infra.rule.type.StatusContainedRuleCopyright © 2021 The Apache Software Foundation. All rights reserved.