Package org.gbif.api.model.occurrence
Class Download
- java.lang.Object
-
- org.gbif.api.model.occurrence.Download
-
- All Implemented Interfaces:
Serializable
public class Download extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDownload.StatusReflects the possibles statuses of a download during its execution.
-
Constructor Summary
Constructors Constructor Description Download()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) DategetCreated()DOIgetDoi()Occurrence download Digital Object Identifier.StringgetDownloadLink()DategetEraseAfter()DategetErasureNotification()@NotNull StringgetKey()LicensegetLicense()Get the license assigned to this occurrence download.@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) DategetModified()LonggetNumberDatasets()Number of datasets in the download file.LonggetNumberOrganizations()LonggetNumberPublishingCountries()@NotNull DownloadRequestgetRequest()Request that originated the download.longgetSize()Size in bytes of the produced file.StringgetSource()Source of the download to determine how the download was originated.@NotNull Download.StatusgetStatus()longgetTotalRecords()Number of occurrence records in the download file.booleanisAvailable()voidsetCreated(Date created)voidsetDoi(DOI doi)voidsetDownloadLink(String downloadLink)voidsetEraseAfter(Date eraseAfter)voidsetErasureNotification(Date erasureNotification)voidsetKey(String key)voidsetLicense(License license)voidsetModified(Date modified)voidsetNumberDatasets(Long numberDatasets)voidsetNumberOrganizations(Long numberOrganizations)voidsetNumberPublishingCountries(Long numberPublishingCountries)voidsetRequest(DownloadRequest request)voidsetSize(long size)voidsetSource(String source)voidsetStatus(Download.Status status)voidsetTotalRecords(long totalRecords)
-
-
-
Constructor Detail
-
Download
public Download()
-
-
Method Detail
-
getCreated
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) @Nullable public @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date getCreated()
- Returns:
- timestamp when the download was created
-
getDownloadLink
@Nullable public String getDownloadLink()
- Returns:
- the downloadLink
-
getKey
@NotNull public @NotNull String getKey()
- Returns:
- unique key that can be used in the REST service to retrieve its status
-
getModified
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) @Nullable public @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date getModified()
- Returns:
- timestamp when the download result was last modified
-
getEraseAfter
@Nullable public Date getEraseAfter()
- Returns:
- timestamp after which the download file may be erased
-
getErasureNotification
@Nullable public Date getErasureNotification()
- Returns:
- timestamp when a notification of an impending file erasure was sent
-
getRequest
@NotNull public @NotNull DownloadRequest getRequest()
Request that originated the download.
-
getStatus
@NotNull public @NotNull Download.Status getStatus()
- Returns:
- the current download status
-
isAvailable
public boolean isAvailable()
- Returns:
- true if the download is completed and a result is available
-
getSize
public long getSize()
Size in bytes of the produced file.
-
getTotalRecords
public long getTotalRecords()
Number of occurrence records in the download file.
-
getNumberDatasets
@Nullable public Long getNumberDatasets()
Number of datasets in the download file.
-
getSource
public String getSource()
Source of the download to determine how the download was originated.
-
getLicense
public License getLicense()
Get the license assigned to this occurrence download.
-
setCreated
public void setCreated(Date created)
-
setDownloadLink
public void setDownloadLink(String downloadLink)
-
setLicense
public void setLicense(License license)
-
setModified
public void setModified(Date modified)
-
setEraseAfter
public void setEraseAfter(Date eraseAfter)
-
setErasureNotification
public void setErasureNotification(Date erasureNotification)
-
setRequest
public void setRequest(DownloadRequest request)
-
setStatus
public void setStatus(Download.Status status)
-
setSize
public void setSize(long size)
-
setTotalRecords
public void setTotalRecords(long totalRecords)
-
setNumberDatasets
public void setNumberDatasets(Long numberDatasets)
-
getNumberOrganizations
@Nullable public Long getNumberOrganizations()
-
setNumberOrganizations
public void setNumberOrganizations(Long numberOrganizations)
-
getNumberPublishingCountries
@Nullable public Long getNumberPublishingCountries()
-
setNumberPublishingCountries
public void setNumberPublishingCountries(Long numberPublishingCountries)
-
-