]> git.basschouten.com Git - openhab-addons.git/blob
f20ea1d37763a423fba870c56255384ff798dcc4
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.onebusaway.internal.handler;
14
15 import java.util.List;
16
17 /**
18  * The {@link RouteDataListener} is the interface used for the stop (a bridge) to communicate information about route
19  * arrivals.
20  *
21  * @author Shawn Wilsher - Initial contribution
22  */
23 interface RouteDataListener {
24     /**
25      * @return The routeId for this listener. {@link #onNewRouteData(List)} should only receive updates for
26      *         this route.
27      */
28     String getRouteId();
29
30     /**
31      * Called when new arrival and departure data is available for this listeners route (as specified by
32      * {@link #getRouteId()}).
33      *
34      * @param lastUpdateTime a {@link long} representing the time the data was last updated.
35      * @param data a {@link List} of data from the OneBusAway API.
36      */
37     void onNewRouteData(long lastUpdateTime, List<ObaStopArrivalResponse.ArrivalAndDeparture> data);
38 }