Search in sources :

Example 1 with RepeatConfigureException

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);
    }
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) UserDO(com.alibaba.otter.manager.biz.user.dal.dataobject.UserDO) ManagerException(com.alibaba.otter.manager.biz.common.exceptions.ManagerException) ManagerException(com.alibaba.otter.manager.biz.common.exceptions.ManagerException) RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException)

Example 2 with RepeatConfigureException

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);
    }
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) UserDO(com.alibaba.otter.manager.biz.user.dal.dataobject.UserDO) ManagerException(com.alibaba.otter.manager.biz.common.exceptions.ManagerException) ManagerException(com.alibaba.otter.manager.biz.common.exceptions.ManagerException) RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException)

Example 3 with RepeatConfigureException

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());
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) AlarmRule(com.alibaba.otter.shared.common.model.config.alarm.AlarmRule)

Example 4 with RepeatConfigureException

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);
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) AutoKeeperCluster(com.alibaba.otter.shared.common.model.autokeeper.AutoKeeperCluster)

Example 5 with RepeatConfigureException

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);
}
Also used : RepeatConfigureException(com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException) AutoKeeperCluster(com.alibaba.otter.shared.common.model.autokeeper.AutoKeeperCluster)

Aggregations

RepeatConfigureException (com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException)46 ManagerException (com.alibaba.otter.manager.biz.common.exceptions.ManagerException)23 TransactionStatus (org.springframework.transaction.TransactionStatus)8 TransactionCallbackWithoutResult (org.springframework.transaction.support.TransactionCallbackWithoutResult)8 ArrayList (java.util.ArrayList)7 Node (com.alibaba.otter.shared.common.model.config.node.Node)6 DataMedia (com.alibaba.otter.shared.common.model.config.data.DataMedia)5 AutoKeeperCluster (com.alibaba.otter.shared.common.model.autokeeper.AutoKeeperCluster)4 DataColumnPairDO (com.alibaba.otter.manager.biz.config.datacolumnpair.dal.dataobject.DataColumnPairDO)3 DataMediaDO (com.alibaba.otter.manager.biz.config.datamedia.dal.dataobject.DataMediaDO)3 DataMediaPair (com.alibaba.otter.shared.common.model.config.data.DataMediaPair)3 DataMediaSource (com.alibaba.otter.shared.common.model.config.data.DataMediaSource)3 MqMediaSource (com.alibaba.otter.shared.common.model.config.data.mq.MqMediaSource)3 List (java.util.List)3 Canal (com.alibaba.otter.canal.instance.manager.model.Canal)2 CanalParameter (com.alibaba.otter.canal.instance.manager.model.CanalParameter)2 DataSourcing (com.alibaba.otter.canal.instance.manager.model.CanalParameter.DataSourcing)2 SourcingType (com.alibaba.otter.canal.instance.manager.model.CanalParameter.SourcingType)2 InvalidConfigureException (com.alibaba.otter.manager.biz.common.exceptions.InvalidConfigureException)2 CanalDO (com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO)2