|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectspeedscheduler.SchedulePersistencyManager
public class SchedulePersistencyManager
Responsible for loading/saving schedules to/from disk. Listeners can register with this class to be notified when the user changes the saved schedules.
| Field Summary | |
|---|---|
private static SchedulePersistencyManager |
instance
Make it easy for people to get an instance of me. |
private java.util.Vector |
scheduleChangeListeners
Maintains a list of the registered listeners. |
private ScheduleIO |
scheduleIO
Where to save the schedules (TODO: hard-coded for now, find plugin dir and save there) |
private ScheduleIO |
scheduleIO2
|
| Constructor Summary | |
|---|---|
private |
SchedulePersistencyManager()
Create a new SchedulePersistencyManager. |
| Method Summary | |
|---|---|
void |
addScheduleChangeListener(ScheduleChangeListener listener)
If you want to know when the Schedules have changed, register here. |
int |
getDefaultMaxDownloadSpeed()
Gets the persisted default max download rate (used when no schedules apply). |
int |
getDefaultMaxUploadSpeed()
Gets the persisted default max upload rate (used when no schedules apply). |
static SchedulePersistencyManager |
getInstance()
Gets the singleton instance of this class. |
java.util.Vector |
getSchedules()
Gest the currently persisted Schedules. |
void |
loadSchedules()
|
void |
saveDefaultSpeeds(int defaultMaxUploadSpeed,
int defaultMaxDownloadSpeed)
|
void |
saveSchedules(java.util.Vector schedulesToSave,
int defaultMaxUploadSpeed,
int defaultMaxDownloadSpeed)
Save these Schedules and default up/down rates to the persistent file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.Vector scheduleChangeListeners
private static SchedulePersistencyManager instance
private ScheduleIO scheduleIO
private ScheduleIO scheduleIO2
| Constructor Detail |
|---|
private SchedulePersistencyManager()
| Method Detail |
|---|
public int getDefaultMaxUploadSpeed()
public int getDefaultMaxDownloadSpeed()
public static SchedulePersistencyManager getInstance()
pluginInterface -
public void addScheduleChangeListener(ScheduleChangeListener listener)
listener - The ScheduleChangeListener you want to be notified
when the user changes a Schedule.public java.util.Vector getSchedules()
public void saveSchedules(java.util.Vector schedulesToSave,
int defaultMaxUploadSpeed,
int defaultMaxDownloadSpeed)
throws java.io.IOException
schedulesToSave - defaultMaxUploadSpeed - defaultMaxDownloadSpeed -
java.io.IOException
public void saveDefaultSpeeds(int defaultMaxUploadSpeed,
int defaultMaxDownloadSpeed)
throws java.io.IOException
java.io.IOException
public void loadSchedules()
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||