public class DownloadStatusInfoImpl extends Object implements DownloadStatusInfo
Constructor and Description |
---|
DownloadStatusInfoImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addDownloadInfo(String downloadIdentifier,
ReliableResourceDownloader downloader,
ResourceResponse resourceResponse)
Adds a
ReliableResourceDownloadManager to the Map, which
is used by this.getDownloadStatus . |
void |
cancelDownload(String userId,
String downloadIdentifier)
Function for admin to cancel a download.
|
List<String> |
getAllDownloads()
Function to get all downloads.
|
List<String> |
getAllDownloads(String userId)
Function to get all downloads for a specific user.
|
Map<String,String> |
getDownloadStatus(String downloadIdentifier)
Function to get information about a specific download.
|
void |
removeDownloadInfo(String downloadIdentifier)
Function to remove the map entry corresponding to the downloadIdentifer passed it.
|
void |
setEventAdmin(org.osgi.service.event.EventAdmin eventAdmin) |
public void setEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)
public void addDownloadInfo(String downloadIdentifier, ReliableResourceDownloader downloader, ResourceResponse resourceResponse)
DownloadStatusInfo
ReliableResourceDownloadManager
to the Map, which
is used by this.getDownloadStatus
. Currently this is called in ReliableResourceDownloadManager
addDownloadInfo
in interface DownloadStatusInfo
downloadIdentifier
- Randomly generated String assigned to download at its start.public List<String> getAllDownloads()
DownloadStatusInfo
getAllDownloads
in interface DownloadStatusInfo
public List<String> getAllDownloads(String userId)
DownloadStatusInfo
getAllDownloads
in interface DownloadStatusInfo
userId
- The id of the user.this.getAllDownloads
.public Map<String,String> getDownloadStatus(String downloadIdentifier)
DownloadStatusInfo
getDownloadStatus
in interface DownloadStatusInfo
downloadIdentifier
- The randomly generated downloadId string assigned to the download at
its start.this.getAllDownloadsStatus
for details.public void removeDownloadInfo(String downloadIdentifier)
DownloadStatusInfo
this.getAllDownloadsStatus
, this.getDownloadStatus
, or this.getAllDownloads
.removeDownloadInfo
in interface DownloadStatusInfo
downloadIdentifier
- The randomly generated downloadId string assigned to the download at
its start.public void cancelDownload(String userId, String downloadIdentifier)
DownloadStatusInfo
cancelDownload
in interface DownloadStatusInfo
userId
- The Id assigned to the user who is downloading.downloadIdentifier
- The randomly generated downloadId string assigned to the download at
its start.This work is licensed under a Creative Commons Attribution 4.0 International License.