|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.scheisseichfindemalkeinen.queue.Restriction
public class Restriction
This class is to set a limit of simultanious downloads for a domain. An example: The hostclass for rapidshare sets a restriction of one simultanious downloads when the hostclass is set to free-user. Because rapidshare does not allow more than one simultanious downloads for free-users. So when a rapidshare download is started, the counter is increased. Now if a other rapidshare downloads requested a slot, QueueData checks what the restriction for rapidshare is. Then it checks if there are already too many connections for rapidshare, and so it lets the next rapidshare download only start, when the one downloading at the moment has finished. One domain must be set, but it is possible to set multiple domains. So the restriction takes care of all domains set. The equals- and compareTo-methods take only care about the single domain or first domain in the vector! But the equals-method check the whole vector if a string should be compared.
QueueCounter,
QueueData| Constructor Summary | |
|---|---|
Restriction(java.lang.String domain,
int maxSimultaneousDownloads)
Constructor |
|
Restriction(java.util.Vector<java.lang.String> domains,
int maxSimultaneousDownloads)
Constructor |
|
| Method Summary | |
|---|---|
int |
compareTo(Restriction o)
|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getDomain()
Returns the domain |
java.util.Vector<java.lang.String> |
getDomains()
Returns the domains |
int |
getMaxSimultaneousDownloads()
Returns the maximum of simultanious downloads for this domain |
void |
setMaxSimultaneousDownloads(int maxSimultaneousDownloads)
Sets the maximum of simultanious downloads for this domain |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Restriction(java.lang.String domain,
int maxSimultaneousDownloads)
domain - DomainmaxSimultaneousDownloads - Maximum
public Restriction(java.util.Vector<java.lang.String> domains,
int maxSimultaneousDownloads)
domains - DomainsmaxSimultaneousDownloads - Maximum| Method Detail |
|---|
public java.lang.String getDomain()
public java.util.Vector<java.lang.String> getDomains()
public int getMaxSimultaneousDownloads()
public void setMaxSimultaneousDownloads(int maxSimultaneousDownloads)
maxSimultaneousDownloads - Maximumpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(Restriction o)
compareTo in interface java.lang.Comparable<Restriction>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||