View Javadoc
1   /*
2    * Copyright (C) 2013, Robin Rosenberg <robin.rosenberg@dewire.com> and others
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  
11  package org.eclipse.jgit.lib;
12  
13  import java.io.IOException;
14  import java.util.List;
15  
16  /**
17   * Utility for reading reflog entries
18   *
19   * @since 3.0
20   */
21  public interface ReflogReader {
22  
23  	/**
24  	 * Get the last entry in the reflog
25  	 *
26  	 * @return the latest reflog entry, or null if no log
27  	 * @throws java.io.IOException
28  	 */
29  	ReflogEntry getLastEntry() throws IOException;
30  
31  	/**
32  	 * Get all reflog entries in reverse order
33  	 *
34  	 * @return all reflog entries in reverse order
35  	 * @throws java.io.IOException
36  	 */
37  	List<ReflogEntry> getReverseEntries() throws IOException;
38  
39  	/**
40  	 * Get specific entry in the reflog relative to the last entry which is
41  	 * considered entry zero.
42  	 *
43  	 * @param number a int.
44  	 * @return reflog entry or null if not found
45  	 * @throws java.io.IOException
46  	 */
47  	ReflogEntry getReverseEntry(int number) throws IOException;
48  
49  	/**
50  	 * Get all reflog entries in reverse order
51  	 *
52  	 * @param max
53  	 *            max number of entries to read
54  	 * @return all reflog entries in reverse order
55  	 * @throws java.io.IOException
56  	 */
57  	List<ReflogEntry> getReverseEntries(int max) throws IOException;
58  }