this.properties = properties;
this.sessionCredentials.updateContent(properties);
// 检测必须的参数
if (null == this.sessionCredentials.getAccessKey()
|| "".equals(this.sessionCredentials.getAccessKey())) {
throw new ONSClientException("please set access key");
}
if (null == this.sessionCredentials.getSecretKey()
|| "".equals(this.sessionCredentials.getSecretKey())) {
throw new ONSClientException("please set secret key");
}
/**
* 优先级 1、Name Server设置优先级最高 2、其次是地址服务器
*/
if (null == this.nameServerAddr) {
String addr = this.fetchNameServerAddr();
if (null != addr) {
this.nameServerAddr = addr;
}
}
if (null == this.nameServerAddr) {
throw new ONSClientException("Can not find name server");
}
}