Search in sources :

Example 1 with FindCanalEvent

use of com.alibaba.otter.shared.communication.model.canal.FindCanalEvent in project otter by alibaba.

the class CanalConfigClient method findCanal.

/**
     * 根据对应的destinantion查询Canal信息
     */
public Canal findCanal(String destination) {
    FindCanalEvent event = new FindCanalEvent();
    event.setDestination(destination);
    try {
        Object obj = delegate.callManager(event);
        if (obj != null && obj instanceof Canal) {
            return (Canal) obj;
        } else {
            throw new CanalException("No Such Canal by [" + destination + "]");
        }
    } catch (Exception e) {
        throw new CanalException("call_manager_error", e);
    }
}
Also used : Canal(com.alibaba.otter.canal.instance.manager.model.Canal) FindCanalEvent(com.alibaba.otter.shared.communication.model.canal.FindCanalEvent) CanalException(com.alibaba.otter.canal.common.CanalException) CanalException(com.alibaba.otter.canal.common.CanalException)

Aggregations

CanalException (com.alibaba.otter.canal.common.CanalException)1 Canal (com.alibaba.otter.canal.instance.manager.model.Canal)1 FindCanalEvent (com.alibaba.otter.shared.communication.model.canal.FindCanalEvent)1