001 /**
002 * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
003 * Licensed under the Apache License, Version 2.0 (the "License");
004 * you may not use this file except in compliance with the License.
005 * You may obtain a copy of the License at
006 *
007 * http://www.apache.org/licenses/LICENSE-2.0
008 *
009 * Unless required by applicable law or agreed to in writing, software
010 * distributed under the License is distributed on an "AS IS" BASIS,
011 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 * See the License for the specific language governing permissions and
013 * limitations under the License. See accompanying LICENSE file.
014 */
015 package org.apache.oozie.client;
016
017 import java.util.Date;
018 import java.util.List;
019
020 /**
021 * Bean that represents a workflow job.
022 */
023 public interface WorkflowJob {
024
025 /**
026 * Defines the possible stati of a workflow.
027 */
028 public static enum Status {
029 PREP, RUNNING, SUCCEEDED, KILLED, FAILED, SUSPENDED
030 }
031
032 //add NAME
033
034 /**
035 * Return the path to the workflow application for the workflow job.
036 *
037 * @return the path to the workflow application for the workflow job.
038 */
039 String getAppPath();
040
041 /**
042 * Return the name of the workflow application (from the workflow definition).
043 *
044 * @return the name of the workflow application.
045 */
046 String getAppName();
047
048 /**
049 * Return the workflow job ID.
050 *
051 * @return the workflow job ID.
052 */
053 String getId();
054
055 /**
056 * Return the job configuration.
057 *
058 * @return the job configuration.
059 */
060 String getConf();
061
062 /**
063 * Return the workflow job status.
064 *
065 * @return the workflow job status.
066 */
067 Status getStatus();
068
069 /**
070 * Return the workflow job last modified time.
071 *
072 * @return the workflow job last modified time.
073 */
074 Date getLastModifiedTime();
075
076 /**
077 * Return the workflow job creation time.
078 *
079 * @return the workflow job creation time.
080 */
081 Date getCreatedTime();
082
083 /**
084 * Return the workflow job start time.
085 *
086 * @return the workflow job start time.
087 */
088 Date getStartTime();
089
090 /**
091 * Return the workflow job end time.
092 *
093 * @return the workflow job end time.
094 */
095 Date getEndTime();
096
097 /**
098 * Return the workflow job user owner.
099 *
100 * @return the workflow job user owner.
101 */
102 String getUser();
103
104 /**
105 * Return the workflow job group.
106 *
107 * @return the workflow job group.
108 */
109 String getGroup();
110
111 /**
112 * Return the workflow job run number. <p/> Except for reruns, this property is always 1.
113 *
114 * @return the workflow job run number.
115 */
116 int getRun();
117
118 /**
119 * Return the workflow job console URL.
120 *
121 * @return the workflow job console URL.
122 */
123 String getConsoleUrl();
124
125 /**
126 * Return the workflow nodes that already executed and are executing.
127 *
128 * @return the workflow nodes that already executed and are executing.
129 */
130 List<WorkflowAction> getActions();
131
132 }