use of com.cubrid.cubridmanager.ui.mondashboard.dialog.AddHADatabaseDialog in project cubrid-manager by CUBRID.
the class SelectDbPage method getHADatabaseList.
/**
*
* Get databases in HA mode
*
* @param haDbStatusInfo The HADatabaseStatusInfo
* @param haHostStatusInfoList The List<HAHostStatusInfo>
* @param isShowMsg boolean
* @return List<DatabaseNode>
*/
private List<DatabaseNode> getHADatabaseList(HADatabaseStatusInfo haDbStatusInfo, List<HAHostStatusInfo> haHostStatusInfoList, boolean isShowMsg) {
boolean isConfirm = false;
if (haDbStatusInfo != null) {
DBStatusType type = haDbStatusInfo.getStatusType();
String msg = null;
if (type == DBStatusType.ACTIVE || type == DBStatusType.TO_BE_ACTIVE) {
msg = Messages.bind(Messages.confirmMsgAddStandby, type.getText());
isConfirm = true;
} else if (type == DBStatusType.STANDBY || type == DBStatusType.TO_BE_STANDBY || type == DBStatusType.MAINTENANCE) {
msg = Messages.bind(Messages.confirmMsgAddActive, type.getText());
isConfirm = true;
}
if (isShowMsg) {
isConfirm = CommonUITool.openConfirmBox(msg);
}
}
if (isConfirm) {
AddHADatabaseDialog dialog = new AddHADatabaseDialog(getShell(), haDbStatusInfo, haHostStatusInfoList);
int ret = dialog.open();
if (ret == IDialogConstants.OK_ID) {
return dialog.getDbNodeList();
}
}
return null;
}
Aggregations