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 */
018package org.apache.oozie.client;
019
020import java.util.Date;
021
022/**
023 * Bean that represents a workflow action in a workflow job.
024 */
025public interface WorkflowAction {
026
027    /**
028     * Defines the possible stati of a action.
029     */
030    public static enum Status {
031        PREP,
032        RUNNING,
033        OK,
034        ERROR,
035        USER_RETRY,
036        START_RETRY,
037        START_MANUAL,
038        DONE,
039        END_RETRY,
040        END_MANUAL,
041        KILLED,
042        FAILED, }
043
044    /**
045     * Return the action action ID.
046     *
047     * @return the action action ID.
048     */
049    String getId();
050
051    /**
052     * Return the action name.
053     *
054     * @return the action name.
055     */
056    String getName();
057
058    /**
059     * Return the Credential.
060     *
061     * @return the Credential.
062     */
063    String getCred();
064    
065    /**
066     * Return the action type.
067     *
068     * @return the action type.
069     */
070    String getType();
071
072
073    /**
074     * Return the action configuration.
075     *
076     * @return the action configuration.
077     */
078    String getConf();
079
080    /**
081     * Return the current status of the action action.
082     *
083     * @return the current status of the action action.
084     */
085    Status getStatus();
086
087    /**
088     * Return the number of retries of the action.
089     *
090     * @return the number of retries of the action.
091     */
092    int getRetries();
093    
094    /**
095     * Return the number of user retry of the action.
096     *
097     * @return the number of user retry of the action.
098     */
099    int getUserRetryCount();
100    
101    /**
102     * Return the max number of user retry of the action.
103     *
104     * @return the max number of user retry of the action.
105     */
106    int getUserRetryMax();
107    
108    /**
109     * Return the interval of user retry of the action, in minutes.
110     *
111     * @return the interval of user retry of the action, in minutes.
112     */
113    int getUserRetryInterval();
114
115    /**
116     * Return the start time of the action action.
117     *
118     * @return the start time of the action action.
119     */
120    Date getStartTime();
121
122    /**
123     * Return the end time of the action action.
124     *
125     * @return the end time of the action action.
126     */
127    Date getEndTime();
128
129    /**
130     * Return the transition a action took.
131     *
132     * @return the transition a action took.
133     */
134    String getTransition();
135
136    /**
137     * Return the action data.
138     *
139     * @return the action data.
140     */
141    String getData();
142
143    /**
144     * Return the action statistics.
145     *
146     * @return the action statistics.
147     */
148    String getStats();
149
150    /**
151     * Return the external child IDs of the action.
152     *
153     * @return the external child IDs of the action.
154     */
155    String getExternalChildIDs();
156
157    /**
158     * Return the external ID of the action.
159     *
160     * @return the external ID of the action.
161     */
162    String getExternalId();
163
164    /**
165     * Return the external status of the action.
166     *
167     * @return the external status of the action.
168     */
169    String getExternalStatus();
170
171    /**
172     * Return the URL to programmatically track the status of the action.
173     *
174     * @return the URL to programmatically track the status of the action.
175     */
176    String getTrackerUri();
177
178    /**
179     * Return the URL to the web console of the system executing the action.
180     *
181     * @return the URL to the web console of the system executing the action.
182     */
183    String getConsoleUrl();
184
185    /**
186     * Return the error code of the action, if it ended in ERROR.
187     *
188     * @return the error code of the action.
189     */
190    String getErrorCode();
191
192    /**
193     * Return the error message of the action, if it ended in ERROR.
194     *
195     * @return the error message of the action.
196     */
197    String getErrorMessage();
198}