thread
Class Thread_Control_Schedul

java.lang.Object
  extended by java.lang.Thread
      extended by thread.Thread_Control_Schedul
All Implemented Interfaces:
java.lang.Runnable

public class Thread_Control_Schedul
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Thread_Control_Schedul(Gui_StreamRipStar mainGui, Control_Threads controlThread)
           
 
Method Summary
 void addToSchedulVector(SchedulJob job)
          add an schedul job to the end of the vector witch contains all schedul jobs
 void calculateNextJobTime(SchedulJob job, java.lang.Boolean forceUpdate)
          Calculates the next start- and endtime for an daily and weekly schedul job.
 void deleteAllJobsFromStream(int id)
          Search in all available schedules for an job with the stream ID and deletes all off them
 java.util.Vector<SchedulJob> getScheduleVector()
           
 SchedulJob getSchedulJobByID(int id)
          looks in the scheduljob vector for in job by an ID
 java.lang.Boolean jobStillExist(int ID)
          looks if a schedul job still exist.
 void loadScheduleJobsOnStart()
          loads all scheduljobs on start from xml-file and save it into the vector witch contains all jobs
 void removeJobFromVector(int id)
          removes an scheduljob from Vector.
 void run()
          runs forever.
 void saveScheduleVector()
          saves all jobs in the vector
 void setNextTimeForAllJobs()
           
 void setUpdateView(java.lang.Boolean update)
          set an new status to the update
 java.lang.Boolean shouldUpdate()
           
 void stopScheduler()
          Stop this Thread
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Thread_Control_Schedul

public Thread_Control_Schedul(Gui_StreamRipStar mainGui,
                              Control_Threads controlThread)
Method Detail

run

public void run()
runs forever. It looks every second in the array of scheduljobs if a new stream can be recorded

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopScheduler

public void stopScheduler()
Stop this Thread


addToSchedulVector

public void addToSchedulVector(SchedulJob job)
add an schedul job to the end of the vector witch contains all schedul jobs

Parameters:
job -

loadScheduleJobsOnStart

public void loadScheduleJobsOnStart()
loads all scheduljobs on start from xml-file and save it into the vector witch contains all jobs


getScheduleVector

public java.util.Vector<SchedulJob> getScheduleVector()
Returns:
the Vector containing all scheduljobs

getSchedulJobByID

public SchedulJob getSchedulJobByID(int id)
looks in the scheduljob vector for in job by an ID

Parameters:
id: - the ID of the scheduljob in xml-file
Returns:
the scheduljob with the ID in xml-file

removeJobFromVector

public void removeJobFromVector(int id)
removes an scheduljob from Vector.

Parameters:
id: - The ID in xml-file from the scheduljob

calculateNextJobTime

public void calculateNextJobTime(SchedulJob job,
                                 java.lang.Boolean forceUpdate)
Calculates the next start- and endtime for an daily and weekly schedul job.

Parameters:
job: - The schedul job for witch the new time should calculate.

setNextTimeForAllJobs

public void setNextTimeForAllJobs()

setUpdateView

public void setUpdateView(java.lang.Boolean update)
set an new status to the update

Parameters:
update: - true, if the ui should updated

shouldUpdate

public java.lang.Boolean shouldUpdate()

jobStillExist

public java.lang.Boolean jobStillExist(int ID)
looks if a schedul job still exist.

Parameters:
ID: - the job ID in xml-file and schedulvector

deleteAllJobsFromStream

public void deleteAllJobsFromStream(int id)
Search in all available schedules for an job with the stream ID and deletes all off them

Parameters:
id: - the stream id

saveScheduleVector

public void saveScheduleVector()
saves all jobs in the vector