2 * Copyright (c) 2010-2020 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.logreader.internal.filereader.api;
16 * Interface for log file readers.
18 * @author Pauli Anttila - Initial contribution
20 public interface LogFileReader {
25 * @param fileReaderListener callback implementation to register.
26 * @return true if registering successfully done.
28 boolean registerListener(FileReaderListener fileReaderListener);
31 * Unregister listener.
33 * @param fileReaderListener callback implementation to unregister.
34 * @return true if unregistering successfully done.
36 boolean unregisterListener(FileReaderListener fileReaderListener);
39 * Start log file reader.
41 * @param filePath file to read.
42 * @param refreshRate how often file is read.
43 * @throws FileReaderException
45 void start(String filePath, long refreshRate) throws FileReaderException;
48 * Stop log file reader.