Examples of CanalDO


Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

        transactionTemplate.execute(new TransactionCallbackWithoutResult() {

            protected void doInTransactionWithoutResult(TransactionStatus status) {

                try {
                    CanalDO canalDO = modelToDo(canal);
                    canalDO.setId(0L);
                    if (!canalDao.checkUnique(canalDO)) {
                        String exceptionCause = "exist the same repeat canal in the database.";
                        logger.warn("WARN ## " + exceptionCause);
                        throw new RepeatConfigureException(exceptionCause);
                    }
                    canalDao.insert(canalDO);
                    canal.setId(canalDO.getId());
                } catch (RepeatConfigureException rce) {
                    throw rce;
                } catch (Exception e) {
                    logger.error("ERROR ## create canal has an exception!");
                    throw new ManagerException(e);
View Full Code Here

Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

        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);
View Full Code Here

Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

        return canals.get(0);
    }

    public Canal findByName(String name) {
        Assert.assertNotNull(name);
        CanalDO canalDo = canalDao.findByName(name);
        if (canalDo == null) {
            String exceptionCause = "query name:" + name + " return null.";
            logger.error("ERROR ## " + exceptionCause);
            throw new ManagerException(exceptionCause);
        }
View Full Code Here

Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

     *
     * @param canal
     * @return CanalDO
     */
    private CanalDO modelToDo(Canal canal) {
        CanalDO canalDo = new CanalDO();
        try {
            canalDo.setId(canal.getId());
            canalDo.setName(canal.getName());
            canalDo.setStatus(canal.getStatus());
            canalDo.setDescription(canal.getDesc());
            canalDo.setParameters(canal.getCanalParameter());
            canalDo.setGmtCreate(canal.getGmtCreate());
            canalDo.setGmtModified(canal.getGmtModified());
        } catch (Exception e) {
            logger.error("ERROR ## change the canal Model to Do has an exception");
            throw new ManagerException(e);
        }
        return canalDo;
View Full Code Here

Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

        transactionTemplate.execute(new TransactionCallbackWithoutResult() {

            protected void doInTransactionWithoutResult(TransactionStatus status) {

                try {
                    CanalDO canalDO = modelToDo(canal);
                    canalDO.setId(0L);
                    if (!canalDao.checkUnique(canalDO)) {
                        String exceptionCause = "exist the same repeat canal in the database.";
                        logger.warn("WARN ## " + exceptionCause);
                        throw new RepeatConfigureException(exceptionCause);
                    }
                    canalDao.insert(canalDO);
                    canal.setId(canalDO.getId());
                } catch (RepeatConfigureException rce) {
                    throw rce;
                } catch (Exception e) {
                    logger.error("ERROR ## create canal has an exception!");
                    throw new ManagerException(e);
View Full Code Here

Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

        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);
View Full Code Here

Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

        return canals.get(0);
    }

    public Canal findByName(String name) {
        Assert.assertNotNull(name);
        CanalDO canalDo = canalDao.findByName(name);
        if (canalDo == null) {
            String exceptionCause = "query name:" + name + " return null.";
            logger.error("ERROR ## " + exceptionCause);
            throw new ManagerException(exceptionCause);
        }
View Full Code Here

Examples of com.alibaba.otter.manager.biz.config.canal.dal.dataobject.CanalDO

     *
     * @param canal
     * @return CanalDO
     */
    private CanalDO modelToDo(Canal canal) {
        CanalDO canalDo = new CanalDO();
        try {
            canalDo.setId(canal.getId());
            canalDo.setName(canal.getName());
            canalDo.setStatus(canal.getStatus());
            canalDo.setDescription(canal.getDesc());
            canalDo.setParameters(canal.getCanalParameter());
            canalDo.setGmtCreate(canal.getGmtCreate());
            canalDo.setGmtModified(canal.getGmtModified());
        } catch (Exception e) {
            logger.error("ERROR ## change the canal Model to Do has an exception");
            throw new ManagerException(e);
        }
        return canalDo;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.