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