/**
   * Invoked each time a new job has been submitted to the Scheduler and validated.
   *
   * @param job the newly submitted job.
   */
  public void jobSubmittedEvent(JobState job) {
    for (SchedulerEventListener l : eventListeners) {
      l.jobSubmittedEvent(job);
    }

    super.jobSubmittedEvent(job);
  }
  /**
   * Invoked each time a scheduler event occurs.<br>
   * Scheduler events are stopped,started, paused, frozen, ...
   *
   * @param eventType the type of the event received.
   */
  public void schedulerStateUpdatedEvent(SchedulerEvent eventType) {

    for (SchedulerEventListener l : eventListeners) {
      l.schedulerStateUpdatedEvent(eventType);
    }
    super.schedulerStateUpdatedEvent(eventType);
  }
  /**
   * Invoked each time the state of a job has changed.<br>
   * If you want to maintain an up to date list of jobs, just use the {@link
   * org.ow2.proactive.scheduler.common.job.JobState#update(org.ow2.proactive.scheduler.common.job.JobInfo)}
   * method to update the content of your job.
   *
   * @param notification the data composed of the type of the event and the information that have
   *     change in the job.
   */
  public void jobStateUpdatedEvent(NotificationData<JobInfo> notification) {
    for (SchedulerEventListener l : eventListeners) {
      l.jobStateUpdatedEvent(notification);
    }
    super.jobStateUpdatedEvent(notification);

    update(notification);
  }
 /**
  * initialize the connection the scheduler. Must be called only once Restores the awaited jobs
  * list from file and starts transferring output data if available
  *
  * @param url the scheduler's url
  * @param credData the credential data to be passed to the scheduler
  * @throws SchedulerException thrown if the scheduler is not available
  * @throws LoginException thrown if the credential is invalid
  */
 @Override
 public void init(String url, CredData credData) throws SchedulerException, LoginException {
   // first we load the list of awaited jobs
   loadAwaitedJobs();
   //  we call super.init() which will create the connection to the
   // scheduler and subscribe as event listener
   super.init(url, credData);
   // now we can can check if we need to transfer any data
   checkResultsForAwaitedJobs();
 }
 /**
  * Invoked each time something change about users.
  *
  * @param notification the data composed of the type of the event and the data linked to the
  *     change.
  */
 public void usersUpdatedEvent(NotificationData<UserIdentification> notification) {
   for (SchedulerEventListener l : eventListeners) {
     l.usersUpdatedEvent(notification);
   }
   super.usersUpdatedEvent(notification);
 }
 /**
  * Invoked each time the state of a task has changed.<br>
  * In this case you can use the {@link
  * org.ow2.proactive.scheduler.common.job.JobState#update(org.ow2.proactive.scheduler.common.task.TaskInfo)}
  * method to update the content of the designated task inside your job.
  *
  * @param notification the data composed of the type of the event and the information that have
  *     change in the task.
  */
 public void taskStateUpdatedEvent(NotificationData<TaskInfo> notification) {
   for (SchedulerEventListener l : eventListeners) {
     l.taskStateUpdatedEvent(notification);
   }
   super.taskStateUpdatedEvent(notification);
 }