001/**
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  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.apache.oozie.client;
020
021import java.util.Date;
022import java.util.List;
023
024/**
025 * Bean that represents a workflow job.
026 */
027public interface WorkflowJob {
028
029    /**
030     * Defines the possible stati of a workflow.
031     */
032    enum Status {
033        PREP, RUNNING, SUCCEEDED, KILLED, FAILED, SUSPENDED
034    }
035
036    //add NAME
037
038    /**
039     * Return the path to the workflow application for the workflow job.
040     *
041     * @return the path to the workflow application for the workflow job.
042     */
043    String getAppPath();
044
045    /**
046     * Return the name of the workflow application (from the workflow definition).
047     *
048     * @return the name of the workflow application.
049     */
050    String getAppName();
051
052    /**
053     * Return the workflow job ID.
054     *
055     * @return the workflow job ID.
056     */
057    String getId();
058
059    /**
060     * Return the job configuration.
061     *
062     * @return the job configuration.
063     */
064    String getConf();
065
066    /**
067     * Return the workflow job status.
068     *
069     * @return the workflow job status.
070     */
071    Status getStatus();
072
073    /**
074     * Return the workflow job last modified time.
075     *
076     * @return the workflow job last modified time.
077     */
078    Date getLastModifiedTime();
079
080    /**
081     * Return the workflow job creation time.
082     *
083     * @return the workflow job creation time.
084     */
085    Date getCreatedTime();
086
087    /**
088     * Return the workflow job start time.
089     *
090     * @return the workflow job start time.
091     */
092    Date getStartTime();
093
094    /**
095     * Return the workflow job end time.
096     *
097     * @return the workflow job end time.
098     */
099    Date getEndTime();
100
101    /**
102     * Return the workflow job user owner.
103     *
104     * @return the workflow job user owner.
105     */
106    String getUser();
107
108    /**
109     * Return the workflow job group.
110     * <p>
111     * Use the {@link #getAcl()} method instead.
112     *
113     * @return the workflow job group.
114     */
115    @Deprecated
116    String getGroup();
117
118    /**
119     * Return the workflow job group.
120     *
121     * @return the workflow job group.
122     */
123    String getAcl();
124
125    /**
126     * Return the workflow job run number. <p> Except for reruns, this property is always 1.
127     *
128     * @return the workflow job run number.
129     */
130    int getRun();
131
132    /**
133     * Return the workflow job console URL.
134     *
135     * @return the workflow job console URL.
136     */
137    String getConsoleUrl();
138    
139    /**
140     * Return the coordinator action ID or the parent workflow ID
141     *
142     * @return the coordinator action ID/ Parent Workflow ID.
143     */
144    String getParentId();
145
146    /**
147     * Return the workflow nodes that already executed and are executing.
148     *
149     * @return the workflow nodes that already executed and are executing.
150     */
151    List<WorkflowAction> getActions();
152
153    /**
154     * Returns the external id for the workflow
155     *
156     * @return external id for the workflow
157     */
158    String getExternalId();
159
160}