use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class DataMediaSourceServiceImpl method modify.
/**
* 修改
*/
public void modify(DataMediaSource dataMediaSource) {
Assert.assertNotNull(dataMediaSource);
try {
DataMediaSourceDO dataMediaSourceDo = modelToDo(dataMediaSource);
if (dataMediaSourceDao.checkUnique(dataMediaSourceDo)) {
dataMediaSourceDao.update(dataMediaSourceDo);
} else {
String exceptionCause = "exist the same name source in the database.";
logger.warn("WARN ## " + exceptionCause);
throw new RepeatConfigureException(exceptionCause);
}
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## modify dataMediaSource has an exception!");
throw new ManagerException(e);
}
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class CanalServiceImpl method modify.
/**
* 修改
*/
public void modify(final Canal canal) {
Assert.assertNotNull(canal);
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(TransactionStatus status) {
try {
CanalDO canalDo = modelToDo(canal);
if (canalDao.checkUnique(canalDo)) {
canalDao.update(canalDo);
} else {
String exceptionCause = "exist the same repeat canal in the database.";
logger.warn("WARN ## " + exceptionCause);
throw new RepeatConfigureException(exceptionCause);
}
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## modify canal(" + canal.getId() + ") has an exception!");
throw new ManagerException(e);
}
}
});
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class ChannelServiceImpl method create.
/**
* 添加Channel
*/
public void create(final Channel channel) {
Assert.assertNotNull(channel);
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
try {
ChannelDO channelDo = modelToDo(channel);
channelDo.setId(0L);
if (!channelDao.checkUnique(channelDo)) {
String exceptionCause = "exist the same name channel in the database.";
logger.warn("WARN ## " + exceptionCause);
throw new RepeatConfigureException(exceptionCause);
}
channelDao.insert(channelDo);
arbitrateManageService.channelEvent().init(channelDo.getId());
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## create channel has an exception ", e);
throw new ManagerException(e);
}
}
});
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class DataColumnPairServiceImpl method create.
public void create(ColumnPair entityObj) {
Assert.assertNotNull(entityObj);
try {
DataColumnPairDO dataColumnPairDo = modelToDo(entityObj);
dataColumnPairDao.insert(dataColumnPairDo);
} catch (RepeatConfigureException rcf) {
throw rcf;
} catch (Exception e) {
logger.error("ERROR ## create dataColumnPair has an exception!");
throw new ManagerException(e);
}
}
use of com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException in project otter by alibaba.
the class DataMatrixServiceImpl method modify.
/**
* 修改
*/
public void modify(final DataMatrix matrix) {
Assert.assertNotNull(matrix);
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
protected void doInTransactionWithoutResult(TransactionStatus status) {
try {
DataMatrixDO matrixDo = modelToDo(matrix);
if (dataMatrixDao.checkUnique(matrixDo)) {
dataMatrixDao.update(matrixDo);
} else {
String exceptionCause = "exist the same repeat matrix in the database.";
logger.warn("WARN ## " + exceptionCause);
throw new RepeatConfigureException(exceptionCause);
}
} catch (RepeatConfigureException rce) {
throw rce;
} catch (Exception e) {
logger.error("ERROR ## modify canal(" + matrix.getId() + ") has an exception!");
throw new ManagerException(e);
}
}
});
}
Aggregations