use of com.alibaba.otter.manager.biz.config.node.dal.dataobject.NodeDO in project otter by alibaba.
the class NodeServiceImpl method modify.
/**
* 修改
*/
public void modify(final Node node) {
Assert.assertNotNull(node);
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(TransactionStatus status) {
try {
NodeDO nodeDo = modelToDo(node);
if (nodeDao.checkUnique(nodeDo)) {
nodeDao.update(nodeDo);
} else {
String exceptionCause = "exist the same repeat node in the database.";
logger.warn("WARN ## " + exceptionCause);
throw new RepeatConfigureException(exceptionCause);
}
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## modify node(" + node.getId() + ") has an exception!");
throw new ManagerException(e);
}
}
});
}
Aggregations