/
HistoryServerOperations.java
82 lines (70 loc) · 2.77 KB
/
HistoryServerOperations.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* HistoryServerOperations.java
*
* Copyright (C) 2009-11 by RStudio, Inc.
*
* This program is licensed to you under the terms of version 3 of the
* GNU Affero General Public License. This program is distributed WITHOUT
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
*
*/
package org.rstudio.studio.client.workbench.views.history.model;
import org.rstudio.core.client.jsonrpc.RpcObjectList;
import org.rstudio.studio.client.server.Void;
import org.rstudio.studio.client.server.ServerRequestCallback;
import com.google.gwt.core.client.JsArrayNumber;
public interface HistoryServerOperations
{
/*
* getRecentHistory -- return all of the available history items (up to max)
*/
void getRecentHistory(
long maxItems,
ServerRequestCallback<RpcObjectList<HistoryEntry>> requestCallback);
/*
* getHistoryItems -- get a subset of history items
*/
void getHistoryItems(
long startIndex, // inclusive
long endIndex, // exclusive
ServerRequestCallback<RpcObjectList<HistoryEntry>> requestCallback);
/*
* removeHistoryItems -- indexes of items to remove
*/
void removeHistoryItems(JsArrayNumber itemIndexes,
ServerRequestCallback<Void> requestCallback);
/*
* clearHistory -- clear the entire history
*/
void clearHistory(ServerRequestCallback<Void> requestCallback);
/*
* getHistoryArchiveItems -- return a range of history archive items
* (note that startIndex is inclusive and endIndex is exclusive)
*/
void getHistoryArchiveItems(
long startIndex, // inclusive
long endIndex, // exclusive
ServerRequestCallback<RpcObjectList<HistoryEntry>> requestCallback);
/*
* searchHistoryDatabase - search the history archive for the query
* (return up to maxEntries). the search is conducted beginning with the
* most recent history items and returned in index decsending order i.e. newest
* ones first)
*/
void searchHistoryArchive(
String query,
long maxEntries,
ServerRequestCallback<RpcObjectList<HistoryEntry>> requestCallback);
/*
* searchHistoryArchiveByPrefix - search the history for items with the
* specified prefix (return up to maxEntries. the search is conducted
* beginning with the most recent history items and returned in index
* descending order i.e. newest ones first)
*/
void searchHistoryArchiveByPrefix(
String prefix,
long maxEntries,
ServerRequestCallback<RpcObjectList<HistoryEntry>> requestCallback);
}