2 * Copyright (c) 2010-2023 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;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * Interface for log file readers.
20 * @author Pauli Anttila - Initial contribution
23 public interface LogFileReader {
28 * @param fileReaderListener callback implementation to register.
29 * @return true if registering successfully done.
31 boolean registerListener(FileReaderListener fileReaderListener);
34 * Unregister listener.
36 * @param fileReaderListener callback implementation to unregister.
37 * @return true if unregistering successfully done.
39 boolean unregisterListener(FileReaderListener fileReaderListener);
42 * Start log file reader.
44 * @param filePath file to read.
45 * @param refreshRate how often file is read.
46 * @throws FileReaderException
48 void start(String filePath, long refreshRate) throws FileReaderException;
51 * Stop log file reader.