Package com.alibaba.otter.shared.common.model.config.channel

Examples of com.alibaba.otter.shared.common.model.config.channel.Channel


    @Resource(name = "channelService")
    private ChannelService channelService;

    public void execute(@Param("pipelineId") Long pipelineId, Context context, Navigator nav) throws Exception {

        Channel channel = channelService.findByPipelineId(pipelineId);
        if (channel.getStatus().isStart()) {
            nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
            return;
        }

        context.put("pipelineId", pipelineId);
        context.put("channelId", channel.getId());
    }
View Full Code Here


    @Resource(name = "channelService")
    private ChannelService channelService;

    public void execute(@Param("pipelineId") Long pipelineId, Context context, Navigator nav) throws Exception {

        Channel channel = channelService.findByPipelineId(pipelineId);
        if (channel.getStatus().isStart()) {
            nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
            return;
        }

        context.put("pipelineId", pipelineId);
        context.put("channelId", channel.getId());
    }
View Full Code Here

    public void execute(@Param("id") Long id) {

        try {

            Channel channel = channelService.findById(id);

            returnSuccess(channel.getStatus().toString());

        } catch (Exception e) {
            String errorMsg = String.format("error happens while [check status] channel with id [%d]", id);
            log.error(errorMsg, e);
            returnError(errorMsg);
View Full Code Here

                end = sdf.parse(endTime);
            }
        }

        DataMediaPair dataMediaPair = dataMediaPairService.findById(dataMediaPairId);
        Channel channel = channelService.findByPipelineId(dataMediaPair.getPipelineId());

        Map<Long, BehaviorHistoryInfo> behaviourHistoryInfos = new LinkedHashMap<Long, BehaviorHistoryInfo>();

        TimelineBehaviorHistoryCondition condition = new TimelineBehaviorHistoryCondition();
View Full Code Here

     * @param channelId
     * @param context
     * @throws WebxException
     */
    public void execute(@Param("pipelineId") Long pipelineId, Context context, Navigator nav) throws Exception {
        Channel channel = channelService.findByPipelineId(pipelineId);
        if (channel.getStatus().isStart()) {
            nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
            return;
        }

        Pipeline pipeline = pipelineService.findById(pipelineId);
View Full Code Here

    @Resource(name = "channelService")
    private ChannelService channelService;

    public void execute(@Param("channelId") Long channelId, Context context) throws Exception {
        Channel channel = channelService.findById(channelId);

        context.put("channel", channel);
    }
View Full Code Here

    private AlarmRuleService      alarmRuleService;

    public void execute(@Param("channelId") Long channelId, @Param("pipelineId") Long pipelineId, HttpSession session,
                        Context context) throws Exception {

        Channel channel = channelService.findByIdWithoutColumn(channelId);
        List<Pipeline> pipelines = channel.getPipelines();
        List<Pipeline> tempPipe = new ArrayList<Pipeline>();

        if ((pipelineId != null) && (pipelineId != 0l)) {
            for (Pipeline pipeline : pipelines) {
                if (!pipeline.getId().equals(pipelineId)) {
                    tempPipe.add(pipeline);
                }
            }
            pipelines.removeAll(tempPipe);
        }

        Map<Long, DelayStat> delayStats = new HashMap<Long, DelayStat>(pipelines.size(), 1f);
        Map<Long, MainStemEventData> mainstemDatas = new HashMap<Long, MainStemEventData>(pipelines.size(), 1f);
        Map<Long, ThroughputStat> throughputStats = new HashMap<Long, ThroughputStat>(pipelines.size(), 1f);
        Map<Long, List<AlarmRule>> alarmRuleStats = new HashMap<Long, List<AlarmRule>>(pipelines.size(), 1f);
        Map<Long, PositionEventData> positionDatas = new HashMap<Long, PositionEventData>(pipelines.size(), 1f);
        for (Pipeline pipeline : pipelines) {
            DelayStat delayStat = delayStatService.findRealtimeDelayStat(pipeline.getId());
            if (delayStat.getDelayNumber() == null) {
                delayStat.setDelayNumber(0L);
                delayStat.setDelayTime(0L);
                delayStat.setGmtModified(pipeline.getGmtModified());
            }
            delayStats.put(pipeline.getId(), delayStat);
            mainstemDatas.put(pipeline.getId(), arbitrateViewService.mainstemData(channel.getId(), pipeline.getId()));
            ThroughputCondition condition = new ThroughputCondition();
            condition.setPipelineId(pipeline.getId());
            condition.setType(ThroughputType.ROW);
            ThroughputStat throughputStat = throughputStatService.findThroughputStatByPipelineId(condition);
            throughputStats.put(pipeline.getId(), throughputStat);
View Full Code Here

     */
    public void doAdd(@FormGroup("channelInfo") Group channelInfo,
                      @FormGroup("channelParameterInfo") Group channelParameterInfo,
                      @FormField(name = "formChannelError", group = "channelInfo") CustomErrors err, Navigator nav)
                                                                                                                   throws Exception {
        Channel channel = new Channel();
        ChannelParameter parameter = new ChannelParameter();
        channelInfo.setProperties(channel);
        channelParameterInfo.setProperties(parameter);
        // 新建Channel默认关闭该状态
        channel.setStatus(ChannelStatus.STOP);
        channel.setParameters(parameter);
        try {
            channelService.create(channel);
        } catch (RepeatConfigureException rce) {
            err.setMessage("invalidChannelName");
            return;
View Full Code Here

    public void doEdit(@FormGroup("channelInfo") Group channelInfo, @Param("pageIndex") int pageIndex,
                       @Param("searchKey") String searchKey,
                       @FormGroup("channelParameterInfo") Group channelParameterInfo,
                       @FormField(name = "formChannelError", group = "channelInfo") CustomErrors err, Navigator nav)
                                                                                                                    throws Exception {
        Channel channel = new Channel();
        ChannelParameter parameter = new ChannelParameter();
        channelInfo.setProperties(channel);
        channelParameterInfo.setProperties(parameter);
        channel.setStatus(channelService.findById(channel.getId()).getStatus());
        parameter.setChannelId(channel.getId());
        channel.setParameters(parameter);
        try {
            channelService.modify(channel);
        } catch (RepeatConfigureException rce) {
            err.setMessage("invalidChannelName");
            return;
View Full Code Here

    /**
     * 删除映射关系
     */
    public void doDelete(@Param("dataMediaPairId") Long dataMediaPairId, @Param("pipelineId") Long pipelineId,
                         Navigator nav) throws WebxException {
        Channel channel = channelService.findByPipelineId(pipelineId);
        if (channel.getStatus().isStart()) {
            nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
            return;
        }
        dataMediaPairService.remove(dataMediaPairId);
        nav.redirectToLocation("dataMediaPairList.htm?pipelineId=" + pipelineId);
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.common.model.config.channel.Channel

Copyright © 2018 www.massapicom. 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.