001/*
002 * JPPF.
003 * Copyright (C) 2005-2018 JPPF Team.
004 * http://www.jppf.org
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019package org.jppf.client.event;
020
021import java.util.EventObject;
022
023import org.jppf.client.JobStatus;
024
025
026/**
027 * Instances of this class represent a status change notification for a jppf job.
028 * @author Laurent Cohen
029 */
030public class JobStatusEvent extends EventObject {
031  /**
032   * Explicit serialVersionUID.
033   */
034  private static final long serialVersionUID = 1L;
035  /**
036   * The status of the job.
037   */
038  private JobStatus status = null;
039
040  /**
041   * Initialize this event with the specified job uuid and status.
042   * @param jobUuid the uuid of the job whose status has changed.
043   * @param status the new status of the job.
044   * @exclude
045   */
046  public JobStatusEvent(final String jobUuid, final JobStatus status) {
047    super(jobUuid);
048    this.status = status;
049  }
050
051  /**
052   * The status of the job.
053   * @return a <code>SubmissionStatus</code> typesafe enum value.
054   */
055  public JobStatus getStatus() {
056    return status;
057  }
058
059  /**
060   * Get the id of the job.
061   * @return the job id as a string.
062   */
063  public String getJobUuid() {
064    return (String) getSource();
065  }
066}