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
7 package eu
.etaxonomy
.cdm
.remote
.dto
.oaipmh
;
9 import java
.io
.Serializable
;
10 import java
.math
.BigInteger
;
11 import java
.util
.UUID
;
13 import javax
.xml
.bind
.annotation
.XmlAccessType
;
14 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
15 import javax
.xml
.bind
.annotation
.XmlAttribute
;
16 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
17 import javax
.xml
.bind
.annotation
.XmlTransient
;
18 import javax
.xml
.bind
.annotation
.XmlType
;
19 import javax
.xml
.bind
.annotation
.XmlValue
;
20 import javax
.xml
.bind
.annotation
.adapters
.XmlJavaTypeAdapter
;
22 import org
.joda
.time
.DateTime
;
24 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
25 import eu
.etaxonomy
.cdm
.jaxb
.DateTimeAdapter
;
28 * A resumptionToken may have 3 optional attributes
29 * and can be used in ListSets, ListIdentifiers, ListRecords
32 * <p>Java class for resumptionTokenType complex type.
34 * <p>The following schema fragment specifies the expected content contained within this class.
37 * <complexType name="resumptionTokenType">
39 * <extension base="<http://www.w3.org/2001/XMLSchema>string">
40 * <attribute name="expirationDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
41 * <attribute name="completeListSize" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
42 * <attribute name="cursor" type="{http://www.w3.org/2001/XMLSchema}nonNegativeInteger" />
48 @XmlAccessorType(XmlAccessType
.FIELD
)
49 @XmlType(name
= "resumptionTokenType", propOrder
= {
52 public class ResumptionToken
implements Serializable
{
54 private static final long serialVersionUID
= 6381710233899646281L;
57 protected String value
;
60 @XmlJavaTypeAdapter(DateTimeAdapter
.class)
61 protected DateTime expirationDate
;
64 @XmlSchemaType(name
= "positiveInteger")
65 protected BigInteger completeListSize
;
68 @XmlSchemaType(name
= "nonNegativeInteger")
69 protected BigInteger cursor
;
72 private MetadataPrefix metadataPrefix
;
75 private DateTime from
;
78 private DateTime until
;
83 public ResumptionToken(Pager results
, DateTime from
,
84 DateTime until
, MetadataPrefix metadataPrefix
, SetSpec set
) {
87 this.metadataPrefix
= metadataPrefix
;
89 this.value
= UUID
.randomUUID().toString();
90 this.completeListSize
= BigInteger
.valueOf(results
.getCount());
91 this.cursor
= BigInteger
.valueOf(results
.getPageSize() * results
.getCurrentIndex());
94 public ResumptionToken() { }
96 public String
getValue() {
100 public void setValue(String value
) {
104 public DateTime
getExpirationDate() {
105 return expirationDate
;
108 public void setExpirationDate(DateTime value
) {
109 this.expirationDate
= value
;
112 public BigInteger
getCompleteListSize() {
113 return completeListSize
;
116 public void setCompleteListSize(BigInteger value
) {
117 this.completeListSize
= value
;
120 public BigInteger
getCursor() {
124 public void setCursor(BigInteger value
) {
128 public MetadataPrefix
getMetadataPrefix() {
129 return metadataPrefix
;
132 public DateTime
getFrom() {
136 public DateTime
getUntil() {
140 public SetSpec
getSet() {
144 public void updateResults(Pager results
) {
145 this.completeListSize
= BigInteger
.valueOf(results
.getCount());
146 this.cursor
= BigInteger
.valueOf(results
.getPageSize() * results
.getCurrentIndex());
149 public static ResumptionToken
emptyResumptionToken() {
150 return new ResumptionToken();