Project

General

Profile

1 42181 sandro.lab
package eu.dnetlib.oai.info;
2
3
import eu.dnetlib.oai.BadResumptionTokenException;
4
5
public interface ResumptionToken {
6
7
	/**
8
	 * Serializes the resumption token.
9
	 *
10
	 * @return a String serialization of this token.
11
	 */
12
	public String serialize();
13
14
	/**
15
	 * Deserializes the resumption token and sets the properties of this token accordingly.
16
	 *
17
	 * @param token a String serialization of this token.
18
	 * @throws BadResumptionTokenException if the token is not compliant to the expected format and therefore cannot be serialized
19
	 */
20
	public void deserialize(final String token) throws BadResumptionTokenException;
21
22
	/**
23
	 * Gets the total number of documents.
24
	 *
25
	 * @return the total number of documents
26
	 */
27
	public int getnMaxElements();
28
29
	/**
30
	 * Sets the total number of documents.
31
	 *
32
	 * @param nMaxElements the total number of documents
33
	 */
34
	public void setnMaxElements(final int nMaxElements);
35
36
	/**
37
	 * Gets the requested metadata prefix.
38
	 *
39
	 * @return the metadata prefix
40
	 */
41
	public String getMetadataPrefix();
42
43
	/**
44
	 * Sets the requested metadata prefix.
45
	 *
46
	 * @param metadataPrefix
47
	 */
48
	public void setMetadataPrefix(final String metadataPrefix);
49
50
	/**
51
	 * Gets the requested query.
52
	 *
53
	 * @return the requested query
54
	 */
55
	public String getQuery();
56
57
	/**
58
	 * Sets the requested query.
59
	 *
60
	 * @param query the requested query
61
	 */
62
	public void setQuery(final String query);
63
64
	/**
65
	 * Gets the number of already read records.
66
	 *
67
	 * @return the number of already read records.
68
	 */
69
	public int getnRead();
70
71
	/**
72
	 * Sets the number of already read records.
73
	 *
74
	 * @param nRead the number of already read records.
75
	 */
76
	public void setnRead(final int nRead);
77
78
	/**
79
	 * Gets the identifier of the last returned document.
80
	 *
81
	 * @return the identifier of the last returned document
82
	 */
83
	public String getLastObjIdentifier();
84
85
	/**
86
	 * Sets the identifier of the last returned document.
87
	 *
88
	 * @param lastObjIdentifier the identifier of the last returned document
89
	 */
90
	public void setLastObjIdentifier(final String lastObjIdentifier);
91
92
	/**
93
	 * Gets the requested set.
94
	 *
95
	 * @return the requested set
96
	 */
97
	public String getRequestedSet();
98
99
	/**
100
	 * Sets the requested set.
101
	 *
102
	 * @param requestedSet the name of the requested set
103
	 */
104
	public void setRequestedSet(final String requestedSet);
105
106
	/**
107
	 * @return true if the OAI request associated to this ResumptionToken has a date range.
108
	 */
109
	public boolean hasDateRange();
110
111
	public void setDateRange(final boolean hasDateRange);
112
113
}