|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.scheisseichfindemalkeinen.queue.QueueData
public class QueueData
This class manages the download-slots. It contains also the counters and restrictions for domains. So this class allows a Pic to download or let them wait until a slot is free.
QueueCounter,
Restriction| Method Summary | |
|---|---|
void |
addCounter(QueueCounter counter)
Adds a counter If there is already a counter for a domain, the counter is not added. |
void |
addDLSlotListener(IDownloadListener l)
Requests a download slot |
void |
addQueueDataListener(IQueueDataListener l)
Adds a listener |
void |
addRestriction(Restriction restriction)
Adds a restriction If there is already a restriction for a domain the restriction is not added. |
int |
getConnectionCount()
Returns the maximum connection count |
int |
getOpenDownloadSlots()
Returns the open download slots |
int |
getQueueSize()
Returns the count of listeners which requested a download slot |
long |
getSessionDownloadedBytes()
Returns the downloaded bytes since application started |
int |
getSessionDownloadedFiles()
Returns the downloaded files since application started |
void |
increaseSessionDownloadedBytes(long downloadedBytes)
Increases the downloaded bytes since application started by downloadedBytes So QueueData will take the actual value and add downloadedBytes. |
void |
increaseSessionDownloadedFiles()
Increases the downloaded files since application started by 1 This method will fire the sessionDownloadedFilesChanged-Method on all listeners. |
static QueueData |
instance()
Returns the singleton |
boolean |
isDLSlotListenerRegistered(IDownloadListener l)
Returns if the listener is already registered |
boolean |
isDownloading()
Returns if downloads are running or not |
void |
manageDLSlots()
This method allows a Pic to start the download It checks the restrictions an counters and all needed things. |
void |
removeDLSlotListener(IDownloadListener l)
Gives the download-slot back to the queue This method must be used if the Pic has not the status Pic.WAITING. |
void |
removeDLSlotListenerStopping(IDownloadListener l)
Gives the download-slot back to the queue This method is only for a Pic with the status of Pic.WAITING. |
void |
removeQueueDataListener(IQueueDataListener l)
Removes a listener |
void |
removeRestriction(Restriction restriction)
Removes a restriction |
void |
setConnectionCount(int count)
Sets the maximum connection count |
void |
settingsChanged()
This method is fired when settings had changed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static QueueData instance()
public void setConnectionCount(int count)
count - Maximmum connection countpublic int getConnectionCount()
public int getOpenDownloadSlots()
public int getQueueSize()
public void addQueueDataListener(IQueueDataListener l)
l - Listenerpublic void removeQueueDataListener(IQueueDataListener l)
l - Listenerpublic void manageDLSlots()
public void addDLSlotListener(IDownloadListener l)
l - Listenerpublic void removeDLSlotListener(IDownloadListener l)
l - Listenerpublic void removeDLSlotListenerStopping(IDownloadListener l)
l - Listenerpublic boolean isDLSlotListenerRegistered(IDownloadListener l)
l - Listener
public boolean isDownloading()
public void settingsChanged()
ISettingsListener
settingsChanged in interface ISettingsListenerpublic int getSessionDownloadedFiles()
public long getSessionDownloadedBytes()
public void increaseSessionDownloadedFiles()
public void increaseSessionDownloadedBytes(long downloadedBytes)
downloadedBytes - Downloaded bytespublic void addRestriction(Restriction restriction)
restriction - Restrictionpublic void removeRestriction(Restriction restriction)
restriction - Restrictionpublic void addCounter(QueueCounter counter)
counter - QueueCounter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||