Project

General

Profile

Download (5.68 KB) Statistics
| Branch: | Tag: | Revision:
1
//
2
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs
3
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
4
// Any modifications to this file will be lost upon recompilation of the source schema.
5
// Generated on: 2009.11.02 at 12:58:05 PM GMT
6
//
7

    
8

    
9
package eu.etaxonomy.cdm.remote.dto.oaipmh;
10

    
11
import java.io.Serializable;
12
import java.math.BigInteger;
13
import java.time.ZonedDateTime;
14
import java.util.UUID;
15

    
16
import javax.xml.bind.annotation.XmlAccessType;
17
import javax.xml.bind.annotation.XmlAccessorType;
18
import javax.xml.bind.annotation.XmlAttribute;
19
import javax.xml.bind.annotation.XmlSchemaType;
20
import javax.xml.bind.annotation.XmlTransient;
21
import javax.xml.bind.annotation.XmlType;
22
import javax.xml.bind.annotation.XmlValue;
23
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
24
import javax.xml.datatype.XMLGregorianCalendar;
25

    
26
import eu.etaxonomy.cdm.api.service.pager.Pager;
27
import eu.etaxonomy.cdm.jaxb.DateTimeAdapter;
28

    
29

    
30
/**
31
 * A resumptionToken may have 3 optional attributes
32
 *        and can be used in ListSets, ListIdentifiers, ListRecords
33
 *        responses.
34
 *
35
 * <p>Java class for resumptionTokenType complex type.
36
 *
37
 * <p>The following schema fragment specifies the expected content contained within this class.
38
 *
39
 * <pre>
40
 * &lt;complexType name="resumptionTokenType">
41
 *   &lt;simpleContent>
42
 *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
43
 *       &lt;attribute name="expirationDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
44
 *       &lt;attribute name="completeListSize" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
45
 *       &lt;attribute name="cursor" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
46
 *     &lt;/extension>
47
 *   &lt;/simpleContent>
48
 * &lt;/complexType>
49
 * </pre>
50
 *
51
 *
52
 */
53
@XmlAccessorType(XmlAccessType.FIELD)
54
@XmlType(name = "resumptionTokenType", propOrder = {
55
    "value"
56
})
57
public class ResumptionToken implements Serializable {
58

    
59
    /**
60
	 *
61
	 */
62
	private static final long serialVersionUID = 1L;
63

    
64
    @XmlValue
65
    protected String value;
66
    @XmlAttribute
67
    @XmlJavaTypeAdapter(DateTimeAdapter.class)
68
    protected ZonedDateTime expirationDate;
69
    @XmlAttribute
70
    @XmlSchemaType(name = "positiveInteger")
71
    protected BigInteger completeListSize;
72
    @XmlAttribute
73
    @XmlSchemaType(name = "nonNegativeInteger")
74
    protected BigInteger cursor;
75

    
76
    @XmlTransient
77
	private MetadataPrefix metadataPrefix;
78

    
79
    @XmlTransient
80
	private ZonedDateTime from;
81

    
82
    @XmlTransient
83
	private ZonedDateTime until;
84

    
85
    @XmlTransient
86
	private SetSpec set;
87

    
88
    public ResumptionToken(Pager results, ZonedDateTime from,
89
            ZonedDateTime until, MetadataPrefix metadataPrefix, SetSpec set) {
90
		this.from = from;
91
		this.until = until;
92
		this.metadataPrefix = metadataPrefix;
93
		this.set = set;
94
		this.value = UUID.randomUUID().toString();
95
		this.completeListSize = BigInteger.valueOf(results.getCount());
96
		this.cursor = BigInteger.valueOf(results.getPageSize() * results.getCurrentIndex());
97
	}
98

    
99
	public ResumptionToken() { }
100

    
101
	/**
102
     * Gets the value of the value property.
103
     *
104
     * @return
105
     *     possible object is
106
     *     {@link String }
107
     *
108
     */
109
    public String getValue() {
110
        return value;
111
    }
112

    
113
    /**
114
     * Sets the value of the value property.
115
     *
116
     * @param value
117
     *     allowed object is
118
     *     {@link String }
119
     *
120
     */
121
    public void setValue(String value) {
122
        this.value = value;
123
    }
124

    
125
    /**
126
     * Gets the value of the expirationDate property.
127
     *
128
     * @return
129
     *     possible object is
130
     *     {@link XMLGregorianCalendar }
131
     *
132
     */
133
    public ZonedDateTime getExpirationDate() {
134
        return expirationDate;
135
    }
136

    
137
    /**
138
     * Sets the value of the expirationDate property.
139
     *
140
     * @param value
141
     *     allowed object is
142
     *     {@link XMLGregorianCalendar }
143
     *
144
     */
145
    public void setExpirationDate(ZonedDateTime value) {
146
        this.expirationDate = value;
147
    }
148

    
149
    /**
150
     * Gets the value of the completeListSize property.
151
     *
152
     * @return
153
     *     possible object is
154
     *     {@link BigInteger }
155
     *
156
     */
157
    public BigInteger getCompleteListSize() {
158
        return completeListSize;
159
    }
160

    
161
    /**
162
     * Sets the value of the completeListSize property.
163
     *
164
     * @param value
165
     *     allowed object is
166
     *     {@link BigInteger }
167
     *
168
     */
169
    public void setCompleteListSize(BigInteger value) {
170
        this.completeListSize = value;
171
    }
172

    
173
    /**
174
     * Gets the value of the cursor property.
175
     *
176
     * @return
177
     *     possible object is
178
     *     {@link BigInteger }
179
     *
180
     */
181
    public BigInteger getCursor() {
182
        return cursor;
183
    }
184

    
185
    /**
186
     * Sets the value of the cursor property.
187
     *
188
     * @param value
189
     *     allowed object is
190
     *     {@link BigInteger }
191
     *
192
     */
193
    public void setCursor(BigInteger value) {
194
        this.cursor = value;
195
    }
196

    
197
	public MetadataPrefix getMetadataPrefix() {
198
		return metadataPrefix;
199
	}
200

    
201
	public ZonedDateTime getFrom() {
202
		return from;
203
	}
204

    
205
	public ZonedDateTime getUntil() {
206
		return until;
207
	}
208

    
209
	public SetSpec getSet() {
210
		return set;
211
	}
212

    
213
	public void updateResults(Pager results) {
214
		this.completeListSize = BigInteger.valueOf(results.getCount());
215
		this.cursor = BigInteger.valueOf(results.getPageSize() * results.getCurrentIndex());
216
	}
217

    
218
	public static ResumptionToken emptyResumptionToken() {
219
		return new ResumptionToken();
220
	}
221
}
(22-22/27)