Search in sources :

Example 21 with AlarmRule

use of com.alibaba.otter.shared.common.model.config.alarm.AlarmRule in project otter by alibaba.

the class AlarmSystemList method execute.

public void execute(@Param("pipelineId") Long pipelineId, @Param("pageIndex") int pageIndex, Context context) throws Exception {
    Map<String, Object> condition = new HashMap<String, Object>();
    int count = alarmRuleService.getCount();
    Paginator paginator = new Paginator();
    paginator.setItems(count);
    paginator.setPage(pageIndex);
    condition.put("offset", paginator.getOffset());
    condition.put("length", paginator.getLength());
    List<AlarmRule> alarmRules = alarmRuleService.listAllAlarmRules(condition);
    StringBuffer buffer = new StringBuffer();
    for (AlarmRule alarmRule : alarmRules) {
        buffer.append(alarmRule.getId());
        buffer.append(",");
    }
    context.put("alarmRules", alarmRules);
    context.put("alarmRuleIds", buffer.toString());
    context.put("paginator", paginator);
}
Also used : HashMap(java.util.HashMap) AlarmRule(com.alibaba.otter.shared.common.model.config.alarm.AlarmRule) Paginator(com.alibaba.citrus.util.Paginator)

Aggregations

AlarmRule (com.alibaba.otter.shared.common.model.config.alarm.AlarmRule)21 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)7 Date (java.util.Date)6 List (java.util.List)6 BaseOtterTest (com.alibaba.otter.manager.biz.BaseOtterTest)4 Test (org.testng.annotations.Test)4 RepeatConfigureException (com.alibaba.otter.manager.biz.common.exceptions.RepeatConfigureException)3 Pipeline (com.alibaba.otter.shared.common.model.config.pipeline.Pipeline)3 ThroughputCondition (com.alibaba.otter.manager.biz.statistics.throughput.param.ThroughputCondition)2 PositionEventData (com.alibaba.otter.shared.arbitrate.model.PositionEventData)2 Channel (com.alibaba.otter.shared.common.model.config.channel.Channel)2 DelayStat (com.alibaba.otter.shared.common.model.statistics.delay.DelayStat)2 ThroughputStat (com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat)2 NodeAlarmEvent (com.alibaba.otter.shared.communication.model.arbitrate.NodeAlarmEvent)2 Paginator (com.alibaba.citrus.util.Paginator)1 WebxException (com.alibaba.citrus.webx.WebxException)1 ManagerException (com.alibaba.otter.manager.biz.common.exceptions.ManagerException)1 MainStemEventData (com.alibaba.otter.shared.arbitrate.model.MainStemEventData)1 ChannelStatus (com.alibaba.otter.shared.common.model.config.channel.ChannelStatus)1