]> git.basschouten.com Git - openhab-addons.git/blob
b7553699f9faf8f9aa0efbe69e97808b222e31cf
[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.logreader.internal.filereader.api;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * Interface for log file readers.
19  *
20  * @author Pauli Anttila - Initial contribution
21  */
22 @NonNullByDefault
23 public interface LogFileReader {
24
25     /**
26      * Register listener.
27      *
28      * @param fileReaderListener callback implementation to register.
29      * @return true if registering successfully done.
30      */
31     boolean registerListener(FileReaderListener fileReaderListener);
32
33     /**
34      * Unregister listener.
35      *
36      * @param fileReaderListener callback implementation to unregister.
37      * @return true if unregistering successfully done.
38      */
39     boolean unregisterListener(FileReaderListener fileReaderListener);
40
41     /**
42      * Start log file reader.
43      *
44      * @param filePath file to read.
45      * @param refreshRate how often file is read.
46      * @throws FileReaderException
47      */
48     void start(String filePath, long refreshRate) throws FileReaderException;
49
50     /**
51      * Stop log file reader.
52      */
53     void stop();
54 }