mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Polish alibaba/spring-cloud-alibaba#1758 : [CodeBase] Sync the source code from greenwich to finichley
This commit is contained in:
parent
202f862e96
commit
397a473bc7
@ -32,6 +32,10 @@ public class NacosDataSourceProperties extends AbstractDataSourceProperties {
|
|||||||
|
|
||||||
private String serverAddr;
|
private String serverAddr;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private String groupId = "DEFAULT_GROUP";
|
private String groupId = "DEFAULT_GROUP";
|
||||||
|
|
||||||
@ -67,6 +71,22 @@ public class NacosDataSourceProperties extends AbstractDataSourceProperties {
|
|||||||
this.serverAddr = serverAddr;
|
this.serverAddr = serverAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGroupId() {
|
public String getGroupId() {
|
||||||
return groupId;
|
return groupId;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ public class RedisDataSourceProperties extends AbstractDataSourceProperties {
|
|||||||
"RedisDataSource channel can not be empty");
|
"RedisDataSource channel can not be empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(masterId) && StringUtils.isEmpty(masterId)) {
|
if (StringUtils.isEmpty(masterId)) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"RedisDataSource sentinel model,masterId can not be empty");
|
"RedisDataSource sentinel model,masterId can not be empty");
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,10 @@ public class NacosDataSourceFactoryBean implements FactoryBean<NacosDataSource>
|
|||||||
|
|
||||||
private String serverAddr;
|
private String serverAddr;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
private String groupId;
|
private String groupId;
|
||||||
|
|
||||||
private String dataId;
|
private String dataId;
|
||||||
@ -63,6 +67,12 @@ public class NacosDataSourceFactoryBean implements FactoryBean<NacosDataSource>
|
|||||||
if (!StringUtils.isEmpty(this.namespace)) {
|
if (!StringUtils.isEmpty(this.namespace)) {
|
||||||
properties.setProperty(PropertyKeyConst.NAMESPACE, this.namespace);
|
properties.setProperty(PropertyKeyConst.NAMESPACE, this.namespace);
|
||||||
}
|
}
|
||||||
|
if (!StringUtils.isEmpty(this.username)) {
|
||||||
|
properties.setProperty(PropertyKeyConst.USERNAME, this.username);
|
||||||
|
}
|
||||||
|
if (!StringUtils.isEmpty(this.password)) {
|
||||||
|
properties.setProperty(PropertyKeyConst.PASSWORD, this.password);
|
||||||
|
}
|
||||||
return new NacosDataSource(properties, groupId, dataId, converter);
|
return new NacosDataSource(properties, groupId, dataId, converter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +89,22 @@ public class NacosDataSourceFactoryBean implements FactoryBean<NacosDataSource>
|
|||||||
this.serverAddr = serverAddr;
|
this.serverAddr = serverAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGroupId() {
|
public String getGroupId() {
|
||||||
return groupId;
|
return groupId;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user