blob: f3fc65f2c3c26f55c5adfe05a10d0abe3bca7011 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.event;
tomcbff9392014-09-10 00:45:23 -070017
Brian O'Connorcff03322015-02-03 15:28:59 -080018import org.onlab.util.AbstractAccumulator;
tomcbff9392014-09-10 00:45:23 -070019
tomcbff9392014-09-10 00:45:23 -070020import java.util.Timer;
tomcbff9392014-09-10 00:45:23 -070021
22/**
23 * Base implementation of an event accumulator. It allows triggering based on
24 * event inter-arrival time threshold, maximum batch life threshold and maximum
25 * batch size.
26 */
Brian O'Connorcff03322015-02-03 15:28:59 -080027public abstract class AbstractEventAccumulator
28 extends AbstractAccumulator<Event>
29 implements EventAccumulator {
tomcbff9392014-09-10 00:45:23 -070030
31 /**
32 * Creates an event accumulator capable of triggering on the specified
33 * thresholds.
34 *
35 * @param timer timer to use for scheduling check-points
36 * @param maxEvents maximum number of events to accumulate before
37 * processing is triggered
38 * @param maxBatchMillis maximum number of millis allowed since the first
39 * event before processing is triggered
40 * @param maxIdleMillis maximum number millis between events before
41 * processing is triggered
42 */
43 protected AbstractEventAccumulator(Timer timer, int maxEvents,
44 int maxBatchMillis, int maxIdleMillis) {
Brian O'Connorcff03322015-02-03 15:28:59 -080045 super(timer, maxEvents, maxBatchMillis, maxIdleMillis);
tomcbff9392014-09-10 00:45:23 -070046 }
47}