use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class UserServiceImpl method createUser.
public void createUser(User user) {
Assert.assertNotNull(user);
try {
UserDO userDo = userDao.insertUser(modelToDo(user));
if (userDo.getId() == 0) {
String exceptionCause = "exist the same name user in the database.";
logger.warn("WARN ## " + exceptionCause);
throw new RepeatConfigureException(exceptionCause);
}
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## create user has an exception!");
throw new ManagerException(e);
}
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class UserServiceImpl method updataUser.
public void updataUser(User user) {
Assert.assertNotNull(user);
try {
UserDO UserDo = modelToDo(user);
if (userDao.chackUnique(UserDo)) {
userDao.updateUser(UserDo);
} else {
String exceptionCause = "exist the same name user in the database.";
logger.warn("WARN ## " + exceptionCause);
throw new RepeatConfigureException(exceptionCause);
}
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## create user has an exception!");
throw new ManagerException(e);
}
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class AlarmRuleAction method doEdit.
/**
* 修改Node
*/
public void doEdit(@FormGroup("alarmRuleInfo") Group alarmRuleInfo, @FormField(name = "formAlarmRuleError", group = "alarmRuleInfo") CustomErrors err, Navigator nav) throws Exception {
AlarmRule alarmRule = new AlarmRule();
alarmRuleInfo.setProperties(alarmRule);
try {
alarmRuleService.modify(alarmRule);
} catch (RepeatConfigureException rce) {
err.setMessage("invalidAlarmRule");
return;
}
nav.redirectToLocation("alarmRuleList.htm?pipelineId=" + alarmRule.getPipelineId());
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class AutoKeeperClusterAction method doEdit.
public void doEdit(@FormGroup("autokeeperClusterInfo") Group autokeeperClusterInfo, @FormField(name = "formAutokeeperClusterError", group = "autokeeperClusterInfo") CustomErrors err, Navigator nav) throws Exception {
AutoKeeperCluster autoKeeperCluster = new AutoKeeperCluster();
autokeeperClusterInfo.setProperties(autoKeeperCluster);
String zkClustersString = autokeeperClusterInfo.getField("zookeeperClusters").getStringValue();
String[] zkClusters = StringUtils.split(zkClustersString, ";");
autoKeeperCluster.setServerList(Arrays.asList(zkClusters));
try {
autoKeeperClusterService.modifyAutoKeeperCluster(autoKeeperCluster);
} catch (RepeatConfigureException rce) {
err.setMessage("invalidChannelName");
return;
}
nav.redirectTo(WebConstant.AUTO_KEEPER_CLUSTERS_LINK);
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class AutoKeeperClusterAction method doAdd.
public void doAdd(@FormGroup("autokeeperClusterInfo") Group autokeeperClusterInfo, @FormField(name = "formAutokeeperClusterError", group = "autokeeperClusterInfo") CustomErrors err, Navigator nav) throws Exception {
AutoKeeperCluster autoKeeperCluster = new AutoKeeperCluster();
autokeeperClusterInfo.setProperties(autoKeeperCluster);
String zkClustersString = autokeeperClusterInfo.getField("zookeeperClusters").getStringValue();
String[] zkClusters = StringUtils.split(zkClustersString, ";");
autoKeeperCluster.setServerList(Arrays.asList(zkClusters));
try {
autoKeeperClusterService.createAutoKeeperCluster(autoKeeperCluster);
} catch (RepeatConfigureException rce) {
err.setMessage("invalidNode");
return;
}
nav.redirectTo(WebConstant.AUTO_KEEPER_CLUSTERS_LINK);
}
Aggregations