public class DownloadManagerService extends Object implements DownloadManagerServiceMBean
Constructor and Description |
---|
DownloadManagerService(DownloadStatusInfo downloadStatusInfo) |
Modifier and Type | Method and Description |
---|---|
void |
cancelDownload(String userId,
String downloadIdentifier)
Function to cancel a download.
|
void |
destroy() |
List<String> |
getAllDownloads()
Function to get all downloads.
|
List<String> |
getAllDownloads(String userId)
Function to get all downloads for a specific user.
|
List<Map<String,String>> |
getAllDownloadsStatus()
Function to get information about every download.
|
Map<String,String> |
getDownloadStatus(String downloadIdentifier)
Function to get information about a specific download.
|
void |
init() |
void |
removeDownloadInfo(String downloadIdentifier)
Function to remove the map entry corresponding to the downloadIdentifer passed it.
|
public DownloadManagerService(DownloadStatusInfo downloadStatusInfo)
public void init()
public void destroy()
public List<Map<String,String>> getAllDownloadsStatus()
DownloadManagerServiceMBean
getAllDownloadsStatus
in interface DownloadManagerServiceMBean
public Map<String,String> getDownloadStatus(String downloadIdentifier)
DownloadManagerServiceMBean
getDownloadStatus
in interface DownloadManagerServiceMBean
downloadIdentifier
- The randomly generated downloadId string assigned to the download at
its start.this.getAllDownloadsStatus
for details.public List<String> getAllDownloads()
DownloadManagerServiceMBean
getAllDownloads
in interface DownloadManagerServiceMBean
public List<String> getAllDownloads(String userId)
DownloadManagerServiceMBean
getAllDownloads
in interface DownloadManagerServiceMBean
userId
- The id of the user.this.getAllDownloads
.public void removeDownloadInfo(String downloadIdentifier)
DownloadManagerServiceMBean
this.getAllDownloadsStatus
, this.getDownloadStatus
, or this.getAllDownloads
.removeDownloadInfo
in interface DownloadManagerServiceMBean
downloadIdentifier
- The randomly generated downloadId string assigned to the download at
its start.public void cancelDownload(String userId, String downloadIdentifier)
DownloadManagerServiceMBean
cancelDownload
in interface DownloadManagerServiceMBean
userId
- The id of the user who is performing the download.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.