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
9 package eu
.etaxonomy
.cdm
.remote
.dto
.oaipmh
;
11 import java
.io
.Serializable
;
12 import java
.math
.BigInteger
;
13 import java
.util
.UUID
;
15 import javax
.xml
.bind
.annotation
.XmlAccessType
;
16 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
17 import javax
.xml
.bind
.annotation
.XmlAttribute
;
18 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
19 import javax
.xml
.bind
.annotation
.XmlTransient
;
20 import javax
.xml
.bind
.annotation
.XmlType
;
21 import javax
.xml
.bind
.annotation
.XmlValue
;
22 import javax
.xml
.bind
.annotation
.adapters
.XmlJavaTypeAdapter
;
23 import javax
.xml
.datatype
.XMLGregorianCalendar
;
25 import org
.joda
.time
.DateTime
;
27 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
28 import eu
.etaxonomy
.cdm
.jaxb
.DateTimeAdapter
;
32 * A resumptionToken may have 3 optional attributes
33 * and can be used in ListSets, ListIdentifiers, ListRecords
36 * <p>Java class for resumptionTokenType complex type.
38 * <p>The following schema fragment specifies the expected content contained within this class.
41 * <complexType name="resumptionTokenType">
43 * <extension base="<http://www.w3.org/2001/XMLSchema>string">
44 * <attribute name="expirationDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
45 * <attribute name="completeListSize" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
46 * <attribute name="cursor" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
54 @XmlAccessorType(XmlAccessType
.FIELD
)
55 @XmlType(name
= "resumptionTokenType", propOrder
= {
58 public class ResumptionToken
implements Serializable
{
60 private static final long serialVersionUID
= 6381710233899646281L;
63 protected String value
;
66 @XmlJavaTypeAdapter(DateTimeAdapter
.class)
67 protected DateTime expirationDate
;
70 @XmlSchemaType(name
= "positiveInteger")
71 protected BigInteger completeListSize
;
74 @XmlSchemaType(name
= "nonNegativeInteger")
75 protected BigInteger cursor
;
78 private MetadataPrefix metadataPrefix
;
81 private DateTime from
;
84 private DateTime until
;
89 public ResumptionToken(Pager results
, DateTime from
,
90 DateTime until
, MetadataPrefix metadataPrefix
, SetSpec set
) {
93 this.metadataPrefix
= metadataPrefix
;
95 this.value
= UUID
.randomUUID().toString();
96 this.completeListSize
= BigInteger
.valueOf(results
.getCount());
97 this.cursor
= BigInteger
.valueOf(results
.getPageSize() * results
.getCurrentIndex());
100 public ResumptionToken() { }
103 * Gets the value of the value property.
110 public String
getValue() {
115 * Sets the value of the value property.
122 public void setValue(String value
) {
127 * Gets the value of the expirationDate property.
131 * {@link XMLGregorianCalendar }
134 public DateTime
getExpirationDate() {
135 return expirationDate
;
139 * Sets the value of the expirationDate property.
143 * {@link XMLGregorianCalendar }
146 public void setExpirationDate(DateTime value
) {
147 this.expirationDate
= value
;
151 * Gets the value of the completeListSize property.
155 * {@link BigInteger }
158 public BigInteger
getCompleteListSize() {
159 return completeListSize
;
163 * Sets the value of the completeListSize property.
167 * {@link BigInteger }
170 public void setCompleteListSize(BigInteger value
) {
171 this.completeListSize
= value
;
175 * Gets the value of the cursor property.
179 * {@link BigInteger }
182 public BigInteger
getCursor() {
187 * Sets the value of the cursor property.
191 * {@link BigInteger }
194 public void setCursor(BigInteger value
) {
198 public MetadataPrefix
getMetadataPrefix() {
199 return metadataPrefix
;
202 public DateTime
getFrom() {
206 public DateTime
getUntil() {
210 public SetSpec
getSet() {
214 public void updateResults(Pager results
) {
215 this.completeListSize
= BigInteger
.valueOf(results
.getCount());
216 this.cursor
= BigInteger
.valueOf(results
.getPageSize() * results
.getCurrentIndex());
219 public static ResumptionToken
emptyResumptionToken() {
220 return new ResumptionToken();