- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.shardingsphere.core.yaml.YamlAuthentication
类的一些代码示例,展示了YamlAuthentication
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlAuthentication
类的具体详情如下:
包路径:org.apache.shardingsphere.core.yaml.YamlAuthentication
类名称:YamlAuthentication
[英]Authentication for YAML.
[中]YAML的身份验证。
代码示例来源:origin: apache/incubator-shardingsphere
@Override
public Authentication load(final String data) {
YamlAuthentication result = new Yaml().loadAs(data, YamlAuthentication.class);
Preconditions.checkState(!Strings.isNullOrEmpty(result.getUsername()), "Authority configuration is invalid.");
return new Authentication(result.getUsername(), result.getPassword());
}
}
代码示例来源:origin: apache/incubator-shardingsphere
@Override
public String dump(final Authentication authentication) {
YamlAuthentication yamlAuthentication = new YamlAuthentication();
yamlAuthentication.setUsername(authentication.getUsername());
yamlAuthentication.setPassword(authentication.getPassword());
return new Yaml(new DefaultYamlRepresenter()).dumpAsMap(yamlAuthentication);
}
}
代码示例来源:origin: apache/incubator-shardingsphere
private YamlProxyServerConfiguration loadServerConfiguration(final File yamlFile) throws IOException {
try (
FileInputStream fileInputStream = new FileInputStream(yamlFile);
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8")
) {
YamlProxyServerConfiguration result = new Yaml(new Constructor(YamlProxyServerConfiguration.class)).loadAs(inputStreamReader, YamlProxyServerConfiguration.class);
Preconditions.checkNotNull(result, "Server configuration file `%s` is invalid.", yamlFile.getName());
Preconditions.checkState(!Strings.isNullOrEmpty(result.getAuthentication().getUsername()) || null != result.getOrchestration(), "Authority configuration is invalid.");
return result;
}
}
代码示例来源:origin: apache/incubator-shardingsphere
private YamlProxyServerConfiguration loadServerConfiguration(final File yamlFile) throws IOException {
try (
FileInputStream fileInputStream = new FileInputStream(yamlFile);
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8")
) {
YamlProxyServerConfiguration result = new Yaml(new Constructor(YamlProxyServerConfiguration.class)).loadAs(inputStreamReader, YamlProxyServerConfiguration.class);
Preconditions.checkNotNull(result, "Server configuration file `%s` is invalid.", yamlFile.getName());
Preconditions.checkState(!Strings.isNullOrEmpty(result.getAuthentication().getUsername()) || null != result.getOrchestration(), "Authority configuration is invalid.");
return result;
}
}
代码示例来源:origin: apache/incubator-shardingsphere
private static void initShardingOrchestrationFacade(
final YamlProxyServerConfiguration serverConfig, final Map<String, YamlProxyRuleConfiguration> ruleConfigs, final ShardingOrchestrationFacade shardingOrchestrationFacade) {
if (ruleConfigs.isEmpty()) {
shardingOrchestrationFacade.init();
} else {
shardingOrchestrationFacade.init(getDataSourceConfigurationMap(ruleConfigs), getRuleConfiguration(ruleConfigs),
new Authentication(serverConfig.getAuthentication().getUsername(), serverConfig.getAuthentication().getPassword()), serverConfig.getConfigMap(), serverConfig.getProps());
}
}
代码示例来源:origin: apache/incubator-shardingsphere
private static void initShardingOrchestrationFacade(
final YamlProxyServerConfiguration serverConfig, final Map<String, YamlProxyRuleConfiguration> ruleConfigs, final ShardingOrchestrationFacade shardingOrchestrationFacade) {
if (ruleConfigs.isEmpty()) {
shardingOrchestrationFacade.init();
} else {
shardingOrchestrationFacade.init(getDataSourceConfigurationMap(ruleConfigs), getRuleConfiguration(ruleConfigs),
new Authentication(serverConfig.getAuthentication().getUsername(), serverConfig.getAuthentication().getPassword()), serverConfig.getConfigMap(), serverConfig.getProps());
}
}
代码示例来源:origin: apache/incubator-shardingsphere
/**
* Main entrance.
*
* @param args startup arguments
* @throws InterruptedException interrupted exception
* @throws IOException IO exception
*/
public static void main(final String[] args) throws InterruptedException, IOException {
ShardingConfiguration shardingConfig = new ShardingConfigurationLoader().load();
int port = getPort(args);
new ProxyListenerRegister().register();
if (null == shardingConfig.getServerConfiguration().getOrchestration()) {
startWithoutRegistryCenter(shardingConfig.getRuleConfigurationMap(),
new Authentication(shardingConfig.getServerConfiguration().getAuthentication().getUsername(), shardingConfig.getServerConfiguration().getAuthentication().getPassword()),
shardingConfig.getServerConfiguration().getConfigMap(), shardingConfig.getServerConfiguration().getProps(), port);
} else {
startWithRegistryCenter(shardingConfig.getServerConfiguration(), shardingConfig.getRuleConfigurationMap().keySet(), shardingConfig.getRuleConfigurationMap(), port);
}
}
代码示例来源:origin: apache/incubator-shardingsphere
/**
* Main entrance.
*
* @param args startup arguments
* @throws InterruptedException interrupted exception
* @throws IOException IO exception
*/
public static void main(final String[] args) throws InterruptedException, IOException {
ShardingConfiguration shardingConfig = new ShardingConfigurationLoader().load();
int port = getPort(args);
new ProxyListenerRegister().register();
if (null == shardingConfig.getServerConfiguration().getOrchestration()) {
startWithoutRegistryCenter(shardingConfig.getRuleConfigurationMap(),
new Authentication(shardingConfig.getServerConfiguration().getAuthentication().getUsername(), shardingConfig.getServerConfiguration().getAuthentication().getPassword()),
shardingConfig.getServerConfiguration().getConfigMap(), shardingConfig.getServerConfiguration().getProps(), port);
} else {
startWithRegistryCenter(shardingConfig.getServerConfiguration(), shardingConfig.getRuleConfigurationMap().keySet(), shardingConfig.getRuleConfigurationMap(), port);
}
}
目录 集成sharding jdbc 1. 引入依赖 2. 配置分表规则 问题 集成多数据源
Apache ShardingSphere 是一个开源的分布式数据库,它还有一个用户和开发人员需要的生态系统,为之提供了定制和云原生的体验。 Apache ShardingSphere
谈到分库分表中间件时,我们自然而然的会想到 ShardingSphere-JDBC 。 这篇文章,我们聊聊 ShardingSphere-JDBC 相关知识点,并实战演示一番。
本文整理了Java中io.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration类的一些代码示例,展示了YamlSharding
本文整理了Java中org.apache.shardingsphere.core.yaml.YamlAuthentication类的一些代码示例,展示了YamlAuthentication类的具体用法
本文整理了Java中org.apache.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration类的一些代码示例,展示了Yaml
本文整理了Java中org.apache.shardingsphere.core.yaml.masterslave.YamlMasterSlaveRuleConfiguration类的一些代码示例,展
本文整理了Java中org.apache.shardingsphere.orchestration.yaml.config.YamlOrchestrationConfiguration类的一些代码示例
本文整理了Java中org.apache.shardingsphere.core.yaml.sharding.YamlKeyGeneratorConfiguration类的一些代码示例,展示了Yaml
本文整理了Java中io.shardingsphere.core.yaml.masterslave.YamlMasterSlaveRuleConfiguration.getMasterSlaveRul
本文整理了Java中io.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration.getShardingRuleConfigur
本文整理了Java中org.apache.shardingsphere.core.yaml.YamlAuthentication.getUsername()方法的一些代码示例,展示了YamlAuthe
本文整理了Java中org.apache.shardingsphere.core.yaml.YamlAuthentication.getPassword()方法的一些代码示例,展示了YamlAuthe
本文整理了Java中org.apache.shardingsphere.core.yaml.sharding.YamlShardingRuleConfiguration.getShardingRule
本文整理了Java中org.apache.shardingsphere.core.yaml.masterslave.YamlMasterSlaveRuleConfiguration.getMaster
本文整理了Java中org.apache.shardingsphere.orchestration.yaml.config.YamlOrchestrationConfiguration.getOrch
我是一名优秀的程序员,十分优秀!